-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): reset table filters and sorters on current page re-navigate via side-nav #6389
fix(core): reset table filters and sorters on current page re-navigate via side-nav #6389
Conversation
- reset filters and sorters used in tables on URL query clear
🦋 Changeset detectedLatest commit: 089edd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @arndom thanks for the PR, please make sure to add tests for the behavior.
Co-authored-by: Batuhan Wilhelm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @arndom thank you for your effort! 🙏 I've left a comment in the issue (#6300 (comment)) about the implementation we're looking for.
While your changes will work for the reported case, it won't cover other cases such as changing the query params without using the useTable
hook.
Let us know if you can work on the changes described in the comment 🙏
@aliemir Sure, it's best to finish what I started properly...though I may need some guidance as I'm still fresh on the codebase |
Hey @arndom are you gonna be able to continue on this PR? Please let us know if you need help with a specific issue. We'd be happy to guide you through. |
@BatuhanW I still plan to, I just haven't had the time recently due to my work schedule. Some help on the approach to solving this would be great. My current thought process: Since |
31011aa
to
4864ec7
Compare
4864ec7
to
2810644
Compare
@aliemir I believe the recent commits take into consideration the updating of filters and sorters; URL state -> internal state and vice versa. |
Hey @arndom, I've tried on my local but looks like the effect is exceeding the max depth and even if I ignore it, it starts looping when I have a change in filters 🤔 I'll try to look again to see what went wrong and at least provide tips to get it back on track 🙏 |
Sorry about that, seems I did not test properly, I'll go through it again and resolve the issues |
- prevent watched url filters from being early triggered by change to url by internal filter
7b46480
to
20d1c42
Compare
Hey @arndom feel free to re-open it when your changes are complete. |
useTable
hook to handle case where a user navigates to current page by clicking side-nav link intending to reset the filters and sorters.PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
In a table, apply some filters/sorters then click the menu item in the sidebar, the URL should reset filters and sorters to the default but it doesn't.
This can be previewed at https://example.admin.refine.dev/orders
What is the new behavior?
The above has been resolved. It resets the query params for filters and sorters back to their defaults.
fixes #6300
Notes for reviewers