-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from AI-READI/staging
Staging
- Loading branch information
Showing
13 changed files
with
828 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,52 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps({ | ||
defineProps({ | ||
id: { | ||
required: true, | ||
type: String, | ||
}, | ||
}); | ||
const { data: versions, pending } = await useFetch( | ||
`/api/versions/${props.id}`, | ||
{ | ||
lazy: true, | ||
server: false, | ||
versions: { | ||
required: true, | ||
type: Array as PropType<VersionArray>, | ||
}, | ||
); | ||
// todo: add a watchEffect for the error responses | ||
}); | ||
</script> | ||
|
||
<template> | ||
<n-flex vertical class="rounded-xl border border-sky-200 bg-white pb-5 pt-3"> | ||
<n-flex vertical :size="[0, 0]"> | ||
<h3 class="mb-3 px-4">Versions</h3> | ||
|
||
<TransitionFade> | ||
<div v-if="pending" class="flex justify-center p-2"> | ||
<Icon name="svg-spinners:3-dots-scale" size="30" /> | ||
</div> | ||
|
||
<div v-else> | ||
<n-flex | ||
v-for="version in versions" | ||
:key="version.id" | ||
justify="space-between" | ||
align="start" | ||
class="px-4 py-2 transition-all hover:bg-blue-50" | ||
:class="{ | ||
'!bg-sky-100': version.id === id, | ||
}" | ||
<n-flex | ||
v-for="version in versions" | ||
:key="version.id" | ||
justify="space-between" | ||
align="start" | ||
class="px-4 py-2 transition-all hover:bg-blue-50" | ||
:class="{ | ||
'!bg-sky-100': version.id === id, | ||
}" | ||
> | ||
<div class="flex flex-col space-y-1"> | ||
<NuxtLink | ||
:to="`/datasets/${version.id}`" | ||
class="text-sm font-medium transition-all hover:text-slate-600 hover:underline" | ||
> | ||
<div class="flex flex-col space-y-1"> | ||
<NuxtLink | ||
:to="`/datasets/${version.id}`" | ||
class="text-sm font-medium transition-all hover:text-slate-600 hover:underline" | ||
> | ||
Version {{ version.title }} | ||
</NuxtLink> | ||
|
||
<NuxtLink | ||
:to="`https://doi.org/${version.doi}`" | ||
target="_blank" | ||
class="text-sm transition-all hover:text-slate-600 hover:underline" | ||
> | ||
{{ version.doi }} | ||
</NuxtLink> | ||
</div> | ||
Version {{ version.title }} | ||
</NuxtLink> | ||
|
||
<p class="text-right text-xs text-gray-500"> | ||
{{ $dayjs.unix(version.createdAt).format("MMM D, YYYY") }} | ||
</p> | ||
</n-flex> | ||
<NuxtLink | ||
:to="`https://doi.org/${version.doi}`" | ||
target="_blank" | ||
class="text-sm transition-all hover:text-slate-600 hover:underline" | ||
> | ||
{{ version.doi }} | ||
</NuxtLink> | ||
</div> | ||
</TransitionFade> | ||
|
||
<p class="text-right text-xs text-gray-500"> | ||
{{ $dayjs.unix(version.createdAt).format("MMM D, YYYY") }} | ||
</p> | ||
</n-flex> | ||
</n-flex> | ||
</n-flex> | ||
</template> |
Oops, something went wrong.