-
Notifications
You must be signed in to change notification settings - Fork 40
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
Filter Reset for Modules and Permissions doesn't clear url search query #5955
Comments
I've added a PR based on this method: |
Thanks @yorkshire-pudding ...I initially left a few code suggestions (nit-picking inline comments + extra indentation that needed to be reduced), then another suggestion to reduce code by chaining Side-note: the code in this reset function is identical in both |
I'm not sure this is bug - I actually expect a page that contains a url query to behave this way. The field is re-populated with the filter when reloading. In fact, I would find it confusing if I reloaded the page that has a query in the url, for it not to use that query (is that what your PR does, @yorkshire-pudding ?) |
@argiepiano - the search box is populated from the url query when the page loads; if you type a search query and press enter (which I can imagine many users doing intuitively - I know I have), then the address bar search query is added. The two are closely linked in every other way but this, and this PR closes the gap. |
I did note that they were essentially the same, but I followed where @quicksketch had originally put the functions rather than rip it up and start again. I think there is an argument for keeping it with the filter functions for coherence but I don't mind. |
@yorkshire-pudding fair enough re keeping the code where it currently is - it would have to be a separate issue anyway. @argiepiano this is a bug, but perhaps the steps to reproduce aren't as clear. If you are in a page that contains the query, then yes, refreshing the page should retain the query, but if you have previously clicked the "reset" button (which clears the search input field), then the expectation is that the search query is also cleared. |
...this WFM and the code looks good, but since I was the one that suggested the main code change, I think that someone else should also review/test before marking this RTBC. |
I'm also not 100% sure about this, but I think the change in behavior is fairly harmless. Separately, I think there is an issue in the PR. This should use window.history() to remove the query string: https://github.com/backdrop/backdrop/pull/4323/files#r1097649944 |
I missed that the PR was updated. The new approach uses |
…ermissions pages. By @yorkshire-pudding, @klonos, @argiepiano, and @quicksketch.
…ermissions pages. By @yorkshire-pudding, @klonos, @argiepiano, and @quicksketch.
Description of the bug
This relates to the new functionality on the Permissions page (through #980) and the existing filter on the Modules page. In #5933, the instant reset was improved to clear the input without reloading the page. This works, however, if the search filter was added through a URL query (modules can pass url search to the pages or url query is added by pressing enter on field which some users may do), then this is not cleared when Reset is pressed.
Steps To Reproduce
To reproduce the behavior:
admin/config/people/permissions?search=dashboard
Actual behavior
Page reloads with the search filter reapplied
Expected behavior
Page reloads with the search filter remaining cleared.
Additional information
Add any other information that could help, such as:
PR
The text was updated successfully, but these errors were encountered: