core/dynamic-component/dynamic-details-resolver.ts
A DynamicDetailsResolver is responsible to resolve items of a dynamic components configuration. Ideally the resolve method is implemented in a way that causes not a request per component instance. Instead it should collect the requests it would like to perform within the resolve method, and returns a Promise/Observable that takes care that duplicate objects are just retrieved a single time. The bulkResolvingTrigger$ of the DynamicResolverService can be utilized to know when bulk resolving should be triggered.
The serialize method is used for storing the configuration within the backend. It should be implemented in a way, that will reduce it's output to only the required attributes of the entity that are needed for retrieving it afterwards again via the resolve method.
Methods |
resolve | ||||||||||||||||
resolve(config: any, attribute: string, bulkRequestId: number)
|
||||||||||||||||
Used to resolve/refresh a certain attribute of a widgets configuration.
Parameters :
T |
serialize | ||||||||||||
serialize(config: any, attribute: string)
|
||||||||||||
Used to serialize a certain attribute of a dynamic components configuration. This is e.g. used when storing the configuration of a widget on a dashboard to the backend. Usually you should be able to reduce the stored configuration to only e.g. the id of the entity instead of storing the complete entity.
Parameters :
Returns :
Partial | Array
any The serialized value behind the attribute. |