Skip to content

Commit

Permalink
feat: add better error messages in zenodo modal
Browse files Browse the repository at this point in the history
  • Loading branch information
megasanjay committed Oct 12, 2024
1 parent 1388a94 commit 9cca1bc
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions ui/pages/dashboard/[owner]/[repo]/release/zenodo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ const checkForZenodoPublishProgress = () => {
zenodoPublishDOI.value = response.zenodoDoi;
clearInterval(zenodoPublishProgressInterval.value);
await navigateTo(`/dashboard/${owner}/${repo}/`);
}
})
.catch((error) => {
Expand All @@ -380,6 +378,10 @@ const checkForZenodoPublishProgress = () => {
}, 3000);
};
const navigateToDashboard = async () => {
await navigateTo(`/dashboard/${owner}/${repo}/`);
};
const startZenodoPublishProcess = async (shouldPublish: boolean = false) => {
if (shouldPublish) {
zenodoPublishSpinner.value = true;
Expand Down Expand Up @@ -1090,7 +1092,11 @@ onBeforeUnmount(() => {
:title="
zenodoPublishStatus === 'inProgress'
? 'Zenodo publish in progress'
: 'Zenodo publish completed'
: zenodoPublishStatus === 'error'
? 'Zenodo publish error'
: zenodoPublishStatus === 'published'
? 'Zenodo publish success'
: 'Something went wrong'
"
:bordered="false"
size="huge"
Expand Down Expand Up @@ -1119,23 +1125,20 @@ onBeforeUnmount(() => {
Your Zenodo deposition has been published. You can view the Zenodo
record on the dashboard.
</p>

<NuxtLink :to="`https://doi.org/${zenodoPublishDOI}`" target="_blank">
<n-button type="primary">
<template #icon>
<Icon name="simple-icons:zenodo" size="16" />
</template>
View Zenodo record
</n-button>
</NuxtLink>
</n-flex>

<template #footer>
<n-flex justify="end">
<n-button
type="success"
@click="showZenodoPublishProgressModal = false"
>
<n-flex justify="space-between">
<NuxtLink :to="`https://doi.org/${zenodoPublishDOI}`" target="_blank">
<n-button type="primary" v-if="zenodoPublishStatus === 'published'">
<template #icon>
<Icon name="simple-icons:zenodo" size="16" />
</template>
View Zenodo record
</n-button>
</NuxtLink>

<n-button type="success" @click="navigateToDashboard">
Okay
</n-button>
</n-flex>
Expand Down

0 comments on commit 9cca1bc

Please sign in to comment.