What did you change in this pull request? Provide a description of files changed, user interactions changed, etc. Include how to test your changes.
Updated service layer for adding user group to project to validate if the user group is already linked to the project or not, if so then throw an exception, and added unique constraint to the user_group_project table to prevent duplicate entries from being added for the combination of user_group_id and project_id.
Fixed Project -> Add user group to project modal to actually reset the modal values once the modal has closed after successfully adding a group to the project. Before the fix if the user didn't leave the user group page and tried to add a group again, it would allow them to select the same group from the listing even though it had already been linked.
Fixed bug with html files throwing a no file exists exception which was causing analyses with html output files from reaching the completed stage when the file hadn't yet persisted to disk
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:
[x] CHANGELOG.md (and UPGRADING.md if necessary) updated with information for new change.
[x] Tests added (or description of how to test) for any new features.
~* [ ] User documentation updated for UI or technical changes.~
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.
Updated service layer for adding user group to project to validate if the user group is already linked to the project or not, if so then throw an exception, and added unique constraint to the user_group_project table to prevent duplicate entries from being added for the combination of user_group_id and project_id.
Fixed Project -> Add user group to project modal to actually reset the modal values once the modal has closed after successfully adding a group to the project. Before the fix if the user didn't leave the user group page and tried to add a group again, it would allow them to select the same group from the listing even though it had already been linked.
Fixed bug with html files throwing a no file exists exception which was causing analyses with html output files from reaching the completed stage when the file hadn't yet persisted to disk
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 rolesManager
andLevel 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 tableTo 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 duplicatesTo 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, useFixes #issuenum
to automatically close the issue.Checklist
Things for the developer to confirm they've done before the PR should be accepted: