Skip to content
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

SIMSBIOHUB-593: Add constraint for a user to have only one role per Project #1307

Merged
merged 9 commits into from
Jun 21, 2024

Conversation

mauberti-bc
Copy link
Collaborator

@mauberti-bc mauberti-bc commented Jun 18, 2024

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-593

Description of Changes

  • Added unique constraint on (system_user_id, project_id) in project_participation table, so project members can have only one role in a Project
  • Updated the project-participants service to only update records if the user's role has changed; do nothing if the role hasn't changed (deletes and inserts are the same)
  • UI styling changes to the Project participant control

@mauberti-bc mauberti-bc added the Ready For Review PR is ready for review label Jun 18, 2024
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 9 lines in your changes missing coverage. Please review.

Project coverage is 49.21%. Comparing base (a3cb8a7) to head (c566954).

Files Patch % Lines
api/src/services/project-participation-service.ts 84.00% 1 Missing and 3 partials ⚠️
app/src/components/user/UserRoleSelector.tsx 60.00% 0 Missing and 2 partials ⚠️
...c/features/projects/view/components/TeamMember.tsx 0.00% 2 Missing ⚠️
...c/features/projects/components/ProjectUserForm.tsx 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1307      +/-   ##
==========================================
+ Coverage   49.18%   49.21%   +0.02%     
==========================================
  Files         639      639              
  Lines       17687    17707      +20     
  Branches     2778     2787       +9     
==========================================
+ Hits         8699     8714      +15     
+ Misses       8410     8409       -1     
- Partials      578      584       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

NickPhura
NickPhura previously approved these changes Jun 21, 2024
Copy link
Collaborator

@NickPhura NickPhura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Copy link

@NickPhura NickPhura changed the title Add constraint for a user to have only one role per Project SIMSBIOHUB-593: Add constraint for a user to have only one role per Project Jun 21, 2024
@NickPhura NickPhura merged commit e4a401e into dev Jun 21, 2024
19 checks passed
@NickPhura NickPhura deleted the SIMSBIOHUB-593 branch June 21, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants