-
Notifications
You must be signed in to change notification settings - Fork 42
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
UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter #2584
Conversation
….js to escape special characters in tags filter
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.
I don't love this:
if (f.startsWith('tags.')) {
It works as long as nobody adds other fields with that prefix. Maybe/probably that's unlikely to happen, but it's pretty hacky. Could you at least add a function header comment for escapeSpecialCharactersInTagFilters
that explains what's going on, and why?
Kudos, SonarCloud Quality Gate passed! |
Updated! |
….js to escape special characters in tags filter (#2584) * UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter * UIU-2995 - Upade changelog description * UIU-2955 - add a header comment to escapeSpecialCharactersInTagFilters function
* UIU-2977 x-okapi-token header must always be optional (#2578) The `X-Okapi-Token` header is optional and should only be included when a token value is present on the `stripes.okapi` object. Refs UIU-2977 * UIU-2959 Accordion collapse/expand all shortcuts not working on Edit form. (#2566) * use handlers frome stripes-components * update yarn.lock * log changes * update yarn lock * UIU-2973 - Update patron groups retrieval in user search to hold maxUnpagedResourceCount (#2583) * UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter (#2584) * UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter * UIU-2995 - Upade changelog description * UIU-2955 - add a header comment to escapeSpecialCharactersInTagFilters function * Add the possibility to do "Claim returned" from action menu (#2585) * Release v10.0.4 --------- Co-authored-by: Zak Burke <[email protected]> Co-authored-by: John Coburn <[email protected]> Co-authored-by: Artem Blazhko <[email protected]>
…irtual item. (#2601) * UIU-2967 Don't display affiliations of users with types `patron` or `dcb` (#2570) * UIU-2967 Don't display affiliations of users with types 'patron' or 'dbc' * PT comment * add tests * import order * fix type naming * UIU-2970 Make the `username` field required for users with the `staff` type in "ECS" mode (#2571) * UIU-2970 Make the 'username' field required for users with the 'staff' type in ECS mode * add unit tests * Release v10.0.1 (#2574) * Release v10.0.2 (#2577) * Release v10.0.3 * Release v10.0.4 (#2586) * UIU-2977 x-okapi-token header must always be optional (#2578) The `X-Okapi-Token` header is optional and should only be included when a token value is present on the `stripes.okapi` object. Refs UIU-2977 * UIU-2959 Accordion collapse/expand all shortcuts not working on Edit form. (#2566) * use handlers frome stripes-components * update yarn.lock * log changes * update yarn lock * UIU-2973 - Update patron groups retrieval in user search to hold maxUnpagedResourceCount (#2583) * UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter (#2584) * UIU-2995 - Update resourceData and queryParams in UserSearchContainer.js to escape special characters in tags filter * UIU-2995 - Upade changelog description * UIU-2955 - add a header comment to escapeSpecialCharactersInTagFilters function * Add the possibility to do "Claim returned" from action menu (#2585) * Release v10.0.4 --------- Co-authored-by: Zak Burke <[email protected]> Co-authored-by: John Coburn <[email protected]> Co-authored-by: Artem Blazhko <[email protected]> * UIU-2964 - [DCB] Loan details: Disable loan actions (Lending library) (#2590) * UIU-3000 Can not edit shadow user account (#2589) * Release v10.0.5 (#2593) * UIU-2987-poppy-dcb - Hide all actionalble buttons on user details pane (#2594) * UIU-2987-poppy-dcb - Hide all actionalble buttons on user details pane * UIU-2987-poppy-dcb - fix unit test failure * UIU-2987-poppy-dcb - fix lint error * UIU-2988-poppy-dcb - User - Open Loans: UI changes for supporting DCB circulation (#2598) * UIU-2966-poppy-dcb - display item title and barcode as text for dcb virtual item. --------- Co-authored-by: Yury Saukou <[email protected]> Co-authored-by: Zak Burke <[email protected]> Co-authored-by: John Coburn <[email protected]> Co-authored-by: Artem Blazhko <[email protected]> Co-authored-by: Mikita Siadykh <[email protected]>
Purpose
UIU-2995 - Mask/escape backslash and double quote in tag search
Approach
Special characters like ",*,?,\ are allowed in creation of tags.
When such a tag is searched in users app via the "Tags" filter, an error like "QueryValidationException: ? wildcard not allowed in full text query string" and "QueryValidationException: * right truncation wildcard must be followed by space or end of string, but found .." are observed.
Hence, the tags filters are escaped before passing them to makeQueryFunction.
TODOS and Open Questions
Learning
Screencast
Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
If there are breaking changes, please STOP and consider the following:
Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.
While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.