File

core/dynamic-component/dynamic-details-resolver.ts

Description

An abstract class to simplify implementing the DynamicDetailsResolver interface for performing bulk resolving.

Implements

DynamicDetailsResolver

Index

Properties
Methods

Constructor

constructor(dynamicResolver: DynamicResolverService)
Parameters :
Name Type Optional
dynamicResolver DynamicResolverService No

Properties

Protected idsGroupedByBulkId
Default value : new Map<number, string[]>()

Map containing the ids to be retrieved per bulk request.

resultsOfBulkLoad
Type : Observable<literal type>

Provides an Observable of the results of all bulk requests.

Methods

addIdsToBeLoaded
addIdsToBeLoaded(bulkRequestId: number, ...ids: string[])

Adds a single id or an array of ids to the idsGroupedByBulkId Map for the provided bulkRequestId.

Parameters :
Name Type Optional
bulkRequestId number No
ids string[] No
Returns : void
Abstract buildRetrievalAlert
buildRetrievalAlert(entity: Partial, errors?: Array)

Called in case a specific id wasn't found as part of the returned dataset.

Parameters :
Name Type Optional
entity Partial<T> No
errors Array<literal type> Yes
Protected Abstract extractIdsToBeRetrieved
extractIdsToBeRetrieved(valueBehindAttribute: Partial | Array>)

Used to extract the ids to be provided to the performBulkRequest method from the configuration.

Parameters :
Name Type Optional
valueBehindAttribute Partial<T> | Array<Partial<T>> No
Returns : string | []
getResult$
getResult$(bulkRequestId: number)

Provides an Observable of the results of the given bulkRequestId.

Parameters :
Name Type Optional
bulkRequestId number No
Returns : Observable<literal type>
Protected isEntityOfId
isEntityOfId(obj: T, id: string)

Checks wether an object is of given id. Will by default compare the id attribute with the given id.

Parameters :
Name Type Optional
obj T No
id string No
Returns : boolean
Protected Abstract performBulkRequest
performBulkRequest(uniqIds: string[], bulkRequestId: number)

Used to perform the request(s) to retrieve the provided ids.

Parameters :
Name Type Optional
uniqIds string[] No
bulkRequestId number No
Returns : Promise | Observable
resolve
resolve(config: any, attribute: string, bulkRequestId: number)
Parameters :
Name Type Optional
config any No
attribute string No
bulkRequestId number No
serialize
serialize(config: any, attribute: string)

Default implementation compatible with serializing an object or an Array of objects. Calls serializeSingleObject for an object and for every entry within the array.

Parameters :
Name Type Optional
config any No
attribute string No
Returns : Partial | Array
Protected Abstract serializeSingleObject
serializeSingleObject(obj: T)

Responsible for serializing a single object. The returned value will be e.g. stored in the widgets configuration to the backend. It should reduce the provided object to it's essentials attributes to find it via API, so e.g. the id. It is basically reversing the thing performed as part of the resolve method.

Parameters :
Name Type Optional
obj T No
Returns : Partial<T>

results matching ""

    No results matching ""