diff --git a/src/components/DatasetDataDictionaryTab/index.tsx b/src/components/DatasetDataDictionaryTab/index.tsx index 7d1dff82..11855a49 100644 --- a/src/components/DatasetDataDictionaryTab/index.tsx +++ b/src/components/DatasetDataDictionaryTab/index.tsx @@ -10,13 +10,14 @@ import DatasetDictionaryTable from '../DatasetDictionaryTable'; import { Button, Spinner } from '@cmsgov/design-system'; const DataDictionary = ( - { datasetDictionaryEndpoint, datasetSitewideDictionary, title, pageSize = 20, additionalParams } : + { datasetDictionaryEndpoint, datasetSitewideDictionary, title, pageSize = 20, additionalParams, csvDownload } : { datasetDictionaryEndpoint: string, datasetSitewideDictionary: DatasetDictionaryItemType[] title: string, pageSize: number, additionalParams: any, + csvDownload : boolean }) => { const {data, isPending, error} = useQuery({ @@ -36,10 +37,22 @@ const DataDictionary = (

{title}

{datasetDictionary && ( <> -
+
+ {csvDownload && ( +
+ + + Download Dictionary CSV + +
+ )}
diff --git a/src/templates/Dataset/index.tsx b/src/templates/Dataset/index.tsx index d6954e3d..c232d594 100644 --- a/src/templates/Dataset/index.tsx +++ b/src/templates/Dataset/index.tsx @@ -45,7 +45,8 @@ const Dataset = ({ apiPageUrl = "/api", dataDictionaryUrl, borderlessTabs = false, - defaultPageSize = 25 + defaultPageSize = 25, + dataDictionaryCSV = false } : DatasetPageType) => { const options = location.search ? { ...qs.parse(location.search, { ignoreQueryPrefix: true }) } @@ -197,7 +198,13 @@ const Dataset = ({ } className={ borderlessTabs ? 'ds-u-border--0 ds-u-padding-x--0' : '' } > - + ) : null} diff --git a/src/types/dataset.ts b/src/types/dataset.ts index f947c4a8..69104acc 100644 --- a/src/types/dataset.ts +++ b/src/types/dataset.ts @@ -67,7 +67,8 @@ export type DatasetPageType = { dataDictionaryUrl: string | undefined, dataDictionaryACA: string | undefined, borderlessTabs: boolean, - defaultPageSize: Number + defaultPageSize: Number, + dataDictionaryCSV: boolean, }