-
Notifications
You must be signed in to change notification settings - Fork 494
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
adding unlink to ui and matching link permissions #10689
Conversation
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
Understood, thanks 🙂 |
There was a problem hiding this 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. 🤔
doc/release-notes/10583-dataset-unlink-functionality-same-permission-as-link.md
Outdated
Show resolved
Hide resolved
doc/release-notes/10583-dataset-unlink-functionality-same-permission-as-link.md
Outdated
Show resolved
Hide resolved
logger.severe(msg); | ||
msg = BundleUtil.getStringFromBundle("dataset.notlinked.msg") + ex; | ||
/** | ||
* @todo how do we get this message to show up in the GUI? |
There was a problem hiding this comment.
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/edu/harvard/iq/dataverse/DataverseServiceBean.java
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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.../java/edu/harvard/iq/dataverse/engine/command/impl/DeleteDatasetLinkingDataverseCommand.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
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.
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.
…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.
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.
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.
…lishDataset permissions
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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.
doc/release-notes/10583-dataset-unlink-functionality-same-permission-as-link.md
Outdated
Show resolved
Hide resolved
doc/release-notes/10583-dataset-unlink-functionality-same-permission-as-link.md
Outdated
Show resolved
Hide resolved
…ission-as-link.md Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
This comment has been minimized.
This comment has been minimized.
…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.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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):
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:
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:
Summary
Again, nice feature. I'll take my UX hat off now and move this along! Approved!
@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 |
added the empty check to hide the unlink button. |
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
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
Is there a release notes update needed for this change?: Yes (to be included)
Additional documentation: