Skip to content

Commit

Permalink
Merge pull request #2041 from magland/neurosift-dandiset-external-ser…
Browse files Browse the repository at this point in the history
…vice

Add neurosift external service for dandisets
  • Loading branch information
waxlamp authored Oct 31, 2024
2 parents 49205b3 + 430c4fe commit 7bb1654
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/src/views/DandisetLandingView/DandisetActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
>
<ContactDialog />
</v-row>
<v-row
no-gutters
>
<ExternalDandisetServicesDialog />
</v-row>
</div>

<!-- Files and Metadata buttons -->
Expand Down Expand Up @@ -159,6 +164,7 @@ import DownloadDialog from './DownloadDialog.vue';
import CiteAsDialog from './CiteAsDialog.vue';
import ShareDialog from './ShareDialog.vue';
import ContactDialog from './ContactDialog.vue';
import ExternalDandisetServicesDialog from './ExternalDandisetServicesDialog.vue';
const store = useDandisetStore();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<template>
<v-menu
offset-y
left
>
<template
#activator="{ on, attrs }"
>
<v-btn
id="external-dandiset-services"
outlined
block
v-bind="attrs"
v-on="on"
>
<v-icon
color="primary"
left
>
mdi-web
</v-icon>
<span>Open with</span>
<v-spacer />
<v-icon right>
mdi-chevron-down
</v-icon>
</v-btn>
</template>
<v-card
>
<v-list>
<v-tooltip
open-on-hover
left
>
<template #activator="{ on }">
<div
v-on="on"
>
<v-list-item
:href="neurosiftURL"
target="_blank"
>
<v-icon
color="primary"
left
small
>
mdi-web
</v-icon>
Neurosift
</v-list-item>
</div>
</template>
<span>Open the Dandiset in Neurosift</span>
</v-tooltip>
</v-list>
</v-card>
</v-menu>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { useDandisetStore } from '@/stores/dandiset';
const store = useDandisetStore();
const currentDandiset = computed(() => store.dandiset);
const neurosiftURL = 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://gui-staging.dandiarchive.org/') ? '&staging=1' : '';
return `https://neurosift.app/?p=/dandiset&dandisetId=${dandisetId}&dandisetVersion=${dandisetVersion}${stagingParam}`;
});
</script>
<style scoped>
.v-btn--outlined {
border: thin solid #E0E0E0;
color: #424242;
font-weight: 400;
}
</style>

0 comments on commit 7bb1654

Please sign in to comment.