Skip to content
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

ENH Keep State and show Search field if any keywords are presented. #1322

Conversation

sabina-talipova
Copy link
Contributor

@sabina-talipova sabina-talipova commented Jul 7, 2022

Description

  • Add a check for the presence of a filter in the state that is stored in the URL. If exist, keep Search field open.
  • Keep state in URL when new filter was applied or GridField was sorted

Parent issue

@sabina-talipova sabina-talipova force-pushed the pulls/1.11/gridfield-keep-state branch from c4e9ff1 to b701ac0 Compare July 18, 2022 04:43
@sabina-talipova sabina-talipova changed the title ENH Show Search field if any keywords are presented ENH Keep State and show Search field if any keywords are presented. Jul 18, 2022
@sabina-talipova sabina-talipova force-pushed the pulls/1.11/gridfield-keep-state branch from b701ac0 to b1d75c2 Compare July 19, 2022 02:03
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't done a full review, this is just to check the approach. Looks good overall, just one small change.

Comment on lines +205 to +206
const historyState = $.extend({}, {path: window.location.pathname + searchParam}, this.getState());
history.replaceState(historyState, '', window.location.pathname + searchParam);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure we're not just throwing away other GET vars that were already present

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I'll check parameters that we pass in GridField.php class. Since, here I just grab all search params from scheme, that we also pass to Edit button and as URL for click. So, would be better to be sure that we have a correct value in the scheme.
What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the URL for the gridfield we're currently looking at - which needs to include any GET parameters that are already in the URL.
So for example if I'm on some page /admin/pages/edit/show/2?some-var=some-value and I click paginate on a gridfield, the some-var=some-value shouldn't be removed. These may be here for any reason beyond gridfield, and removing them may cause problems in some project-specific code that relies on them for whatever reason.

The edit and view buttons don't need these, because they're relevant only while you're on the page that holds the gridfield, not for the item edit form.

@sabina-talipova sabina-talipova force-pushed the pulls/1.11/gridfield-keep-state branch from b1d75c2 to c768e97 Compare July 19, 2022 23:27
GuySartorelli and others added 23 commits July 20, 2022 11:31
Move group tests into a new feature
Refactor tests into distinct scenarios
This change adds support for a new global .lazy-loadable selector. Nodes with this class will receive a "lazyload" event to allow them to display content upon tab activation.
This also fix lazy-loading not being applied properly inside cms-tabset (they don't have the ss-tabset class).
selector should include cms-tabset, since they don't have the ss-tabset class by default
Co-authored-by: Michal Kleiner <mk@011.nz>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
lekoala and others added 12 commits July 20, 2022 11:31
+ Added the parameter fields created by CMSMain's BatchActionParameters() method to the BatchActionsForm
+ Added javascript for displaying/hiding parameter fields when the batch action dropdown is changed
+ Added CSS styles to make the parameter fields render properly under the batch action dropdown
+ Added code to loop over parameter input fields and reset their values to the default before displaying them
+ Replaced the ID `#BatchActionParameters` selector with a `.action-parameters` class selector
+ Nested `.action-parameters` rules under `.cms-batch-actions`
+ Removed the changes to the BatchActionsForm in favor of using `updateBatchActionsForm()` in an extension
@sabina-talipova sabina-talipova force-pushed the pulls/1.11/gridfield-keep-state branch from c768e97 to f135f89 Compare July 19, 2022 23:38
@sabina-talipova
Copy link
Contributor Author

sabina-talipova commented Jul 19, 2022

Closed in favor of #1326

@sabina-talipova sabina-talipova deleted the pulls/1.11/gridfield-keep-state branch July 19, 2022 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants