-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Improve lists URL management #11022
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
Improve lists URL management #11022
Conversation
|
Why are all the packages.json updated? |
Probably my editor, reverting |
ccd5b2b to
22a9fab
Compare
22a9fab to
f545c8d
Compare
| if (currentStoreKey.current !== storeKey) { | ||
| // storeKey has changed | ||
| currentStoreKey.current = storeKey; | ||
| return; |
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.
It should return only if the URL already has params; if it’s empty, we need to sync from the store (when disableSyncWithLocation is false, of course).
if (Object.keys(queryFromLocation).length > 0) {
return;
}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.
Mmm, a test is needed for this
Problem
When users are redirected to a list page for which they previously applied some parameters (page, perPage, filters, etc.), they don't see those parameters reflected in the URL even though they are indeed applied on the list. This happens for instance when redirected from an edition page. This makes the URL non shareable anymore and can be surprising.
Fixes #11018
Solution
When the list loads, if there are stored parameters and those are not reflected in the URL, update the URL except if:
disableSyncLocationistrue/posts)How To Test
make runPerformances
nextbranch, repeat the steps above but enable the react profiler (devtool) before clicking Save at step 3. Note the number of renders of theListcomponentAdditional Checks
masterfor a bugfix or a documentation fix, ornextfor a featureAlso, please make sure to read the contributing guidelines.