-
Notifications
You must be signed in to change notification settings - Fork 510
Store editable list filters in local storage #6192
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
Store editable list filters in local storage #6192
Conversation
3f7b65e to
73e04c1
Compare
indico/modules/events/editing/client/js/management/editable_type/NextEditable.jsx
Outdated
Show resolved
Hide resolved
|
I wonder if there's a way to avoid the logic around |
73e04c1 to
d60ffef
Compare
yeah, thats the whole problem. you'll always need a |
|
I haven't really looked at the code in-depth yet, but can't we just call a function that saves the state in local storage when changing the state? Something like this: |
we can do that, but we'll still need the |
|
a useEffect with an empty dependency list (since you'd only want to run this a single time) feels cleaner than very complex useEffect functions |
a0b71d7 to
c1e801d
Compare
This fixes the (existing) bug of selected options disappearing when they become invalid, which could happen with external filters, and with this PR it could also happen with internal filters if changes were made.
c1e801d to
c43d173
Compare
ThiefMaster
left a comment
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.
Seems to work fine, not really going to look deep into the filtering code :D
This PR makes it so that filters applied in editable lists (both the main editable list and the "get next editable") get stored in the browser's local storage. It also fixes a bug with external filters in which active filter options disappear when they become unavailable (such as a keyword no longer being present in the filtered search results).