- prettier format checking

- 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:
Kaimbacher 2023-09-05 18:18:42 +02:00
parent b6b1c90ff8
commit 6fa22aad9b
18 changed files with 473 additions and 251 deletions

View file

@ -3,6 +3,8 @@ import { computed, ref } from 'vue';
// import { MainService } from '@/Stores/main';
import { StyleService } from '@/Stores/style';
import { mdiTrashCan } from '@mdi/js';
import { mdiDragVariant } from '@mdi/js';
import BaseIcon from '@/Components/BaseIcon.vue';
// import CardBoxModal from '@/Components/CardBoxModal.vue';
// import TableCheckboxCell from '@/Components/TableCheckboxCell.vue';
import BaseLevel from '@/Components/BaseLevel.vue';
@ -118,6 +120,7 @@ const removeAuthor = (key) => {
<thead>
<tr>
<!-- <th v-if="checkable" /> -->
<th />
<th scope="col">Sort</th>
<th class="hidden lg:table-cell"></th>
<th>Name</th>
@ -133,6 +136,7 @@ const removeAuthor = (key) => {
<draggable id="galliwasery" tag="tbody" v-model="items" item-key="id">
<template #item="{ index, element }">
<tr>
<td class="drag-icon"><BaseIcon :path="mdiDragVariant"/></td>
<td scope="row">{{ index + 1 }}</td>
<!-- <TableCheckboxCell v-if="checkable" @checked="checked($event, client)" /> -->
<td class="border-b-0 lg:w-6 before:hidden hidden lg:table-cell">

View file

@ -56,7 +56,7 @@ export interface Subject {
external_key?: string;
}
export interface DatasetReference {
// id: number;
// id: number;
value: string;
label: string;
type: string;

View 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>

View file

@ -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>