Skip to content

Commit

Permalink
[DUOS-2691][DUOS-2685][DUOS-2704] Data library updates (#2349)
Browse files Browse the repository at this point in the history
* fix: only show open access from own institution

* fix: search all studies with eLwazi in them

* feat: add nhgri data library
  • Loading branch information
fboulnois authored Oct 5, 2023
1 parent 3bc8c34 commit f0b9404
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const Routes = (props) => (
<AuthenticatedRoute path="/datalibrary_mgb" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/datalibrary_elwazi" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/datalibrary_myinstitution" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/datalibrary_nhgri" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/dataset_statistics/:datasetId" component={DatasetStatistics} props={props}
rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path="/dac_datasets" component={DACDatasets} props={props} rolesAllowed={[USER_ROLES.chairperson]} />
Expand Down
5 changes: 5 additions & 0 deletions src/images/nhgri-logo-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 16 additions & 18 deletions src/pages/DatasetSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import broadIcon from '../logo.svg';
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 { Storage } from '../libs/storage';
import { isEmpty, isNil } from 'lodash';
import { Box, CircularProgress } from '@mui/material';

const signingOfficialQuery = (user) => {
Expand All @@ -23,29 +23,18 @@ const signingOfficialQuery = (user) => {
const myInstitutionQuery = (user) => {
return {
'bool': {
'should': [
'must': [
{
'bool': {
'must': [
{
'match_phrase': {
'submitter.institution.id': user.institution.id
}
},
{
'term': {
'dacApproval': true
}
}
]
'match_phrase': {
'submitter.institution.id': user.institution.id
}
},
{
'term': {
'openAccess': true
'dacApproval': true
}
}
],
]
}
};
}
Expand Down Expand Up @@ -105,7 +94,7 @@ export const DatasetSearch = (props) => {
'/datalibrary_elwazi': {
query: {
'match_phrase': {
'submitter.institution.name': 'eLwazi'
'study.description': 'elwazi'
}
},
icon: elwaziIcon,
Expand All @@ -116,6 +105,15 @@ export const DatasetSearch = (props) => {
icon: null,
title: user.institution.name + ' Data Library',
},
'/datalibrary_nhgri': {
query: {
'match_phrase': {
'study.description': 'anvil'
}
},
icon: nhgriIcon,
title: 'NHGRI Data Library',
}
}

const version = versions[location.pathname];
Expand Down

0 comments on commit f0b9404

Please sign in to comment.