Skip to content

Commit

Permalink
Merge branch 'main' into address-sues-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
egauzens committed Aug 6, 2024
2 parents 823fa79 + ce6b4d1 commit 8def0d2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 25 deletions.
6 changes: 5 additions & 1 deletion components/BiolucidaViewer/BiolucidaViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,21 @@ export default {
''
)
const [
blv_info,
view_info,
image_info,
] = await Promise.all([
biolucida.getBLVLink(image_identifier),
biolucida.decodeViewParameter(viewId),
biolucida.getImageInfo(image_identifier),
])
const blv_link = props.data.blv_link ? props.data.blv_link : blv_info['link']
const BASE_URL = `blv:${config.public.BL_SERVER_URL}`
const queryParameters = `image_id=${image_identifier}&type=${view_info[1]}${view_info[2]}&filename=${image_info.name}`
const webNeurolucidaLink = BASE_URL + '/image_view?' + queryParameters
return {
blv_link,
webNeurolucidaLink
}
} catch (e) {
Expand All @@ -120,7 +124,7 @@ export default {
},
methods: {
launchViewer() {
window.open(this.data.blv_link, '_blank')
window.open(this.blv_link, '_blank')
},
launchNL360C() {
biolucida
Expand Down
21 changes: 5 additions & 16 deletions components/DatasetDetails/DatasetFilesInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,14 @@
<h2 class="heading2">
Dataset Files
</h2>
<div class="flex mb-16">
<span>
<span class="label4">Dataset size: </span>{{ formatMetric(datasetInfo.size) }}
</span>
<span class="dataset-link inline">
<div class="mb-16">
<a href="https://docs.sparc.science/docs/navigating-a-sparc-dataset" class="dataset-link" target="_blank">
How to navigate datasets
</a>
</span>
</div>
</div>
<div class="mb-16">
<span class="label4">Dataset size: </span>{{ formatMetric(datasetInfo.size) }}
</div>
<files-table :osparc-viewers="osparcViewers" :dataset-scicrunch="datasetScicrunch" />
</div>
<data-use-agreement-popup :show-dialog="showAgreementPopup" @agreement-loaded="agreementLoaded"
Expand Down Expand Up @@ -406,15 +404,6 @@ hr {
border-left: 1px solid $lineColor1
}
}
.flex {
display: flex;
align-content: space-between;
}
.inline {
margin-left: auto;
display: inline-block;
}
.download-text-block {
background-color: $background;
Expand Down
4 changes: 0 additions & 4 deletions components/ViewersMetadata/BiolucidaViewerMetadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ export default {
try {
const image_identifier = props.biolucidaData.biolucida_image_id
const [
blv_info,
xmp_metadata,
readme_markdown
] = await Promise.all([
biolucida.getBLVLink(image_identifier),
biolucida.getXMPInfo(image_identifier),
fetch(props.datasetInfo.readme).then((response) => {
return response.text()
Expand All @@ -133,10 +131,8 @@ export default {
const html = MarkedMixin.methods.parseMarkdown(readme_markdown)
const data_collection = extractSection(/data collect[^:]+:/i, html)
const blv_link = blv_info['link']
return {
data_collection,
blv_link,
xmp_metadata
}
} catch (e) {
Expand Down
8 changes: 6 additions & 2 deletions pages/apps/maps/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const restoreStateWithUUID = async (route, $axios, sparcApi) => {
return [uuid, state, successMessage, failMessage]
}
const openViewWithQuery = async (route, $axios, sparcApi, algoliaIndex, discover_api, $pennsieveApiClient) => {
const openViewWithQuery = async (router, route, $axios, sparcApi, algoliaIndex, discover_api, $pennsieveApiClient) => {
//Open the map with specific view defined by the query.
//First get the bucket and facets information if available
let s3Bucket = undefined
Expand Down Expand Up @@ -300,6 +300,9 @@ const openViewWithQuery = async (route, $axios, sparcApi, algoliaIndex, discover
return await processEntry(route)
} else if (route.query.type === 'wholebody') {
startingMap = "WholeBody"
} else {
router.replace({ ...router.currentRoute, query: { type: 'ac' } })
failMessage = 'Invalid parameters were detected. Default parameters will now be used.'
}
return [startingMap, organ_name, currentEntry, successMessage, failMessage, facets]
Expand All @@ -310,6 +313,7 @@ export default {
async setup() {
const config = useRuntimeConfig()
const { $algoliaClient, $axios, $pennsieveApiClient } = useNuxtApp()
const router = useRouter()
const route = useRoute()
let startingMap = "AC"
let organ_name = undefined
Expand Down Expand Up @@ -347,7 +351,7 @@ export default {
successMessage,
failMessage,
facets
] = await openViewWithQuery(route, $axios, options.sparcApi, algoliaIndex,
] = await openViewWithQuery(router, route, $axios, options.sparcApi, algoliaIndex,
config.public.discover_api_host, $pennsieveApiClient)
}
Expand Down
30 changes: 29 additions & 1 deletion pages/datasets/file/[datasetId]/[datasetVersion]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
<form ref="zipForm" method="POST" :action="zipitUrl">
<input v-model="zipData" type="hidden" name="data" />
</form>
<span class="help-link" v-if="hasViewer && (activeTabId in helpers)">
<a :href="`https://docs.sparc.science/docs/${helpers[activeTabId].link}`" target="_blank">
Find out more about the {{ helpers[activeTabId].name }}
</a>
</span>
<content-tab-card v-if="hasViewer" class="mt-24" :tabs="tabs" :active-tab-id="activeTabId">
<biolucida-viewer v-if="hasBiolucidaViewer" v-show="activeTabId === 'imageViewer'" :data="biolucidaData"
:datasetInfo="datasetInfo" :file="file" />
Expand Down Expand Up @@ -225,7 +230,21 @@ export default {
tabs: [],
file: {},
zipData: '',
zipitUrl: config.public.zipit_api_host
zipitUrl: config.public.zipit_api_host,
helpers: {
imageViewer: {
name: 'Biolucida Viewer',
link: 'image-viewer-overview'
},
segmentationViewer: {
name: 'Segmentation Viewer',
link: 'segmentation-viewer-overview'
},
plotViewer: {
name: 'Plot Viewer',
link: 'plot-viewer'
}
}
}
},
Expand Down Expand Up @@ -368,3 +387,12 @@ export default {
}
}
</script>
<style lang="scss">
.help-link {
float: right;
@media screen and (max-width: 29rem) {
float: none;
}
}
</style>
2 changes: 1 addition & 1 deletion tests/cypress/e2e/datasets.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ datasetIds.forEach(datasetId => {
cy.get('.el-dialog__headerbtn').click();

// Check for files breadcrumb
cy.get('.inline > .dataset-link').should('have.attr', 'href', 'https://docs.sparc.science/docs/navigating-a-sparc-dataset');
cy.get('.mb-16 > .dataset-link').should('have.attr', 'href', 'https://docs.sparc.science/docs/navigating-a-sparc-dataset');
cy.get('.breadcrumb-link').should('have.class', 'breadcrumb-link');
cy.get('.breadcrumb-link').should('have.attr', 'href').and('contain', 'datasetDetailsTab=files&path=files');
cy.get('tbody').then(($ele) => {
Expand Down

0 comments on commit 8def0d2

Please sign in to comment.