Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@
</div>
</template>
<span>Open the Dandiset in Neurosift</span>
<template #activator="{ props }">

Check failure on line 49 in web/src/views/DandisetLandingView/ExternalDandisetServicesDialog.vue

View workflow job for this annotation

GitHub Actions / lint-type-check

An element cannot have multiple '<template>' elements which are distributed to the same slot
<div v-bind="props">
<v-list-item
:href="brainlifeURL"
target="_blank"
>
<v-icon
color="primary"
start
size="small"
>
mdi-web
</v-icon>
Brainlife
</v-list-item>
</div>
</template>
<span>Open the Dandiset in Brainlife</span>
</v-tooltip>
</v-list>
</v-card>
Expand Down Expand Up @@ -80,4 +98,25 @@
return `https://neurosift.app/dandiset/${dandisetId}?dandisetVersion=${dandisetVersion}${stagingParam}`;
});

const brainlifeURL = computed(() => {
if (!currentDandiset.value) {
throw new Error('Dandiset is undefined');
}

if (!currentDandiset.value.metadata) {
throw new Error('Dandiset metadata is undefined');
}

if (!currentDandiset.value.metadata.url) {
throw new Error('Dandiset metadata.url is undefined');
}

const metadata = currentDandiset.value.metadata;
const dandisetId = currentDandiset.value.dandiset.identifier;
const dandisetVersion = metadata.version;
const stagingParam = metadata.url!.startsWith('https://sandbox.dandiarchive.org/') ? 'dandi-staging/' : '';

return `https://brainlife.io/dandiarchive/${stagingParam}${dandisetId}/${dandisetVersion}`;
});

</script>
Loading