Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

arndom
Copy link
Contributor

@arndom arndom commented Oct 6, 2024

  • Update 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

- reset filters and sorters used in tables on URL query clear
@arndom arndom requested a review from a team as a code owner October 6, 2024 21:16
Copy link

changeset-bot bot commented Oct 6, 2024

🦋 Changeset detected

Latest commit: d72941e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Patch

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

@arndom arndom changed the title Fix/core/list url params fix/(core): reset table filters and sorters on current page re-navigate via side-nav Oct 6, 2024
@arndom arndom changed the title fix/(core): reset table filters and sorters on current page re-navigate via side-nav fix(core): reset table filters and sorters on current page re-navigate via side-nav Oct 6, 2024
Copy link
Member

@BatuhanW BatuhanW left a 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.

.changeset/spicy-flowers-allow.md Outdated Show resolved Hide resolved
@BatuhanW BatuhanW changed the base branch from master to releases/october October 7, 2024 12:23
Copy link
Member

@aliemir aliemir left a 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 🙏

@arndom
Copy link
Contributor Author

arndom commented Oct 12, 2024

@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

@aliemir aliemir deleted the branch refinedev:master October 14, 2024 12:54
@aliemir aliemir closed this Oct 14, 2024
@aliemir aliemir reopened this Oct 14, 2024
@aliemir aliemir changed the base branch from releases/october to master October 14, 2024 12:57
@BatuhanW
Copy link
Member

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.

@arndom
Copy link
Contributor Author

arndom commented Oct 28, 2024

@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 syncWithLocation defined in refine context is used by multiple implementations for params syncing, a change in all those may provide a fix (possibly a shared function). I am unsure about its efficiency or if there are better solutions as I haven't spent that much time in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] not clear filters and sorters when clicking menu item
3 participants