diff --git a/CHANGELOG.md b/CHANGELOG.md index de34d6f3f..40e6f2a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Fix bug where app crashed if measurements JSON did not define thresholds ([#1802](https://github.com/nextstrain/auspice/pull/1802)) * Fix bug where measurements display did not honor the default `measurements_display` ([#1802](https://github.com/nextstrain/auspice/pull/1802)) +* Only display download-JSON button if the dataset name can be parsed from pathname ([#1804](https://github.com/nextstrain/auspice/pull/1804)) ## version 2.56.0 - 2024/07/01 diff --git a/src/components/download/downloadButtons.js b/src/components/download/downloadButtons.js index 69fa93309..c4e7a6bb8 100644 --- a/src/components/download/downloadButtons.js +++ b/src/components/download/downloadButtons.js @@ -6,6 +6,7 @@ import { materialButton } from "../../globalStyles"; import * as helpers from "./helperFunctions"; import { getFullAuthorInfoFromNode } from "../../util/treeMiscHelpers"; import { getNumSelectedTips } from "../../util/treeVisibilityHelpers"; +import { getDatasetNamesFromUrl } from "../../actions/loadData"; const RectangularTreeIcon = withTheme(icons.RectangularTree); const PanelsGridIcon = withTheme(icons.PanelsGrid); @@ -35,6 +36,10 @@ export const DownloadButtons = ({dispatch, t, tree, entropy, metadata, colorBy, } } } + /* Verify that we can parse dataset name from URL to support Auspice JSON download */ + const datasetNames = getDatasetNamesFromUrl(window.location.pathname); + const supportAuspiceJsonDownload = !gisaidProvenance && datasetNames.some(Boolean); + const entropyBar = entropy?.selectedCds===nucleotide_gene ? "nucleotide" : "codon"; return ( @@ -48,12 +53,12 @@ export const DownloadButtons = ({dispatch, t, tree, entropy, metadata, colorBy,

{partialData ? `Currently ${selectedTipsCount}/${totalTipCount} tips are displayed and will be downloaded.` : `Currently the entire dataset (${totalTipCount} tips) will be downloaded.`} - {!gisaidProvenance && ( + {supportAuspiceJsonDownload && (