CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

Datatables Persistent URL Tracking Fix

Open serpentblade opened this issue 2 years ago • 4 comments

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.:

git checkout "dev-branch-name" &&
cd vendor/backpack/crud && git checkout crud-branch-name &&
cd ../pro && git checkout pro-branch-name &&
cd ../../..

serpentblade avatar Oct 02 '23 01:10 serpentblade

BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.

Please keep in mind that:

  • if this constitutes a breaking change, it might take quite a while for this to get merged; we try to emulate the Laravel release cycle as much as possible, so developers can upgrade both software once; this means a new big release every ~6 months;
  • even if it's a non-breaking change, it might take a few days/weeks for the PR to get merged; unless it's a no-brainer, we like to have some community feedback on new features, before we merge them; this leads to higher-quality code, in the end; we learnt this the hard way :-)
  • not all PRs get merged; sometimes we just have to hold out new features, to keep the packages lean; sometimes we don't include features that only apply to niche use cases;
  • we're not perfect; if you think we're wrong, call us out on it; but in a kind way :-) we all make mistakes, best we learn from them and build better software together;

Thank you!

-- Justin Case The Backpack Robot

welcome[bot] avatar Oct 02 '23 01:10 welcome[bot]

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. Cheers!

tabacitu avatar Oct 02 '23 06:10 tabacitu

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.

serpentblade avatar Nov 11 '23 19:11 serpentblade

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 🙏

pxpm avatar Nov 13 '23 10:11 pxpm

WHOOP-WHOOP! Congrats, your first PR on this repo has officialy been merged.

party

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:

  • give your opinion on other Github Issues & PRs;
  • chat with others in the Gitter Chatroom (usually for quick help: How do I do X);
  • answer Backpack questions on Stackoverflow; you get points, people get help; you can subscribe to the backpack-for-laravel tag by adding a new filter; that will send you emails when new questions come up with our tag;

Again. Thank you for the PR. You are a wonderful person. Keep 'em coming :-) Cheers!

-- Justin Case The Backpack Robot

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!

welcome[bot] avatar Mar 29 '24 10:03 welcome[bot]

Totally missed this. So sorry @serpentblade

Thanks for the PR 🙏

pxpm avatar Mar 29 '24 10:03 pxpm