GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 8 forks source link

🐛 Edit User - Team based roles - Add Membership doesn't validate for existing roles #11746

Closed brindasasi closed 18 hours ago

brindasasi commented 1 week ago

🐛 Bug

Add Membership table doesn't prevent the user from adding the same team over and over. It doesn't validate the existing membership and gives successful message toast. But in the DB it didn't actually save twice which is good. It would be nice if it can be prevented in first place.

Image

🦋 Expected Behaviour

Add Membership dialog should not show the team that user already belongs to AND no other roles left in that team to assign to. If there are multiple roles , UI should only provide the remaining roles.

OR

keep the existing and throw an error message user role already exists in the table

🕵️ Details

📋 Steps to Reproduce

  1. Go to admin/users/
  2. Click Edit on any user
  3. click on Edit User Account
  4. Click on Add Membership on Team based roles section
  5. Observe all the teams including the user already belongs to shows up in the dialog
  6. Click on the team that user already belongs to , select role that user already has ( currently only pool operator)
  7. Observe query goes through and success toast message appear
  8. Observe there is no change on the table

📸 Screenshot

🙋‍♀️ Proposed Solution

✅ Acceptance Criteria

tristan-orourke commented 18 hours ago

If there's no bad data saved to database, and this is just for teams, I'm not concerned. Teams will be going away soon anyway.