-
Notifications
You must be signed in to change notification settings - Fork 4
fix: changing how the feedback message is displayed for adding team members #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
Conversation
|
Thanks for the pull request, @jacobo-dominguez-wgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42 +/- ##
==========================================
+ Coverage 94.46% 95.05% +0.58%
==========================================
Files 45 45
Lines 904 930 +26
Branches 177 178 +1
==========================================
+ Hits 854 884 +30
+ Misses 48 44 -4
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
226d9c8 to
381c6be
Compare
|
Backport PR: #44 |
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.
Thanks for these improvements @jacobo-dominguez-wgu.
I just have a comment:
Regarding the USER_ALREADY_HAS_ROLE, although the user is not added to the team, the user's experience is that they achieve the goal (the users are in the group). So I think we should consider the case of already having a role as a success, like an informative success.
That implies we shouldn't keep those user/email in red, and if I only have users with the role, we should close the modal. (this is related to the first case in this comment #14 (comment))
What do you think, @jacobo-dominguez-wgu?
The rest looks good to me. I tested, and it works as expected! ✨
Hi @MaferMazu I have updated the code to consider the USER_ALREADY_HAS_ROLE cases as a successful message. |
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.
Thanks for addressing the comments @jacobo-dominguez-wgu!
The changes worked as expected! ✨
Minor comment (no blocker):
We should use a similar format for the message when users already have roles, and when the operation is successful (the count and the plural), because the current 'already have role' message is unclear when we have more than one user. (Unclear message: The user already has the role (freshuser, library_user_test).)
|
@arbrandes @dcoa @brian-smith-tcril, could you help with a review? I would like a more experienced look at frontend matters. |
rodmgwgu
left a comment
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.
Tested and working as expected, code looks good. Thanks!
src/authz-module/libraries-manager/components/AddNewTeamMemberModal/messages.ts
Outdated
Show resolved
Hide resolved
dcoa
left a comment
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 haven't tested in my local but the code seems good to me, thank you!!
8fb2130 to
d3c1d69
Compare
d3c1d69 to
591d4cb
Compare
|
@arbrandes @brian-smith-tcril, could you help us with a review/merge powers with this PR? |
Description
This PR is intended to improve the feedback process and have a better feedback system for user's input in the add team member modal.
Closes #14.
What it changes:
Improved Toast Feedback System
Before: Single generic toast message for all scenarios
After: Separate toast messages for each status type:
✅ Successfully added users
❌ User already has the assigned role
❌ User not found
❌ Generic errors
This provides clearer, more actionable feedback to users.
Enhanced Message Clarity
Added user identification: Toast messages now include the specific userId that triggered each status
Example:
The user already has the role ([email protected])Benefit: Users can easily identify which specific user caused each message when multiple toasts are displayed
Visual Error Indicators
Extended red text functionality: Previously only "user not found" errors showed red text in the input textarea
Now applies to all error types: Any user causing an error will appear in red in the textarea
Improved UX: Users can quickly identify problematic entries and fix them
Better Error Handling Flow
Modal behavior: The "Add Team Member" modal no longer auto-closes when errors occur
Why: Allows users to immediately correct typos or invalid entries without reopening the modal
Result: Smoother error recovery workflow
Dynamic Toast Duration
Adaptive timing: Toast display duration now scales with the number of messages
Formula: 5 seconds × number of toast messages displayed
Rationale: Gives users adequate time to read multiple concurrent messages (up to 4 different toast types)
Demo video
Grabacion.de.pantalla.2025-11-20.a.la.s.4.08.25.p.m.mov
How to test it
npm install && npm run devWe can test all the error cases described here, but also the next case scenarios covers most of the error and success cases:
Test scenario 1 (success)
Add a role to an existing user which role is not already set.
Expected: It should show the success toast message for 5 seconds and the modal automatically closes.
Test scenario 2 (already set error)
Add a role to an existing user which role is already set.
Expected: It should show the already set toast message for 5 seconds
and the modal does not close.Test scenario 3 (two usernames, one successful and one error)
Type the username of an existing user and one nonexisting and asign a role not already set.
Expected: It should show the success toast message and the non existing user message for 10 seconds. The modal does not closes and the username of the nonexisting and input text area should be in error state.
Test scenario 4 (three usernames, one successful and two errors)
Type the username of an existing user, one nonexisting user and one existing user with a role asigned (user3), asign the role of the user 3.
Expected: It should show the success toast message, the non existing user message and the already set role error message for 15 seconds. The modal does not closes and the usernames of the nonexisting user and the already set user should be in error state.