Skip to content

Commit

Permalink
Merge pull request #192 from nih-sparc/add-funding-program-facet-to-d…
Browse files Browse the repository at this point in the history
…atasets-page

Added funding program facet to data page
  • Loading branch information
egauzens authored Aug 28, 2024
2 parents 8dbe92b + 5163110 commit 6a8ea6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/FacetMenu/DatasetFacetMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default {
'item.modalities.keyword',
'attributes.subject.sex.value',
'attributes.subject.ageCategory.value',
'pennsieve.organization.name',
'availability'
] :
[
Expand All @@ -94,12 +95,13 @@ export default {
'item.modalities.keyword',
'attributes.subject.sex.value',
'attributes.subject.ageCategory.value',
'pennsieve.organization.name',
'availability'
]
const visibleModelsAndSimulationsFacetCategories = config.public.SHOW_HIERARCHAL_FACETS === 'true' ?
['anatomy.organ.category.name', 'anatomy.organ.subcategory.name', 'availability', 'organisms.primary.species.name'] :
['anatomy.organ.name', 'availability', 'organisms.primary.species.name']
['anatomy.organ.category.name', 'anatomy.organ.subcategory.name', 'pennsieve.organization.name', 'availability', 'organisms.primary.species.name'] :
['anatomy.organ.name', 'pennsieve.organization.name', 'availability', 'organisms.primary.species.name']
return {
visibleDatasetsFacetCategories,
Expand Down
6 changes: 6 additions & 0 deletions utils/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export const facetPropPathMapping = [
facetPropPath: 'attributes.subject.ageCategory.value',
facetSubpropPath: 'attributes.subject.ageCategory.subcategory.name'
},
{
label: 'Funding Program',
id: 'pennsieve.organization',
facetPropPath: 'pennsieve.organization.name',
facetSubpropPath: 'pennsieve.organization.subCategory.name'
},
]

export const getAlgoliaFacets = function(algoliaIndex : SearchIndex, propPathMapping : Array<{id: string, facetPropPath: string, facetSubpropPath: string, label: string}>, filters : string) {
Expand Down

0 comments on commit 6a8ea6c

Please sign in to comment.