Skip to content

Commit

Permalink
Merge branch 'nih-sparc:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
egauzens authored Jul 18, 2024
2 parents 942f921 + ed419db commit 04c5580
Show file tree
Hide file tree
Showing 51 changed files with 1,446 additions and 986 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/quality_control_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,22 @@ jobs:
runs-on: ubuntu-latest

outputs:
latest-sha: ${{ steps.latest-deployment-sha.outputs.sha }}
latest-sha: ${{ steps.latest-deployment-sha.outputs.deployment-sha }}

permissions:
deployments: read
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Get sha of latest deployment in main branch
id: latest-deployment-sha
uses: vrnithinkumar/latest-deployment-sha@v1.0.0
uses: go-fjords/get-active-deployment-action@v0.0.3
with:
repo_owner: nih-sparc
repo_name: sparc-app-2
environment: sparc-app-prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print latest deployment sha
id: output
run: echo "${{ steps.latest-deployment-sha.outputs.sha }}"
run: echo "${{ steps.latest-deployment-sha.outputs.deployment-sha }}"

quality-control-cypress-run:
runs-on: ubuntu-latest
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/scheduled_production_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,22 @@ jobs:
runs-on: ubuntu-latest

outputs:
latest-sha: ${{ steps.latest-deployment-sha.outputs.sha }}
latest-sha: ${{ steps.latest-deployment-sha.outputs.deployment-sha }}

permissions:
deployments: read
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Get sha of latest deployment in main branch
id: latest-deployment-sha
uses: vrnithinkumar/latest-deployment-sha@v1.0.0
uses: go-fjords/get-active-deployment-action@v0.0.3
with:
repo_owner: nih-sparc
repo_name: sparc-app-2
environment: sparc-app-prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print latest deployment sha
id: output
run: echo "${{ steps.latest-deployment-sha.outputs.sha }}"
run: echo "${{ steps.latest-deployment-sha.outputs.deployment-sha }}"

scheduled-cypress-run-production:
runs-on: ubuntu-latest
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/scheduled_staging_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,22 @@ jobs:
runs-on: ubuntu-latest

outputs:
latest-sha: ${{ steps.latest-deployment-sha.outputs.sha }}
latest-sha: ${{ steps.latest-deployment-sha.outputs.deployment-sha }}

permissions:
deployments: read
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Get sha of latest deployment in main branch
id: latest-deployment-sha
uses: vrnithinkumar/latest-deployment-sha@v1.0.0
uses: go-fjords/get-active-deployment-action@v0.0.3
with:
repo_owner: nih-sparc
repo_name: sparc-app-2
environment: sparc-app-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print latest deployment sha
id: output
run: echo "${{ steps.latest-deployment-sha.outputs.sha }}"
run: echo "${{ steps.latest-deployment-sha.outputs.deployment-sha }}"

scheduled-cypress-run-staging:
runs-on: ubuntu-latest
Expand Down
9 changes: 1 addition & 8 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ import { successMessage } from './utils/notification-messages'
export default {
async setup() {
const nuxtApp = useNuxtApp()
const loading = ref(false)
const loading = ref(true)
const loaded = ref(false)
const logo = sparcLogoFast
nuxtApp.hook("page:start", () => {
setTimeout(() => {
if (!loaded.value) {
loading.value = true
}
}, 1000)
})
nuxtApp.hook("page:finish", () => {
loading.value = false
loaded.value = true
Expand Down
33 changes: 24 additions & 9 deletions components/DatasetDetails/DatasetActionBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
Cite Scaffold
</el-button>
</template>
<template v-else-if="datasetTypeName === 'device'">
<template v-if="hasFiles">
<el-button
class="dataset-button"
@click="actionButtonClicked('files')"
>
Get Device
</el-button>
</template>
<el-button class="secondary" @click="actionButtonClicked('cite')">
Cite Device
</el-button>
</template>
<template v-else-if="datasetTypeName === 'computational model'">
<el-button v-if="canViewSimulation" @click="openSimulationViewer()">
View Simulation
Expand Down Expand Up @@ -68,15 +81,17 @@
</sparc-tooltip>
</a>
</template>
<el-button
v-if="hasFiles"
@click="actionButtonClicked('files')"
>
Get Dataset
</el-button>
<el-button class="secondary" @click="actionButtonClicked('cite')">
Cite Dataset
</el-button>
<template v-else>
<el-button
v-if="hasFiles"
@click="actionButtonClicked('files')"
>
Get Dataset
</el-button>
<el-button class="secondary" @click="actionButtonClicked('cite')">
Cite Dataset
</el-button>
</template>
<template v-if="sdsViewer">
<a
:href="sdsViewer"
Expand Down
107 changes: 75 additions & 32 deletions components/DatasetDetails/DatasetDescriptionInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,42 @@
<div class="heading2 mb-8">
Metadata
</div>
<p class="mb-8"><strong>Experimental Design: </strong></p>
<template v-if="isDevice">
<p class="mb-8"><strong>Intended Use: </strong>{{ intendedUseText }}</p>
<p class="mb-8"><strong>Current Use: </strong>{{ currentUse }}</p>
<p class="mb-8"><strong>Device Type: </strong>{{ deviceType }}</p>
<p class="mb-8"><strong>Application: </strong>{{ deviceApplication }}</p>
<p class="mb-8"><strong>Device Target (disease or disorder): </strong> {{ deviceTarget }}</p>
<p class="mb-8"><strong>Target Population: </strong></p>
</template>
<template v-else>
<p class="mb-8"><strong>Experimental Design: </strong></p>
<div class="experimental-design-container mb-8">
<span class="experimental-design-section-text-column"><strong>Protocol Links: </strong></span>
<span v-if="datasetRecords.length !== 0">
<div v-for="record in datasetRecords" :key="record.id">
<a
class="link2"
:href="record.url"
target="_blank"
>
{{ record.url }}
</a>
</div>
</span>
<span
v-else
>
N/A
</span>
</div>
<div class="experimental-design-container mb-16">
<span><strong>Experimental Approach: </strong>{{experimentalApproachText}}</span>
</div>
<p class="mb-8"><strong>Subject Information: </strong></p>
</template>
<div class="experimental-design-container mb-8">
<span class="experimental-design-section-text-column"><strong>Protocol Links: </strong></span>
<span v-if="datasetRecords.length !== 0">
<div v-for="record in datasetRecords" :key="record.id">
<a
class="link2"
:href="record.url"
target="_blank"
>
{{ record.url }}
</a>
</div>
</span>
<span
v-else
>
n/a
</span>
</div>
<div class="experimental-design-container mb-16">
<span><strong>Experimental Approach: </strong>{{experimentalApproachText}}</span>
</div>
<p class="mb-8"><strong>Subject Information: </strong></p>
<div class="experimental-design-container mb-8">
<span><strong>Anatomical structure: </strong>{{anatomicalStructureText}}</span>
<span><strong>Anatomical Structure: </strong>{{anatomicalStructureText}}</span>
</div>
<div class="experimental-design-container mb-8">
<span><strong>Species: </strong>{{speciesText}}</span>
Expand All @@ -47,10 +57,10 @@
<span><strong>Sex: </strong>{{sexText}}</span>
</div>
<div class="experimental-design-container mb-8">
<span><strong>Age range: </strong>{{ageRangeText}}</span>
<span><strong>Age Range: </strong>{{ageRangeText}}</span>
</div>
<div class="experimental-design-container mb-16">
<span><strong>Number of samples: </strong>{{samplesMetadataText}}</span>
<div v-if="!isDevice" class="experimental-design-container mb-16">
<span><strong>Number of Samples: </strong>{{samplesMetadataText}}</span>
</div>
<div class="mb-16">
<sparc-tooltip
Expand Down Expand Up @@ -101,7 +111,7 @@
</span>
</span>
<span v-else>
<p>n/a</p>
<p>N/A</p>
</span>
</div>
</template>
Expand Down Expand Up @@ -146,7 +156,7 @@ export default {
},
computed: {
...mapState(useMainStore, ['datasetFacetsData','datasetInfo', 'userToken']),
...mapState(useMainStore, ['datasetFacetsData', 'datasetTypeName', 'datasetInfo', 'userToken']),
EMBARGO_ACCESS() {
return EMBARGO_ACCESS
},
Expand Down Expand Up @@ -182,7 +192,37 @@ export default {
{
return `${this.numberSamples} samples from ${this.numberSubjects} subjects`
}
return 'n/a'
return 'N/A'
},
intendedUseText() {
let intendedUse = _.get(this.datasetMetadataInfo, 'device.intendedUse[0].name', 'N/A')
if (intendedUse.length > 0)
intendedUse = intendedUse.charAt(0).toUpperCase() + intendedUse.slice(1)
return intendedUse
},
currentUse() {
let currentUse = _.get(this.datasetMetadataInfo, 'device.currentUse[0].name', 'N/A')
if (currentUse.length > 0)
currentUse = currentUse.charAt(0).toUpperCase() + currentUse.slice(1)
return currentUse
},
deviceType() {
let deviceType = _.get(this.datasetMetadataInfo, 'device.type[0].name', 'N/A')
if (deviceType.length > 0)
deviceType = deviceType.charAt(0).toUpperCase() + deviceType.slice(1)
return deviceType
},
deviceApplication() {
let deviceApplication = _.get(this.datasetMetadataInfo, 'device.application[0].description', 'N/A')
if (deviceApplication.length > 0)
deviceApplication = deviceApplication.charAt(0).toUpperCase() + deviceApplication.slice(1)
return deviceApplication
},
deviceTarget() {
let deviceTarget = _.get(this.datasetMetadataInfo, 'device.target[0].name', 'N/A')
if (deviceTarget.length > 0)
deviceTarget = deviceTarget.charAt(0).toUpperCase() + deviceTarget.slice(1)
return deviceTarget
},
/**
* Gets dataset id
Expand All @@ -208,6 +248,9 @@ export default {
url += `?api_key=${this.userToken}`
}
return url
},
isDevice() {
return this.datasetTypeName == 'device'
}
},
Expand All @@ -228,7 +271,7 @@ export default {
const facet = this.datasetFacetsData.find(item => item.key === facetKey)
if (facet === undefined || !facet.children)
{
return 'n/a'
return 'N/A'
}
facet.children.forEach(child => {
let childLabel = child.label.charAt(0).toUpperCase() + child.label.slice(1)
Expand Down
4 changes: 2 additions & 2 deletions components/DatasetDetails/DatasetHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ export default {
return !this.embargoed && this.numCitations !== 0
},
numCitationsText: function() {
return this.showCitations ? `${this.numCitations}` : 'n/a'
return this.showCitations ? `${this.numCitations}` : 'N/A'
},
numDownloadsText: function() {
return this.embargoed ? 'n/a' : `${this.numDownloads}`
return this.embargoed ? 'N/A' : `${this.numDownloads}`
}
},
Expand Down
3 changes: 3 additions & 0 deletions components/FacetMenu/ProjectsFacetMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export default {
if (this.$route.query.selectedProjectsAnatomicalFocusIds) {
this.defaultCheckedAnatomicalFocusIds = this.$route.query.selectedProjectsAnatomicalFocusIds.split(",")
}
else {
this.$emit('projects-selections-changed')
}
},
methods: {
Expand Down
3 changes: 3 additions & 0 deletions components/FeaturedData/FeaturedData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export default {
(contentfulFields.containsSearch && contentfulFields.containsSearch.some(keyword => normStr(organ.label).includes(normStr(keyword))))
)
organFacets.forEach(organFacet => {
if (organFacet == undefined || organFacet.children == undefined) {
return
}
if (organFacet.children.length == 0) {
return
}
Expand Down
6 changes: 5 additions & 1 deletion components/Gallery/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
:width="cardWidth" show-card-details @card-clicked="cardClicked" />
<component v-else-if="galleryItemType === 'featuredData'" :is="galleryItemComponent" :item="item"
:width="cardWidth" @card-clicked="cardClicked" />
<component v-else-if="galleryItemType === 'inProgressDatasets'" :is="galleryItemComponent" :width="cardWidth"
:key="item" :item="item" />
</template>
</span>
</template>
Expand All @@ -40,6 +42,7 @@ import HighlightCard from '~/components/Gallery/GalleryItems/HighlightCard.vue'
import DatasetCard from '~/components/Gallery/GalleryItems/DatasetCard.vue'
import FileViewerCard from '~/components/Gallery/GalleryItems/FileViewerCard.vue'
import FeaturedDataCard from '~/components/Gallery/GalleryItems/FeaturedDataCard.vue'
import PennsieveDatasetCard from '~/components/Gallery/GalleryItems/PennsieveDatasetCard.vue'
import { defaultTo } from 'ramda'
import { ref } from 'vue'
Expand All @@ -50,7 +53,8 @@ const galleryItemComponents = {
highlights: HighlightCard,
datasets: DatasetCard,
fileViewer: FileViewerCard,
featuredData: FeaturedDataCard
featuredData: FeaturedDataCard,
inProgressDatasets: PennsieveDatasetCard
}
function convertRemToPixels(rem) {
Expand Down
Loading

0 comments on commit 04c5580

Please sign in to comment.