phac-nml / irida

Canada’s Integrated Rapid Infectious Disease Analysis Platform for Genomic Epidemiology
https://irida.ca
Apache License 2.0
40 stars 31 forks source link

Updated service layer for adding user group to project to validate if… #1483

Closed deepsidhu85 closed 1 year ago

deepsidhu85 commented 1 year ago

Description of changes

What did you change in this pull request? Provide a description of files changed, user interactions changed, etc. Include how to test your changes.

To test values not being cleared and duplicate entries: 1) Switch to development branch if not already on it 2) Create a project and a couple of a user group 3) Add the user group to the project with Project Role: Manager 4) Click the Add User Group button and add the same user group again but don't change any of the roles, and add the user group 5) The group should have been added but it will have the previously selected roles Manager and Level 4 for the project and metadata roles respectively 6) Click the Add User Group button once again but this time don't select a user group, just click the Add Group to Project button. 7) It should add the user group from step 3 to the project again 8) Check the database and you should see duplicate entries between the project and user group in the user_group_project table

To test values being cleared and no more duplicate entries: 1) Switch to this branch 2) Create a project and a couple of user groups 3) Add the user group to the project with Project Role: Manager 4) Click the Add User Group button and when selecting the the user group you should not see it in the list, and the project role and metadata role should have reset to the initial values (Collaborator, Level 1) respectively 5) Clicking the Add Group to Project button should also not allow the previous user group to be added 6) You can also manually try to add duplicate combos of user group and project to the user_group_project table and see that it will not allow you to add duplicates

To test the bug of html files causing analyses from reaching the completed stage 1) Switch to development branch 2) Run an analyses (species abundance pipeline). This pipeline needs to be installed to your irida instance for you to run it 3) It should fail to complete

To test the fix html files causing analyses from reaching the completed stage 1) Switch to this branch 2) Run an analyses (species abundance pipeline) 3) It should complete successfully

Related issue

Link to the GitHub issue this pull request addresses using the #issuenum format. If it completes an issue, use Fixes #issuenum to automatically close the issue.

Checklist

Things for the developer to confirm they've done before the PR should be accepted: