We've recently modified most of our components handling API data to standardize their API.
We did not modify the cc-addon-credentials component at the time because it was being modified to integrate materia-kv and because it's current API design was a little bit trickier to migrate.
The component is given a "type" which corresponds to an "AddonType" and it's also given "credentials" which is an array of different credential types.
Credentials must be given to the component even when it is in loading state (you pass credentials with no values). The component goes into skeleton when credential values are null / undefined.
What is weird about the current design is that there is no relationship between the type and the credentials.
This means devs can pass a port credential which will be displayed even for a materia-kv product where it does not make sense.
Should the component maintain the list of credentials to apply for every addon type it can handle?
Context
We've recently modified most of our components handling API data to standardize their API.
We did not modify the
cc-addon-credentials
component at the time because it was being modified to integratemateria-kv
and because it's current API design was a little bit trickier to migrate.The component is given a "type" which corresponds to an "AddonType" and it's also given "credentials" which is an array of different credential types.
Credentials must be given to the component even when it is in loading state (you pass credentials with no values). The component goes into skeleton when credential values are
null
/undefined
.What is weird about the current design is that there is no relationship between the
type
and thecredentials
. This means devs can pass aport
credential which will be displayed even for amateria-kv
product where it does not make sense.Should the component maintain the list of credentials to apply for every addon type it can handle?