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 all annotated variants download button to api access page #1208

Merged
merged 4 commits into from
Mar 3, 2025

Conversation

bprize15
Copy link
Contributor

@bprize15 bprize15 commented Mar 1, 2025

@bprize15 bprize15 requested a review from calvinlu3 March 1, 2025 19:34
@@ -82,6 +82,21 @@ const DownloadButtonGroups: React.FunctionComponent<{
buttonText="Cancer Gene List"
/>
) : null}
{props.data.hasAllAnnotatedVariants && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we check if the user's authority list includes ROLE_PREMIUM_API? I think currently, the button is visible to ROLE_DATA_DOWNLOAD.

Copy link
Contributor Author

@bprize15 bprize15 Mar 2, 2025

Choose a reason for hiding this comment

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

Do we want the user to have both ROLE_DATA_DOWNLOAD and ROLE_PREMIUM_API?

I think if ROLE_PREMIUM_API supersedes ROLE_DATA_DOWNLOAD we can probably add the private endpoints to role PREMIUM_API, right? Or maybe we want to open up allAnnotatedVariants and allActionableVariants to ROLE_DATA_DOWNLOAD. Seems weird to me that we would allow someone to download the entire data dump but not the full list of annotated variants.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree that data download role should give you access to the annotated variants files since we already give them the SQL dump with this role. Can you just update so that if the user has data download or is a premium user, then show the data download section. You don't need to explicitly check if premium user for allActionable and allAnnotated file buttons. (

this.props.authenticationStore.account.authorities.includes(
USER_AUTHORITY.ROLE_DATA_DOWNLOAD
) ? (
)

}}
buttonText="All Annotated Variants"
/>
)}
{props.data.hasAllActionableVariants ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be checking props.data.hasSqlDump right? I think someone had a typo here before.

@@ -82,6 +82,21 @@ const DownloadButtonGroups: React.FunctionComponent<{
buttonText="Cancer Gene List"
/>
) : null}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we also include allActionableVariantsTxt as well. We sometimes get that request too and should be quick to add?

@bprize15 bprize15 requested a review from calvinlu3 March 2, 2025 19:47
Comment on lines 285 to 290
(this.props.authenticationStore.account.authorities.includes(
USER_AUTHORITY.ROLE_DATA_DOWNLOAD
) ? (
) ||
this.props.authenticationStore.account.authorities.includes(
USER_AUTHORITY.ROLE_PREMIUM_USER
)) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just check .includes(RoleA, RoleB)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used .some()

@@ -52,6 +52,7 @@ function getMinorVersion(versionString: string): number | undefined {
const BUTTON_CLASS_NAME = 'mr-2 my-1';
const DownloadButtonGroups: React.FunctionComponent<{
data: DownloadAvailabilityWithDate;
authenticationStore: AuthenticationStore;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh my bad, thought I removed it

@bprize15 bprize15 requested a review from calvinlu3 March 3, 2025 20:05
Copy link
Collaborator

@calvinlu3 calvinlu3 left a comment

Choose a reason for hiding this comment

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

LGTM

@calvinlu3 calvinlu3 added the feature Feature tag for release label Mar 3, 2025
@bprize15 bprize15 merged commit b7a7aa2 into master Mar 3, 2025
7 of 8 checks passed
@bprize15 bprize15 deleted the feat/all-annotated-variants-download branch March 3, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature tag for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants