-
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-2967 Don't display affiliations of users with types patron
or dcb
#2570
Conversation
@usavkov-epam Please also update |
CHANGELOG.md
Outdated
* Don't display affiliations of users with types `patron` or `dbc`. Refs UIU-2967. | ||
|
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.
This one seems to be a target for Poppy bugfix. Please update the version in progress accordingly
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.
Generally, our practice is to target all changes to the master branch and then to cherry-pick fixed onto patch branches. If somebody else's PR hits master before yours lands, you'll have to do this anyway, so I just plan for things to work out this way. I would do it like this:
- Bump the version on master in
package.json
to 10.1.0. You'll save a PR later if you do it in a separate PR now, but it's up to you. - Merge this PR.
- Split a release branch named
b10.0
from the commit where master was tagged and push it up so others can also pick bug fixes onto : (get checkout master; git checkout -b b10.0 v10.0.0; git push -u origin head
). - If you bumped the version in step 1 in a separate PR, you can just pick the commit from this PR onto your release branch:
git cherry-pick -x SOME_HASH; git push
, you're done! If you bumped the version in step 1 in this PR, you'll need to split a branch fromb10.0
, pick this fix onto it, fix the version inpackage.json
, push the branch and open a PR with a target ofb10.0
.
@usavkov-epam Thank you for including DCB type along with patron. |
patron
or dbc
patron
or dcb
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.
LGTM. Test coverage is reported at 100% which is a little hard to believe given there are no changes to tests here and the DCB constant is new :/ It would be nice to test the utility functions directly, even if isAffiliationsEnabled
is covered in the course of testing other functionality.
export const isPatronUser = (user) => user?.type === USER_TYPES.PATRON; | ||
export const isDcbUser = (user) => user?.type === USER_TYPES.DCB; | ||
|
||
export const isAffiliationsEnabled = (user) => { | ||
return !isPatronUser(user) && !isDcbUser(user); | ||
}; |
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.
Please add tests. I know these functions are dead-simple. At least the tests will be dead-simple too.
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.
Sure, I've added.
Kudos, SonarCloud Quality Gate passed! |
…dcb` (#2570) * UIU-2967 Don't display affiliations of users with types 'patron' or 'dbc' * PT comment * add tests * import order * fix type naming
…dcb` (#2570) * UIU-2967 Don't display affiliations of users with types 'patron' or 'dbc' * PT comment * add tests * import order * fix type naming
…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
https://issues.folio.org/browse/UIU-2967
When changing a user type from
staff
topatron
- affiliations are deleted on BE side and it results in an error when querying users' tenants. So for for users with typespatron
ordbc
(a new user type, that isn't meant to work with affiliations) "Affiliations" selector should be hidden in the permissions accordion and the related query to fetch user affiliations should be disabled.Approach
Prevent fetching affiliations if a user type is a
patron
ordcb
. Hide the "Affiliations" selection for those types in the user edit form.Screenshots
chrome_zurqK9Yhn2.mp4
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.