diff --git a/src/components/data_search/DatasetFilterList.jsx b/src/components/data_search/DatasetFilterList.jsx index 530776bb6..9dbfcd360 100644 --- a/src/components/data_search/DatasetFilterList.jsx +++ b/src/components/data_search/DatasetFilterList.jsx @@ -47,6 +47,7 @@ export const DatasetFilterList = (props) => { const accessManagementFilters = uniq(compact(datasets.map((dataset) => dataset.accessManagement))); const dataUseFilters = uniq(compact(flatten(datasets.map((dataset) => dataset.dataUse?.primary))).map((dataUse) => dataUse.code)); + const dataTypeFilters = uniq(flatten(datasets.map((dataset) => dataset.study.dataTypes))); const dacFilters = orderBy(uniq(compact(datasets.map((dataset) => dataset.dac?.dacName))), (dac) => dac.toLowerCase(), 'asc'); return ( @@ -84,6 +85,15 @@ export const DatasetFilterList = (props) => { isFiltered={isFiltered} filterNameFn={(filter) => filter} /> + + filter} + /> ); }; diff --git a/src/components/data_search/DatasetSearchTable.jsx b/src/components/data_search/DatasetSearchTable.jsx index 362cc7573..b574dc9aa 100644 --- a/src/components/data_search/DatasetSearchTable.jsx +++ b/src/components/data_search/DatasetSearchTable.jsx @@ -36,6 +36,7 @@ const styles = { const defaultFilters = { accessManagement: [], dataUse: [], + dataType: [], dac: [], search: [] }; @@ -133,6 +134,17 @@ export const DatasetSearchTable = (props) => { } }); + filterTerms.push({ + 'bool': { + 'should': + filters.dataType.map(term => ({ + 'match': { + 'study.dataTypes': term + } + })) + } + }); + filterTerms.push({ 'bool': { 'should':