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

adding unlink to ui and matching link permissions #10689

Merged

Conversation

stevenwinship
Copy link
Contributor

@stevenwinship stevenwinship commented Jul 16, 2024

What this PR does / why we need it: Provide dataset unlink functionality to same level of permission/role as dataset link ["Publish Dataset"/Curator]

Which issue(s) this PR closes: #10583

Closes #10583

Special notes for your reviewer:

Suggestions on how to test this: See description in Issue #10583

Does this PR introduce a user interface change? If mockups are available, please link/include them here: Yes
image
image

Is there a release notes update needed for this change?: Yes (to be included)

Additional documentation:

@stevenwinship stevenwinship self-assigned this Jul 16, 2024
@stevenwinship stevenwinship added FY25 Sprint 1 FY25 Sprint 1 issues Type: Feature a feature request Size: 10 A percentage of a sprint. 7 hours. labels Jul 16, 2024
@coveralls
Copy link

coveralls commented Jul 16, 2024

Coverage Status

coverage: 20.77% (+0.03%) from 20.741%
when pulling ad8cd72 on 10583-dataset-unlink-functionality-same-permission-as-link
into 0d27957 on develop.

This comment has been minimized.

@DS-INRAE
Copy link
Member

Hi and thanks for implementing this feature 🥳
Could it be possible to have a dropdown list of the "allowed" Dataverse. It would be very helpful for users that don't manage a lot dataverse collections.
Example of suggested selector from the metadata editing form:
image

@stevenwinship
Copy link
Contributor Author

stevenwinship commented Jul 16, 2024

Could it be possible to have a dropdown list of the "allowed" Dataverse.

The dialog is designed to match the Link Dataset dialog. It does show a dropdown of Dataverses that the user has access to but requires the user to enter a character or two to start the filtering.
Additionally the UnLink dropdown will only show the Dataverses that this dataset was linked to.

image
image

This comment has been minimized.

@DS-INRAE
Copy link
Member

Understood, thanks 🙂
It would be helpful to change both in the longer run to reduce typing from the user

@stevenwinship stevenwinship removed their assignment Jul 17, 2024
@cmbz cmbz added the FY25 Sprint 2 FY25 Sprint 2 issues label Jul 18, 2024
@pdurbin pdurbin self-assigned this Aug 1, 2024
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

The screenshots are great. Overall, looks good. I left a few comments and I'm especially wondering about the new "preAuthorized" boolean. 🤔

logger.severe(msg);
msg = BundleUtil.getStringFromBundle("dataset.notlinked.msg") + ex;
/**
* @todo how do we get this message to show up in the GUI?
Copy link
Member

Choose a reason for hiding this comment

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

If we weren't moving to the SPA, I'd ask for any thoughts on this todo. 😄

src/main/java/propertyFiles/Bundle.properties Outdated Show resolved Hide resolved
src/main/java/propertyFiles/Bundle.properties Outdated Show resolved Hide resolved
@@ -2538,6 +2545,7 @@ dataset.registered.msg=Your dataset is now registered.
dataset.notlinked=DatasetNotLinked
dataset.notlinked.msg=There was a problem linking this dataset to yours:
dataset.linking.popop.already.linked.note=Note: This dataset is already linked to the following dataverse(s):
dataset.linking.popup.not.linked.note=Note: This dataset is not linked to the following dataverse(s):
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'm wondering when this message appears.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It appears on the Unlink dialog. I see the message is a bad copy paste so I fixed it. I'm wondering if it would be better to hide the unlink button if the dataset isn't linked

image

src/main/webapp/dataset.xhtml Outdated Show resolved Hide resolved

This comment has been minimized.

5 similar comments

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

stevenwinship and others added 9 commits August 2, 2024 08:26
…ission-as-link.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
…ission-as-link.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

This comment has been minimized.

4 similar comments

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@pdurbin pdurbin assigned scolapasta and unassigned pdurbin Aug 5, 2024
@scolapasta scolapasta removed their assignment Aug 7, 2024

This comment has been minimized.

@stevenwinship stevenwinship removed their assignment Aug 12, 2024
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

I'm so glad we're using the permission system now! I left a few suggestions for docs.

…ission-as-link.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

This comment has been minimized.

stevenwinship and others added 2 commits August 13, 2024 13:20
…ission-as-link.md

Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>

This comment has been minimized.

1 similar comment

This comment has been minimized.

@pdurbin pdurbin self-assigned this Aug 23, 2024
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Overall, this is a nice improvement. There's a new "Unlink button" (previously only possible via API) and unlink via API no longer requires superuser.

I only tested this lightly but API tests are passing and I'm happy with the code. I'm going to approve this, moving it into Ready for QA.

However, I'd like to point out a few UX things we might want to improve in the future, perhaps when we add this feature to the SPA. @jggautier as our UX guru might want to weigh in as well.

Ever-present button

First, the "Unlink Dataset" button is ever-present, taking up a little real estate on the screen, even for datasets that are not linked to anything. It looks like this (or see the screenshots in the PR):

Screenshot 2024-08-23 at 11 34 08 AM

If you click the "Unlink Dataset" button on a dataset that doesn't have any links, you get a popup telling you you can't unlink anything. It looks like this:

Screenshot 2024-08-23 at 11 34 28 AM

Perhaps instead of this UX we should grey out the "Unlink Dataset" button or even hide it (I forget what our guidelines are and couldn't find anything helpful in the Style Guide). Or maybe both "Link Dataset" and "Unlink Dataset" should move under the "Edit Dataset" dropdown? I'm not sure how often we expect these buttons to be clicked.

Don't make me think - suggesting collections to unlink from

Something else I noticed is that when a dataset IS linked, the popup doesn't let you choose from collections to unlink from. Instead you have to type the name of the collection. It looks like this:

Screenshot 2024-08-23 at 11 35 25 AM

Summary

Again, nice feature. I'll take my UX hat off now and move this along! Approved!

@pdurbin pdurbin removed their assignment Aug 23, 2024
@sekmiller sekmiller self-assigned this Aug 26, 2024
@sekmiller
Copy link
Contributor

@stevenwinship I think if we just add and (!empty DatasetPage.dataset.datasetLinkingDataverses) to the render logic around line 526 on dataset.xhtml we can hide the unlink button and avoid some of the ui confusion

@stevenwinship
Copy link
Contributor Author

added the empty check to hide the unlink button.

Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:10583-dataset-unlink-functionality-same-permission-as-link
ghcr.io/gdcc/configbaker:10583-dataset-unlink-functionality-same-permission-as-link

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@sekmiller sekmiller merged commit 34bfb1b into develop Aug 27, 2024
13 checks passed
@pdurbin pdurbin added this to the 6.4 milestone Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 1 FY25 Sprint 1 issues FY25 Sprint 2 FY25 Sprint 2 issues Size: 10 A percentage of a sprint. 7 hours. Type: Feature a feature request
Projects
Status: Done 🧹
Status: Done
7 participants