fundamental-ngx
fundamental-ngx copied to clipboard
Searching issue in fdp-approval-flow
Is this a bug, enhancement, or feature request?
Bug
Briefly describe your proposal.
When search Users in fdp-approval-flow, it is not able to do a real API search, instead, this component is doing a interval filtering on the data it has, so in the case a customer has large user data set, it is not possible to load all users initially, so in this case lazy loading is running, the getUsers api will only return top 3000 user and then passed to ApprovalDataSource that fdp-approval-flow interact with.
Then there is no way for customer to query users that out of the initial set. fdp-approval-flow should provide a way to make this feasible. proposal: 1.add a new interface that got trigger when searching in ApprovalDataSource, so we can give a concrete implementation to do a API search and update the datasource. 2. Or, fdp-approval-flow should emit the event out to the container component so we can handle.
Which versions of Angular and Fundamental Library for Angular are affected? (If this is a feature request, use current version.)
Issues were found on latest release: v0.33.5
If this is a bug, please provide steps for reproducing it.



As you can see, the provided interface doesn't support run additional searching. the component is assuming that all data was contained already inside itself, but his is not always the case.
Is there anything else we should know?
This is doable with existing tools.
When you create these variables for passing them to the approval flow, you can implement DataProvider
in a way that it works with backend values. Satisfy DataProvider<ApprovalUser>
interface and you're good to go
userDataSource = new ApprovalFlowUserDataSource(new UserDataProvider());
watcherDataSource = new ApprovalFlowUserDataSource(new UserDataProvider());
teamDataSource = new ApprovalFlowTeamDataSource(new TeamDataProvider());
Thanks for the answering, I will try this works or not, and will provide an update here soon.
All the data driven components, were designed to work with large data sets so we have DataSource
, which is always specific to the components (ComboboxDS, TableDS, etc.. ) and DataProviders
, which can be used across all the different DataSources.
I believe you are using default implementation of DataProvider which works with Arrays, so you fetch everything and pass this whole payload into the Default DP and this is why you are seeing this behavior.
At the time of implementing this there was no standardised API so the idea was that each Application team is able to implement their own.
If your API is unified across all the services, then I would create more generic DP e.. :
class EntityDataProvider implements DataProvider {
}
I would assume you have some state management in place or at least some registry so you are able to retrieve connection based on the entity Type (name).