-
Notifications
You must be signed in to change notification settings - Fork 902
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
Datatables Persistent URL Tracking Fix #5330
Conversation
Under certain circumstances we want to render a table but not remember filtering. The flag for disabling table persistence is correct in that it doesn't trigger the redirect, however any changes made while that page is loaded still updates the localStorage value tracking filters so when a user returns to the regular persistence-enabled table it recreates the non-persistent state. Update assures the the localStorage value code only runs when table persistence is enabled.
BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly. Please keep in mind that:
Thank you! -- |
Hmm didn't know that. Thanks @serpentblade ! I'll let @pxpm test and merge this, he's in charge of our point releases. Keep 'em coming. |
Any updates on getting this merged? Happy to discuss any concerns with this change. We'd love to have it fixed as we're currently overriding the entire blade template just for this small fix. |
Hey @serpentblade, sorry for the delay I've been away last week. I will have a look at it during this week and get back to you 🙏 |
WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged. You should also receive an email inviting you to the Community Members team. That's where we, commited community members, debate new features and decide what's in the Backpack roadmap. Feel free to ignore the invitation if you're not interested :-) If you want to help out the community in other ways, you can:
Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) -- P.S. Help in the Backpack community is rewarded with free Backpack commercial licenses. It's the least we can do. If you feel you've helped the community with PRs, help & other stuff, please apply for free licenses and mention this PR. You scratch my back, I scratch your back. Thank you! |
Totally missed this. Thanks for the PR 🙏 |
WHY
BEFORE - What was wrong? What was happening before this PR?
Under certain circumstances we want to render a table but not remember filtering. The flag for disabling table persistence is correct in that it doesn't trigger the redirect, however any changes made while that page is loaded still updates the localStorage value tracking filters so when a user returns to the regular persistence-enabled table it recreates the non-persistent state.
AFTER - What is happening after this PR?
When persistence is disabled it no longer updates the tracking variable.
HOW
How did you achieve that, in technical terms?
Update assures the the localStorage value code only runs when table persistence is enabled by wrapping the line in question in an if-block.
Is it a breaking change?
No.
How can we test the before & after?
Before: Disable table persistence on crud and monitor the application localStorage to see that a value is populated and updates as people use the rendered datatables.
After: localStorage is not updated/modified when persistence is disabled.
If the PR has changes in multiple repos please provide the command to checkout all branches, eg.: