From f0fe054f076c580a1c6925d67559af8611afff1b Mon Sep 17 00:00:00 2001 From: Florian Boulnois Date: Mon, 6 Nov 2023 11:19:04 -0500 Subject: [PATCH 1/2] feat: add anvil data library --- src/images/anvil-logo.svg | 27 +++++++++++++++++++++++++++ src/pages/DatasetSearch.js | 13 ++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/images/anvil-logo.svg diff --git a/src/images/anvil-logo.svg b/src/images/anvil-logo.svg new file mode 100644 index 000000000..c63dcd77f --- /dev/null +++ b/src/images/anvil-logo.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + diff --git a/src/pages/DatasetSearch.js b/src/pages/DatasetSearch.js index 9056cc321..f2f1eefec 100644 --- a/src/pages/DatasetSearch.js +++ b/src/pages/DatasetSearch.js @@ -8,9 +8,11 @@ import duosIcon from '../images/duos-network-logo.svg'; import mgbIcon from '../images/mass-general-brigham-logo.svg'; import elwaziIcon from '../images/elwazi-logo-color.svg'; import nhgriIcon from '../images/nhgri-logo-color.svg'; +import anvilIcon from '../images/anvil-logo.svg'; import homeIcon from '../images/icon_dataset_.png'; import { Storage } from '../libs/storage'; import { Box, CircularProgress } from '@mui/material'; +import { toLower } from 'lodash'; const signingOfficialQuery = (user) => { return { @@ -115,6 +117,15 @@ export const DatasetSearch = (props) => { icon: nhgriIcon, title: 'NHGRI Data Library', }, + 'anvil': { + query: { + 'match_phrase': { + 'study.description': 'anvil' + } + }, + icon: anvilIcon, + title: 'AnVIL Data Library', + }, '/custom': { query: { 'bool': { @@ -137,7 +148,7 @@ export const DatasetSearch = (props) => { } } - const key = query === undefined ? '/datalibrary' : query; + const key = query === undefined ? '/datalibrary' : toLower(query); const version = versions[key] === undefined ? versions['/custom'] : versions[key]; useEffect(() => { From 8e80ba087eb4d97b79bc3899efeffd5f211c6f22 Mon Sep 17 00:00:00 2001 From: Florian Boulnois Date: Mon, 6 Nov 2023 11:30:41 -0500 Subject: [PATCH 2/2] fix: ensure custom data libraries are part of tab nav --- src/components/DuosHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DuosHeader.js b/src/components/DuosHeader.js index e15592959..0050beb07 100644 --- a/src/components/DuosHeader.js +++ b/src/components/DuosHeader.js @@ -129,7 +129,7 @@ export const headerTabsConfig = [ search: 'dataset_catalog', children: [ { label: 'Data Catalog', link: '/dataset_catalog' }, - { label: 'Data Library', link: '/datalibrary' }, + { label: 'Data Library', link: '/datalibrary', search: 'datalibrary' }, { label: 'DAR Requests', link: '/researcher_console' }, { label: 'Data Submissions', link: '/dataset_submissions', isRenderedForUser: (user) => user?.isDataSubmitter } ],