Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #1162
Fix #939
(temporary/non-ideal fix)This PR addresses additional issues with assigning permissions from the UI and adds some UX enhancements like banners and tooltips.
List of Changes
Don't Override PI Owner Role
If the same ORCID iD was used for the PI ORCID and as a contributor ORCID iD, then the permission level set at the contributor level had priority over the ideal PI level (
owner
). Now, priority is given to theowner
role when building the request body to update the submission with new permissions.Validate address without rendering form
This is a "fix" for #939. The address form now validates by investigating data in addition to through Vuetify's form validation. Vuetify's form validation was insufficient because the address form cannot be validated by it until it is opened. The previous workaround for this was to open the form, which would be validated upon render by Vuetify, and then close the form. Metadata Contributors are unable to do this, and would be stuck at that screen. The only workaround for those users would be to replace/context
with/samples
in the URL.The reason this fix is not ideal is because it duplicates validation, so changes to validation rules for this form need to be applied in two different places.The address form dialog now uses the eager prop, which forces it to render and thus validate when it mounts. (thanks @marySalvi)
Add Permission Level Descriptions
A tooltip has been added to the Study form describing each permission level.

Add Banner for read-only views
If a user is presented with a read-only view due to insufficient permissions to edit the current form, a banner now appears informing the user of this.

Prevent PI from changing their own ORCID
If the current user is the PI, don't allow them to edit the PI ORCID field on the study form and remove their permission.