From 4d7ff619b748dd1ce46ad76c517149b2c1597e00 Mon Sep 17 00:00:00 2001 From: Riley Grant Date: Wed, 1 May 2024 20:36:21 -0500 Subject: [PATCH] refactor(browser): generalize download links associated files --- browser/src/DownloadsPage/ExacDownloads.tsx | 2 +- .../src/DownloadsPage/GnomadV2Downloads.tsx | 22 +- .../GnomadV2LiftoverDownloads.tsx | 8 +- .../src/DownloadsPage/GnomadV3Downloads.tsx | 6 +- .../src/DownloadsPage/GnomadV4Downloads.tsx | 10 +- .../__snapshots__/DownloadsPage.spec.tsx.snap | 916 +++++++++++++----- .../src/DownloadsPage/downloadsPageStyles.tsx | 45 +- 7 files changed, 727 insertions(+), 282 deletions(-) diff --git a/browser/src/DownloadsPage/ExacDownloads.tsx b/browser/src/DownloadsPage/ExacDownloads.tsx index 76470a8ae..3359ae066 100644 --- a/browser/src/DownloadsPage/ExacDownloads.tsx +++ b/browser/src/DownloadsPage/ExacDownloads.tsx @@ -66,7 +66,7 @@ const ExacDownloads = () => ( path="/legacy/exac_browser/ExAC.r1.sites.vep.vcf.gz" size="4.56 GiB" md5="f2b57a6f0660a00e7550f62da2654948" - includeTBI + associatedFileType="TBI" /> diff --git a/browser/src/DownloadsPage/GnomadV2Downloads.tsx b/browser/src/DownloadsPage/GnomadV2Downloads.tsx index 26a53c325..591a53b98 100644 --- a/browser/src/DownloadsPage/GnomadV2Downloads.tsx +++ b/browser/src/DownloadsPage/GnomadV2Downloads.tsx @@ -212,7 +212,7 @@ const GnomadV2Downloads = () => { path="/release/2.1.1/vcf/exomes/gnomad.exomes.r2.1.1.sites.vcf.bgz" size="58.81 GiB" md5="f034173bf6e57fbb5e8ce680e95134f2" - includeTBI + associatedFileType="TBI" /> {exomeChromosomeVcfs.map(({ chrom, size, md5 }) => ( @@ -223,7 +223,7 @@ const GnomadV2Downloads = () => { path={`/release/2.1.1/vcf/exomes/gnomad.exomes.r2.1.1.sites.${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -247,7 +247,7 @@ const GnomadV2Downloads = () => { path="/release/2.1.1/vcf/genomes/gnomad.genomes.r2.1.1.sites.vcf.bgz" size="460.93 GiB" md5="e6eadf5ac7b2821b40f350da6e1279a2" - includeTBI + associatedFileType="TBI" /> {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -257,7 +257,7 @@ const GnomadV2Downloads = () => { path="/release/2.1.1/vcf/genomes/gnomad.genomes.r2.1.1.exome_calling_intervals.sites.vcf.bgz" size="9.7 GiB" md5="e5bd69a0f89468149bc3afca78cd5acc" - includeTBI + associatedFileType="TBI" /> {genomeChromosomeVcfs.map(({ chrom, size, md5 }) => ( @@ -268,7 +268,7 @@ const GnomadV2Downloads = () => { path={`/release/2.1.1/vcf/genomes/gnomad.genomes.r2.1.1.sites.${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -331,7 +331,7 @@ const GnomadV2Downloads = () => { {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -339,7 +339,7 @@ const GnomadV2Downloads = () => { {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -347,7 +347,7 @@ const GnomadV2Downloads = () => { {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -355,7 +355,7 @@ const GnomadV2Downloads = () => { {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -363,7 +363,7 @@ const GnomadV2Downloads = () => { {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -371,7 +371,7 @@ const GnomadV2Downloads = () => { diff --git a/browser/src/DownloadsPage/GnomadV2LiftoverDownloads.tsx b/browser/src/DownloadsPage/GnomadV2LiftoverDownloads.tsx index 607cf1844..ea23b1c9d 100644 --- a/browser/src/DownloadsPage/GnomadV2LiftoverDownloads.tsx +++ b/browser/src/DownloadsPage/GnomadV2LiftoverDownloads.tsx @@ -109,7 +109,7 @@ const Gnomadv2LiftoverDownloads = () => { path="/release/2.1.1/liftover_grch38/vcf/exomes/gnomad.exomes.r2.1.1.sites.liftover_grch38.vcf.bgz" size="85.31 GiB" md5="cff8d0cfed50adc9211d1feaed2d4ca7" - includeTBI + associatedFileType="TBI" /> {liftoverExomeChromosomeVcfs.map(({ chrom, size, md5 }) => ( @@ -120,7 +120,7 @@ const Gnomadv2LiftoverDownloads = () => { path={`/release/2.1.1/liftover_grch38/vcf/exomes/gnomad.exomes.r2.1.1.sites.${chrom}.liftover_grch38.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -144,7 +144,7 @@ const Gnomadv2LiftoverDownloads = () => { path="/release/2.1.1/liftover_grch38/vcf/genomes/gnomad.genomes.r2.1.1.sites.liftover_grch38.vcf.bgz" size="743.06 GiB" md5="83de3d5b52669f714e810d4fcf047c18" - includeTBI + associatedFileType="TBI" /> {liftoverGenomeChromosomeVcfs.map(({ chrom, size, md5 }) => ( @@ -155,7 +155,7 @@ const Gnomadv2LiftoverDownloads = () => { path={`/release/2.1.1/liftover_grch38/vcf/genomes/gnomad.genomes.r2.1.1.sites.${chrom}.liftover_grch38.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} diff --git a/browser/src/DownloadsPage/GnomadV3Downloads.tsx b/browser/src/DownloadsPage/GnomadV3Downloads.tsx index 06ea30638..c4e449cd4 100644 --- a/browser/src/DownloadsPage/GnomadV3Downloads.tsx +++ b/browser/src/DownloadsPage/GnomadV3Downloads.tsx @@ -116,7 +116,7 @@ const GnomadV3Downloads = () => ( path={`/release/3.1.2/vcf/genomes/gnomad.genomes.v3.1.2.sites.chr${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -206,7 +206,7 @@ const GnomadV3Downloads = () => ( path={`/release/3.1.2/vcf/genomes/gnomad.genomes.v3.1.2.hgdp_tgp.chr${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -238,7 +238,7 @@ const GnomadV3Downloads = () => ( path="/release/3.1/vcf/genomes/gnomad.genomes.v3.1.sites.chrM.vcf.bgz" size="4.77 MiB" md5="d0ef2bd882ae44236897d743cb5528cf" - includeTBI + associatedFileType="TBI" /> {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} diff --git a/browser/src/DownloadsPage/GnomadV4Downloads.tsx b/browser/src/DownloadsPage/GnomadV4Downloads.tsx index 41cfda6aa..2832605ca 100644 --- a/browser/src/DownloadsPage/GnomadV4Downloads.tsx +++ b/browser/src/DownloadsPage/GnomadV4Downloads.tsx @@ -147,7 +147,7 @@ const GnomadV4Downloads = () => { path={`/release/4.1/vcf/exomes/gnomad.exomes.v4.1.sites.chr${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -172,7 +172,7 @@ const GnomadV4Downloads = () => { path={`/release/4.1/vcf/genomes/gnomad.genomes.v4.1.sites.chr${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -199,7 +199,7 @@ const GnomadV4Downloads = () => { path={`/release/4.1/vcf/joint/gnomad.joint.v4.1.sites.chr${chrom}.vcf.bgz`} size={size} md5={md5} - includeTBI + associatedFileType="TBI" /> ))} @@ -358,7 +358,7 @@ const GnomadV4Downloads = () => { path="/release/4.1/genome_sv/gnomad.v4.1.sv.sites.vcf.gz" size="1.62 GiB" md5="3ee614951c2f0c36659842876f7ce0ba" - includeTBI + associatedFileType="TBI" /> {/* @ts-expect-error TS(2745) FIXME: This JSX tag's 'children' prop expects type 'never... Remove this comment to see the full error message */} @@ -368,7 +368,7 @@ const GnomadV4Downloads = () => { path="/release/4.1/genome_sv/gnomad.v4.1.sv.non_neuro_controls.sites.vcf.gz" size="3.19 GiB" md5="442b43a740f7f12f1f9b054f9d09b530" - includeTBI + associatedFileType="TBI" /> diff --git a/browser/src/DownloadsPage/__snapshots__/DownloadsPage.spec.tsx.snap b/browser/src/DownloadsPage/__snapshots__/DownloadsPage.spec.tsx.snap index de39cd1e4..e734d220f 100644 --- a/browser/src/DownloadsPage/__snapshots__/DownloadsPage.spec.tsx.snap +++ b/browser/src/DownloadsPage/__snapshots__/DownloadsPage.spec.tsx.snap @@ -823,7 +823,9 @@ exports[`Downloads Page has no unexpected changes 1`] = `
- Download TBI from + Download + TBI + from
- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from

- Download TBI from + Download + TBI + from
{ return ( <> @@ -340,18 +337,18 @@ export const DownloadLinks = ({ ), ])}
- {includeTBI && ( + {associatedFileType && ( <>
- Download TBI from{' '} + Download {associatedFileType.toUpperCase()} from{' '} {renderDownloadOptions([ includeGCP && ( // @ts-expect-error TS(2786) FIXME: 'ExternalLink' cannot be used as a JSX component. Google @@ -360,8 +357,8 @@ export const DownloadLinks = ({ // @ts-expect-error TS(2786) FIXME: 'ExternalLink' cannot be used as a JSX component. Amazon @@ -370,8 +367,8 @@ export const DownloadLinks = ({ // @ts-expect-error TS(2786) FIXME: 'ExternalLink' cannot be used as a JSX component. Microsoft @@ -383,13 +380,3 @@ export const DownloadLinks = ({ ) } - -DownloadLinks.defaultProps = { - size: undefined, - md5: undefined, - gcsBucket: 'gcp-public-data--gnomad', - includeGCP: true, - includeAWS: true, - includeAzure: true, - includeTBI: false, -}