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

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

Merged
merged 10 commits into from
Apr 14, 2023

Conversation

deepsidhu85
Copy link
Contributor

@deepsidhu85 deepsidhu85 commented Apr 12, 2023

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 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:

  • CHANGELOG.md (and UPGRADING.md if necessary) updated with information for new change.
  • Tests added (or description of how to test) for any new features.
    * [ ] User documentation updated for UI or technical changes.

… the user group is already linked to the project or not, if so then throw an exception. Fixed bug with html.zip files throwing a no file exists exception which was causing analyses with html output files from reaching the completed stage
…in the user_group_project table to prevent duplicate entries, and to delete duplicated entries in the table
… to project modal to initial values. Added a catch for error messages. Updated comparison
…ml/irida into fix-duplicate-user-group-projects
…l drive and those that don't. Added check to isZippedFile test to check if an exception is thrown for a file not found
@deepsidhu85 deepsidhu85 added UI User Interface Issue back-end Issues relating to the service layer, repository, model, configuration, or database labels Apr 14, 2023
Copy link
Member

@ericenns ericenns left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@ericenns ericenns merged commit 966e29c into fix-remove-template-field Apr 14, 2023
@ericenns ericenns deleted the fix-duplicate-user-group-projects branch April 14, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Issues relating to the service layer, repository, model, configuration, or database bug UI User Interface Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants