- added the possibility to delete 'inprogress' dataset again for the submitter - concat run commands insider Dockerfile for better docker image - npm updates - add own Exception classes HttpException.ts and InternalServerException.ts
This commit is contained in:
parent
b6b1c90ff8
commit
6fa22aad9b
18 changed files with 473 additions and 251 deletions
131
resources/js/Pages/Submitter/Dataset/Delete.vue
Normal file
131
resources/js/Pages/Submitter/Dataset/Delete.vue
Normal file
|
@ -0,0 +1,131 @@
|
|||
<script setup lang="ts">
|
||||
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
|
||||
import SectionMain from '@/Components/SectionMain.vue';
|
||||
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
|
||||
import { useForm, Head, usePage } from '@inertiajs/vue3';
|
||||
import { computed, Ref } from 'vue';
|
||||
import CardBox from '@/Components/CardBox.vue';
|
||||
import BaseButton from '@/Components/BaseButton.vue';
|
||||
import BaseButtons from '@/Components/BaseButtons.vue';
|
||||
import { stardust } from '@eidellev/adonis-stardust/client';
|
||||
import { mdiArrowLeftBoldOutline, mdiDeleteForever, mdiTrashCan } from '@mdi/js';
|
||||
import FormValidationErrors from '@/Components/FormValidationErrors.vue';
|
||||
|
||||
const props = defineProps({
|
||||
dataset: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
const flash: Ref<any> = computed(() => {
|
||||
return usePage().props.flash;
|
||||
});
|
||||
const errors: Ref<any> = computed(() => {
|
||||
return usePage().props.errors;
|
||||
});
|
||||
const form = useForm({
|
||||
preferred_reviewer: '',
|
||||
preferred_reviewer_email: '',
|
||||
preferation: 'yes_preferation',
|
||||
|
||||
// preferation: '',
|
||||
// isPreferationRequired: false,
|
||||
});
|
||||
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
await form.put(stardust.route('dataset.deleteUpdate', [props.dataset.id]));
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
|
||||
<Head title="Delete dataset" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton :icon="mdiDeleteForever" title="Delete Dataset" main>
|
||||
<BaseButton :route-name="stardust.route('dataset.list')" :icon="mdiArrowLeftBoldOutline" label="Back"
|
||||
color="white" rounded-full small />
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox form @submit.prevent="handleSubmit">
|
||||
<FormValidationErrors v-bind:errors="errors" />
|
||||
|
||||
<!-- Modal Content -->
|
||||
<div class="modal-content py-4 text-left px-6">
|
||||
<!-- Modal Title -->
|
||||
<div class="text-xl font-bold mb-4">Confirm Deletion</div>
|
||||
<!-- Modal Body -->
|
||||
<p>Are you sure you want to delete the dataset from Tethys Data Research Repository?
|
||||
Also the following files will be deleted:
|
||||
</p>
|
||||
|
||||
<ul class="mt-4 space-y-4 text-left text-gray-500 dark:text-gray-400">
|
||||
<li class="flex items-center space-x-3" v-for="file in dataset.files" :key="file.id">
|
||||
<svg class="flex-shrink-0 w-3.5 h-3.5 text-green-500 dark:text-green-400" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5.917 5.724 10.5 15 1.5" />
|
||||
</svg>
|
||||
<span>{{ file.label }} with mime-type
|
||||
<span class="font-semibold text-gray-900 dark:text-white">
|
||||
{{ file.mime_type }}
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
<!-- <li class="flex items-center space-x-3">
|
||||
<svg class="flex-shrink-0 w-3.5 h-3.5 text-green-500 dark:text-green-400" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5.917 5.724 10.5 15 1.5" />
|
||||
</svg>
|
||||
<span>No setup, or hidden fees</span>
|
||||
</li>
|
||||
<li class="flex items-center space-x-3">
|
||||
<svg class="flex-shrink-0 w-3.5 h-3.5 text-green-500 dark:text-green-400" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5.917 5.724 10.5 15 1.5" />
|
||||
</svg>
|
||||
<span>Team size: <span class="font-semibold text-gray-900 dark:text-white">1
|
||||
developer</span></span>
|
||||
</li>
|
||||
<li class="flex items-center space-x-3">
|
||||
<svg class="flex-shrink-0 w-3.5 h-3.5 text-green-500 dark:text-green-400" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5.917 5.724 10.5 15 1.5" />
|
||||
</svg>
|
||||
<span>Premium support: <span class="font-semibold text-gray-900 dark:text-white">6
|
||||
months</span></span>
|
||||
</li>
|
||||
<li class="flex items-center space-x-3">
|
||||
<svg class="flex-shrink-0 w-3.5 h-3.5 text-green-500 dark:text-green-400" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 5.917 5.724 10.5 15 1.5" />
|
||||
</svg>
|
||||
<span>Free updates: <span class="font-semibold text-gray-900 dark:text-white">6
|
||||
months</span></span>
|
||||
</li> -->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="flash && flash.warning" class="flex flex-col mt-6 animate-fade-in">
|
||||
<div class="bg-yellow-500 border-l-4 border-orange-400 text-white p-4" role="alert">
|
||||
<p class="font-bold">Be Warned</p>
|
||||
<p>{{ flash.warning }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<BaseButtons>
|
||||
<BaseButton type="submit" color="danger" :icon="mdiTrashCan" :small="true"
|
||||
:class="{ 'opacity-25': form.processing }" :disabled="form.processing" label="Confirm Delete" />
|
||||
</BaseButtons>
|
||||
</template>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
|
@ -64,6 +64,7 @@ const flash: ComputedRef<any> = computed(() => {
|
|||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
|
||||
<Head title="Submit Dataset" />
|
||||
<SectionMain>
|
||||
<!-- <FormValidationErrors v-bind:errors="errors" /> -->
|
||||
|
@ -85,9 +86,9 @@ const flash: ComputedRef<any> = computed(() => {
|
|||
</th>
|
||||
<th>
|
||||
<!-- <Sort label="Email" attribute="email" :search="form.search" /> -->
|
||||
<th>Server State</th>
|
||||
<th>Server State</th>
|
||||
</th>
|
||||
<th>Date of last modification</th>
|
||||
<th>Date of last modification</th>
|
||||
<th v-if="can.edit || can.delete">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -101,36 +102,28 @@ const flash: ComputedRef<any> = computed(() => {
|
|||
</Link> -->
|
||||
<!-- {{ user.id }} -->
|
||||
{{ dataset.main_title }}
|
||||
</td>
|
||||
</td>
|
||||
<td>
|
||||
{{ dataset.server_state }}
|
||||
</td>
|
||||
|
||||
</td>
|
||||
|
||||
<td data-label="Created" class="lg:w-1 whitespace-nowrap">
|
||||
<small class="text-gray-500 dark:text-slate-400" :title="dataset.server_date_modified">{{ dataset.updated_at }}</small>
|
||||
<small class="text-gray-500 dark:text-slate-400" :title="dataset.server_date_modified">{{
|
||||
dataset.updated_at }}</small>
|
||||
</td>
|
||||
<td v-if="can.edit || can.delete" class="before:hidden lg:w-1 whitespace-nowrap">
|
||||
<BaseButtons type="justify-start lg:justify-end" no-wrap>
|
||||
<!-- release created dataset -->
|
||||
<BaseButton
|
||||
v-if="can.edit"
|
||||
:route-name="stardust.route('dataset.release', [dataset.id])"
|
||||
color="info"
|
||||
:icon="mdiLockOpen"
|
||||
:label="'Release'"
|
||||
small
|
||||
/>
|
||||
<!-- release created dataset -->
|
||||
<BaseButton v-if="can.edit"
|
||||
:route-name="stardust.route('dataset.release', [dataset.id])" color="info"
|
||||
:icon="mdiLockOpen" :label="'Release'" small />
|
||||
<!-- && (dataset.server_state === 'inprogress' || dataset.server_state === 'rejected_editor')" -->
|
||||
<BaseButton
|
||||
v-if="can.edit"
|
||||
:route-name="stardust.route('dataset.edit', [dataset.id])"
|
||||
color="info"
|
||||
:icon="mdiSquareEditOutline"
|
||||
:label="'Edit'"
|
||||
small
|
||||
/>
|
||||
<BaseButton v-if="can.edit" :route-name="stardust.route('dataset.edit', [dataset.id])"
|
||||
color="info" :icon="mdiSquareEditOutline" :label="'Edit'" small />
|
||||
<!-- @click="destroy(dataset.id)" -->
|
||||
<BaseButton v-if="can.delete" color="danger" :icon="mdiTrashCan" small />
|
||||
<BaseButton v-if="can.delete" color="danger"
|
||||
:route-name="stardust.route('dataset.delete', [dataset.id])" :icon="mdiTrashCan"
|
||||
small />
|
||||
</BaseButtons>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue