fundamental-ngx icon indicating copy to clipboard operation
fundamental-ngx copied to clipboard

Searching issue in fdp-approval-flow

Open Peeeeeeter opened this issue 2 years ago • 3 comments

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.

Screen Shot 2022-04-04 at 2 59 02 PM Screen Shot 2022-04-04 at 2 59 32 PM #### Please provide relevant source code if applicable. Screen Shot 2022-04-04 at 3 13 23 PM

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?

Peeeeeeter avatar Apr 04 '22 22:04 Peeeeeeter

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());

g-cheishvili avatar Jul 06 '22 09:07 g-cheishvili

Thanks for the answering, I will try this works or not, and will provide an update here soon.

Peeeeeeter avatar Jul 08 '22 21:07 Peeeeeeter

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).

fkolar avatar Jul 25 '22 06:07 fkolar