List: show empty page when only permanent filters are applied#11124
List: show empty page when only permanent filters are applied#11124AarishMansur wants to merge 1 commit intomarmelab:masterfrom
Conversation
slax57
left a comment
There was a problem hiding this comment.
Thank you for this pull request.
However, I'm not sure about the issue you are trying to solve in the first place.
When I try in this stackblitz, setting a permanent filter on the Post List ({ commentable: false }) and then deleting all the non commentable posts does show the Empty page with the Create button.
Am I missing something?
|
Hello, You’re right that in the scenario you described, the empty page is shown. When relying on the List-level My goal was to make If you think this distinction isn’t desirable anymore, I’m happy to adjust or close the PR Thanks |
|
@AarishMansur Thanks for the reply. |
|
Thanks, guess I have to look for more issues . Happy to revisit if a concrete use case comes up. |
Problem
When a
Listis rendered with a permanent filter via thefilterprop and the query returns no records, theemptycomponent is not displayed.This happens because permanent filters are currently treated the same as user applied filters when deciding whether to render the empty page, even though permanent filters are not a user decision.
As a result, users are not prompted to create a record within the fixed scope defined by the permanent filter.
Solution
Forward the permanent
filterprop fromListtoListViewand use it to distinguish permanent filters from user-applied filters when computing the empty state.The empty page is now rendered when:
Permanent filters no longer prevent the empty page from being displayed, while user applied filters continue to behave as before.
How To Test
Listwith a permanent filter using thefilterprop and anemptycomponent.A unit test has been added to cover this scenario.
Additional Checks
nextfor a featureAlso, please make sure to read the contributing guidelines.