Skip to content

Commit

Permalink
Merge branch 'main' into Add-Related-Datasets-to-File-page
Browse files Browse the repository at this point in the history
  • Loading branch information
egauzens committed Aug 29, 2024
2 parents 5a3d4aa + 6a8ea6c commit 0fca0c4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 12 deletions.
26 changes: 26 additions & 0 deletions components/DatasetDetails/DatasetDescriptionInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@
<div v-if="!isDevice" class="experimental-design-container mb-16">
<span><strong>Number of Samples: </strong>{{samplesMetadataText}}</span>
</div>
<div class="mb-16" v-if="sdsVersion != undefined">
<span>
<strong>SDS Version:
</strong>{{sdsVersion}}
<sparc-tooltip
placement="left-center"
>
<template #item>
<svgo-icon-help class="help-icon"/>
</template>
<template #data>
The version of the <a href="https://docs.sparc.science/docs/sparc-dataset-structure">SPARC Dataset Structure</a> used when publishing this dataset.
</template>
</sparc-tooltip>
</span>
</div>
<div class="mb-16">
<sparc-tooltip
v-if="datasetInfo.embargo"
Expand Down Expand Up @@ -238,6 +254,9 @@ export default {
versionId: function() {
return propOr(0, 'version', this.datasetInfo)
},
sdsVersion: function () {
return _.get(this.datasetMetadataInfo.item, 'sds_version')
},
/**
* Computes the API url for downloading the metadata of a dataset
* @returns {String}
Expand Down Expand Up @@ -294,6 +313,8 @@ export default {
</script>

<style lang="scss" scoped>
@import 'sparc-design-system-components-2/src/assets/_variables.scss';
.dataset-description-info {
overflow-wrap: anywhere;
word-wrap: normal;
Expand Down Expand Up @@ -327,5 +348,10 @@ export default {
min-width: 6.75rem;
}
}
.help-icon {
color: $purple;
height: 1.5rem;
width: 1.5rem;
}
}
</style>
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
19 changes: 9 additions & 10 deletions pages/apps/maps/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,24 @@ const checkSpecies = (route, organ, organ_name, taxo, for_species) => {
//Old link may contain the for_species as undefined
let failMessage = undefined
let successMessage = undefined
const target = flatmaps.speciesMap[taxo]
if (
route.query.for_species &&
route.query.for_species !== 'undefined'
for_species && for_species !== 'undefined'
) {
if (
route.query.for_species !== flatmaps.speciesMap[taxo]
) {
if (for_species !== target) {
failMessage = `Sorry! A flatmap for ${for_species} species does not yet exist. The ${organ_name} of a rat has been shown instead.`
} else if (!organ) {
failMessage = `Sorry! Applicable entity is not yet available. A generic flatmap for ${for_species} species has been shown instead.`
}
} else if (route.query.fid) {
successMessage = "A flatmap's unique id is provided, a legacy map may be displayed instead."
} else {
failMessage = 'Sorry! Species information cannot be found. '
if (organ) {
failMessage += `The ${organ_name} of a rat has been shown instead.`
} else {
failMessage += 'A generic rat flatmap has been shown instead.'
if (!target) {
if (organ) {
failMessage += `The ${organ_name} of a rat has been shown instead.`
} else {
failMessage += 'A generic rat flatmap has been shown instead.'
}
}
}
return { successMessage, failMessage }
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 0fca0c4

Please sign in to comment.