-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Added remembering filter properties of plugin events grid in browser url #15935
Added remembering filter properties of plugin events grid in browser url #15935
Conversation
In this case we need to remember the selected tab as well. |
I agree, I would add But I don't know how to do it right. Maybe @smg6511 will help. It would be a very useful improvement, see #14086. |
OK, I'll put this on my plate to take a look at. |
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
manager/assets/modext/widgets/element/modx.grid.plugin.event.js
Outdated
Show resolved
Hide resolved
@Ruslan-Aleev - OK, I have the solution for activating the correct tab. What's the best way to relay that addition to you for this PR? |
@smg6511 I won't add that with an anchor in the url, since there can be more than one tab group available i.e. two nested horizontal and vertical tabs groups. |
@smg6511 I mean GLOBAL improvement, not only within this PR. Somehow to keep track of active tabs, and take them into account when reloading the page. |
I only meant the last active tab that the user clicked. Because this is most often in the grid, then at first glance this would be enough. Or in general, make this behavior only for grids. |
@Ruslan-Aleev @Jako - The functionality to remember the state of a page is already there (by setting and few params in a tab panel’s config; see the But we’re talking about two different things: For the feature Ruslan’s introduced (of being able to pull up a grid panel’s filter “state” based on the URL’s query params), you need to do it in a way such as I've done for any page where the tab is not the primary one. BTW, I'm assuming you saw the addition I made to the plugin panel class within the setup method (I wasn't sure of how to properly attack adding proposed changes to someone else’s PR ... guess I did it correctly?). |
After some initial tinkering with this, it's not as simple to implement as I had thought. One immediately noticeable issue within the elements panels having a code block (chunk, snippet, plugin, template) that is transformed by a code-editing plugin (Ace, CodeMirror, etc.) is that those plugins make certain un-ideal assumptions in their setup — leading to errors when loading the panel on a tab other than the one with that code block (which is always the first one). So, all extras that transform the code field would need to be tested and updated to accommodate this feature; they'd be very small changes, but this feature would be dependent upon those changes being made. The other factor that comes into play is how the implementation should be designed; should each individual item be stateful or should the state be based on simply the panel’s class (e.g., if you were editing a template and the properties tab was open before navigating to another template, any subsequent templates would open to the properties tab until leaving a template page in a different state). How fine-grained should the statefulness be? Should the grids within maintain state. Anyway, maybe some thought and consensus on exactly what the requirements of this feature should be would be prudent before diving into the coding of it. There's one item (that I believe another user mentioned) that I would really like to be stateful on a very specific level: The per page limit on grids. |
I think that each individual page (for example, a template page) has nothing to do with the tabs state of other pages, if I understand what it is about. |
Yes, as I've observed, only the TV panel maintains the page state of individual TVs. And that's the behavior I was asking about with my templates example. Would we want the state of every individual page (elements and resources) to be remembered, replicating the current behavior of the TV panel? Could it be problematic to do that for resources on sites with a large number of pages? We may also want/need to look into persisting page state via LocalStorage instead of cookies (Ext 3 only has a cookie provider, not surprising as Ext 3 is over a decade old), especially if we're looking to be able to maintain the state of several items. |
Keeping tabs in this way is unnecessary, it is now confusing, as it seems to me (I would remove this behavior, leaving only for the tree) or maybe it is worth adding system settings, I'm not sure. |
@JoshuaLuckers @Jako As soon as you have time, please test PR, because even in the current version it is better than what we have now. |
@Ruslan-Aleev sorry for the long wait, can you resolve the conflicts? |
@JoshuaLuckers Conflicts resolved, please check :) |
There were conflicts in the files, I corrected them. |
What does it do?
Why is it needed?
Allow to copy/paste the state of the filter with the browser url.
Related issue(s)/PR(s)
#15186
#15185
#15184
#15183
#15182
#15181
#15115
#14086