Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kathy-t
Copy link
Contributor

@kathy-t kathy-t commented Apr 25, 2025

Description
This PR adds buttons to the Manage DOIs dialog so that a user can create an edit access link to edit the metadata of an automatically generated Dockstore DOI on Zenodo. This single link can be used to edit all versions of the DOI. In order for the changes to be saved on Zenodo, the user must be logged into their Zenodo account, otherwise the attempt to publish the changes will fail with a 403.

Once the user is done editing the DOI, they can delete the access link from the Manage DOIs dialog.

Take note of the sentence after the Dockstore DOIs. There is a "Show more" button that hides the details of the edit link so that the dialog is not too cluttered.

I'm not completely satisfied with the wording, so please feel free to leave suggestions.

image

image

image

Review Instructions

  • Navigate to a workflow that you have with an automatically generated DOI
  • Click the Manage DOIs button
  • In the Dockstore card, click the "Show more" button
  • Click the Create Edit Link button. A link should be generated and displayed in the card
  • Click on the edit link. You should be directed to the DOI on Zenodo. Make sure you're logged into Zenodo.
  • Click the Edit button on the right hand side then edit the metadata of the DOI (ex: modify the description). Then click the Publish button.
  • The changes should be saved. Refresh the page and verify that your modification shows up.
  • Go back to your Dockstore page. In the Manage DOIs dialog, delete the edit link. You should not be able to edit the DOI anymore on Zenodo.

Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-6462

Security
If there are any concerns that require extra attention from the security team, highlight them here.

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that your code compiles by running npm run build
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • If this is the first time you're submitting a PR or even if you just need a refresher, consider reviewing our style guide
  • Do not bypass Angular sanitization (bypassSecurityTrustHtml, etc.), or justify why you need to do so
  • If displaying markdown, use the markdown-wrapper component, which does extra sanitization
  • Do not use cookies, although this may change in the future
  • Run npm audit and ensure you are not introducing new vulnerabilities
  • Do due diligence on new 3rd party libraries, checking for CVEs
  • Don't allow user-uploaded images to be served from the Dockstore domain
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.
  • Check whether this PR disables tests. If it legitimately needs to disable a test, create a new ticket to re-enable it in a specific milestone.

@kathy-t kathy-t self-assigned this Apr 25, 2025
@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 31.03448% with 20 lines in your changes missing coverage. Please review.

Project coverage is 41.77%. Comparing base (51de5ea) to head (85da7d9).
Report is 1 commits behind head on release/1.17.0.

Files with missing lines Patch % Lines
...ntry/doi/manage-dois/manage-dois-dialog.service.ts 15.38% 8 Missing and 3 partials ⚠️
src/app/shared/entry/zenodo-access-link.pipe.ts 54.54% 0 Missing and 5 partials ⚠️
...ry/doi/manage-dois/manage-dois-dialog.component.ts 20.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.17.0    #2090      +/-   ##
==================================================
- Coverage           41.82%   41.77%   -0.05%     
==================================================
  Files                 391      392       +1     
  Lines               12348    12377      +29     
  Branches             2952     2957       +5     
==================================================
+ Hits                 5164     5171       +7     
- Misses               4876     4893      +17     
- Partials             2308     2313       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kathy-t kathy-t requested review from denis-yuen and svonworl April 25, 2025 15:13
Copy link
Member

@denis-yuen denis-yuen left a comment

Choose a reason for hiding this comment

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

For discussion

</div>
<div *ngIf="showMoreEditLinkInfo">
<p class="size-small gray-caption">
Dockstore uses Zenodo's link sharing feature to create a secret link with edit access so you can edit the DOI. You must be
Copy link
Member

Choose a reason for hiding this comment

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

Ditto here


deleteDoiAccessLink() {
this.manageDoisDialogService.deleteDoiAccessLink(this.entry);
this.dockstoreDoiAccessLink = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Borderline nitpicky, but we might not unset dockstoreDoiAccessLink until the observable has successfully completed. That way, the user can try again in the case of failure (due to network problems or whatever). With this change, the implementation/flow of deleteDoiAccessLink looks more similar to requestDoiAccessLink.

@kathy-t kathy-t force-pushed the feature/seab-6462/link-sharing branch from 43089da to 6a75261 Compare May 6, 2025 14:30
@kathy-t kathy-t changed the base branch from develop to release/1.17.0 May 6, 2025 14:30
@kathy-t kathy-t requested review from denis-yuen and svonworl May 6, 2025 15:44

requestDoiAccessLink() {
this.manageDoisDialogService.requestDoiAccessLink(this.entry).subscribe((accessLink) => {
this.dockstoreDoiAccessLink = accessLink;
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, do workflowsService.getDOIEditLink (called in ngOnInit) and manageDoisDialogService.requestDoiAccessLink do the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite: workflowsService.getDOIEditLink gets the edit link if it exists, otherwise returns a 404. It does not create edit links. manageDoisDialogService.requestDoiAccessLink creates an edit link if it does not exist and throws an error if it does.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
55.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@kathy-t
Copy link
Contributor Author

kathy-t commented May 6, 2025

FYI, I changed the browser used for the integration tests to Chrome. After integration_test_2 failed 5 times, I made the switch and it passed on the first try. Maybe a coincidence but we can monitor to see if the flakiness continues with Chrome.

@kathy-t kathy-t merged commit 405fa86 into release/1.17.0 May 6, 2025
16 of 20 checks passed
@kathy-t kathy-t deleted the feature/seab-6462/link-sharing branch May 6, 2025 21:01
@kathy-t
Copy link
Contributor Author

kathy-t commented May 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants