react-admin
react-admin copied to clipboard
Add the possibility to hide savedquery option with property in filter-button
After updating react-admin v4 added SavedQueriesList functionality. This functionality is very valid for some cases, but I don't think that all areas of an application would be interesting to have this SavedQueriesList.
The problem is that today there is no parameter that can disable this functionality in the listing. I would like to suggest a property to hide the savedquery and if allowed would raise the PR by adding.
Hi, and thanks for your suggestion. Could you list a few use cases where you would not want to let users save a combination of filters they have applied to a list?
I have a use case, we're developing a feature to make the saved queries persistent between different devices, so we're going to save them in our database and load them on user login. In the meantime, we would like to disable it to avoid confusion among the users.
Hi @fzaninotto today my main problem is because we want to enable this functionality incrementally per client, so we had to abstract this component. However, I made some suggestions.
- Don't create confusion for areas that shouldn't have this type of filter
- in terms of data protection, there may be some platform conditions that restrict the persistence of information. In this way, the filter could not be used to persist a target just for real-time query.
- Another case I see is a listing where there is only real-time data. In this case, there is no need to save the filter as the saved data may no longer exist. In this case would not have a useful filter.
- Listings that have only a single filter, for example a boolean filter, this listing would not need this functionality, as it would be redundant.
- Custom filter forms that for some reason are not so well compatible with the saved query, but that already use the filter button in their structure
This would be useful for us as well: We use our own saved queries that also save the user's selected columns, including the order of those columns, along with the sort and filters.
Thanks for your insights! These are valid use cases, so I'm marking this as an enhancement.
The react-admin core team doesn't need this feature, so we won't spend time on it in the foreseeable future. Feel free to open a PR to implement it.
If this request receives no contribution, we'll close it within a month.
I will push up the pr
Wait, there is something I don't understand. Adding the <SavedQueriesList>
to a sidebar is totally opt-in. What is the problem.
Wait, there is something I don't understand. Adding the
<SavedQueriesList>
to a sidebar is totally opt-in. What is the problem.
While @oguhpereira had referred specifically to the SaveQueriesList component, I had understood this issue to also pertain to the "Save current query..." option and related functionality within the "Add Filter" button/menu.
Wait, there is something I don't understand. Adding the
<SavedQueriesList>
to a sidebar is totally opt-in. What is the problem.While @oguhpereira had referred specifically to the SaveQueriesList component, I had understood this issue to also pertain to the "Save current query..." option and related functionality within the "Add Filter" button/menu.
Exactly ended up generating a small mistake in relation to that point. The pr that I am proposing is exactly to give the possibility of not displaying the save query in the filter button. I corrected the description, sorry for the mistake @fzaninotto
I created a pr here to make it clearer what I mean.
Fixed by #8113