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

Add auto DOI opt-out toggle for legacy and hosted workflows #2059

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

kathy-t
Copy link
Contributor

@kathy-t kathy-t commented Feb 7, 2025

Description
I recommend reviewing this with "Hide whitespace" checked.

This PR adds a Automatic DOI Generation toggle to the Manage DOIs dialog so that users can opt out of auto DOI generation for legacy and hosted workflows. GitHub App workflow, tools, notebooks, and services also have this section except the toggle is not displayed (the ON/OFF status is still displayed though). There is a sentence telling the users to edit the .dockstore.yml, which is similar to what we do for the GitHub App manual topic.

Based on UI best practices, the slide toggle takes effect immediately if pressed and does not require the user to click Save to apply the new state. The Manage DOI dialog has radio buttons for DOI selection, and it feels like a confusing experience to have the user click Save to save this selection while the toggle takes effect immediately. Thus, I changed it so that the radio button selection is saved immediately when pressed. The Save button is now just a Done button that closes the dialog.

Note this PR requires dockstore/dockstore#6074 which allows authenticated users to call the PUT autodoigeneration endpoint to toggle the auto DOI setting.

Before

image

After

Manage DOIs dialog for legacy and hosted workflows have a slide toggle:
Screenshot 2025-02-07 at 11-27-11 Dockstore My Workflows

Screenshot 2025-02-07 at 11-26-46 Dockstore My Workflows

Manage DOIs dialog for GitHub App entries do not have a toggle. It displays On/Off and tells the user to edit the .dockstore.yml:
image

Review Instructions
On staging, for a legacy or hosted workflow, opt out of DOI selection by clicking Manage DOIs and clicking the toggle. Refresh the page and verify that the setting is Off.

For a GItHub App entry, click the Manage DOIs button and verify that the Automatic DOI Generation section displays On or Off without a slide toggle. Verify that it tells the user to edit their .dockstore.yml.

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

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 Feb 7, 2025
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 41.81%. Comparing base (a29f9a1) to head (80e86d0).
Report is 1 commits behind head on hotfix/2.13.4.

Files with missing lines Patch % Lines
...ntry/doi/manage-dois/manage-dois-dialog.service.ts 16.66% 5 Missing ⚠️
...ry/doi/manage-dois/manage-dois-dialog.component.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           hotfix/2.13.4    #2059      +/-   ##
=================================================
- Coverage          41.84%   41.81%   -0.04%     
=================================================
  Files                394      394              
  Lines              12321    12330       +9     
  Branches            2959     2960       +1     
=================================================
  Hits                5156     5156              
- Misses              4845     4855      +10     
+ Partials            2320     2319       -1     

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

@@ -171,7 +171,7 @@ <h3>
class="private-btn small-btn-structure ml-2"
matTooltip="Manage DOIs"
(click)="manageDois()"
[disabled]="!canWrite"
[disabled]="!canWrite || (isRefreshing$ | async)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this button is not disabled when the page is loading after an action (ex: Publish) so I just added this. Same thing for the Manage labels button below

*ngIf="!isGitHubAppEntry"
[(ngModel)]="isAutoDoiEnabled"
(change)="toggleAutoDoiGeneration()"
labelPosition="before"
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend changing to "after" so it matches the positioning in the mockups (after the slider), just in case anyone was attached to that particular positioning.

this.workflowsService.autoGenerateDois(entry.id, { autoGenerateDois: isAutoDoiEnabled }).subscribe(
(response) => {
this.alertService.detailedSuccess();
this.workflowService.setWorkflow({ ...this.workflowQuery.getActive(), autoGenerateDois: response });
Copy link
Contributor

Choose a reason for hiding this comment

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

After successfully toggling the slider, the "success" snackbar pops up below, but if you try to click "Dismiss" within the snackbar, the Manage DOIs dialog is dismissed. Also, when the "success" snackbar pops up, it's little distracting, imho. Would it be ok to simply not display it (on "success")? (Given that the mechanics of the "which doi" radio box have changed, and same thing happens when a radio box is clicked, same question for it, also.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to simpleSuccess() so the snackbar doesn't pop up

>
</span>
<span *ngIf="isGitHubAppEntry">
Edit the enableAutoDoi field in the .dockstore.yml to change your Automatic DOI Generation preference.
Copy link
Contributor

Choose a reason for hiding this comment

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

In the isGitHubAppEntry true version, there are two "info" icons in this block of text. By itself, probably not a problem, but the spacing between the two icons and this text passage is equidistant, so it's hard to tell which icon belongs to which text passage. A little additional spacing on the left side of this text might help to set it off from the first icon, and group it better with the second...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, this was something I played around with for a bit and I wasn't completely satisfied with it.

How about instead, we add some new documentation to https://docs.dockstore.org/en/stable/end-user-topics/dois.html#automatic-dockstore-doi-generation about how to disable automatic DOIs? Then I can just keep a single info icon at the end of the description that links to https://docs.dockstore.org/en/stable/end-user-topics/dois.html#automatic-dockstore-doi-generation which contains all the needed info for automatic DOIs?

Copy link
Contributor Author

@kathy-t kathy-t Feb 12, 2025

Choose a reason for hiding this comment

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

I went with this approach so there's only one info icon. I created https://ucsc-cgl.atlassian.net/browse/SEAB-6950 to update our documentation to include instructions on opting out

@kathy-t
Copy link
Contributor Author

kathy-t commented Feb 12, 2025

Updated screenshots

Legacy workflow with toggle:
Screenshot 2025-02-12 at 11-51-25 Dockstore My Workflows

GitHub App workflow without toggle:
Screenshot 2025-02-12 at 11-51-17 Dockstore My Workflows

@kathy-t kathy-t requested a review from svonworl February 12, 2025 17:05
@hyunnaye
Copy link
Contributor

In the screenshot, does the toggle disappear when set to On?

@kathy-t
Copy link
Contributor Author

kathy-t commented Feb 12, 2025

In the screenshot, does the toggle disappear when set to On?

No, the first screenshot is for a legacy workflow which has a toggle and the second screenshot is for a GitHub App workflow which has no toggle. I'll update the description to be clearer 🙂

@hyunnaye
Copy link
Contributor

In the screenshot, does the toggle disappear when set to On?

No, the first screenshot is for a legacy workflow which has a toggle and the second screenshot is for a GitHub App workflow which has no toggle. I'll update the description to be clearer 🙂

Thanks for clarifying. Looks good!

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@kathy-t kathy-t merged commit 9da6cbe into hotfix/2.13.4 Feb 12, 2025
14 of 19 checks passed
@kathy-t kathy-t deleted the seab-6807/legacy-doi-opt-out branch February 12, 2025 18:39
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.

3 participants