- small adaptions for AsideMenuItem.vue, AsideMenuLayer.vue
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s

- new routes editor.dataset.list and editor.dataset.update
- fir functionalities for editor role, suche as listing and receiving released datasets
- npm updates
This commit is contained in:
Kaimbacher 2023-11-30 13:40:32 +01:00
parent c1e056b9fc
commit 6fef581dd0
11 changed files with 550 additions and 84 deletions

View file

@ -6,13 +6,11 @@ import { mdiSquareEditOutline, mdiTrashCan, mdiAlertBoxOutline, mdiLockOpen } fr
import { computed } from 'vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
// import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import BaseButton from '@/Components/BaseButton.vue';
import CardBox from '@/Components/CardBox.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import NotificationBar from '@/Components/NotificationBar.vue';
import Pagination from '@/Components/Admin/Pagination.vue';
// import Sort from '@/Components/Admin/Sort.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
@ -34,38 +32,41 @@ const props = defineProps({
// }
});
// const search = computed(() => {
// return props.filters.search;
// });
const flash: ComputedRef<any> = computed(() => {
// let test = usePage();
// console.log(test);
return usePage().props.flash;
});
// const errors: ComputedRef<any> = computed(() => {
// return usePage().props.errors;
// });
const validStates = ['inprogress', 'rejected_editor'];
// const form = useForm({
// search: props.filters.search,
// });
const getRowClass = (dataset) => {
// (props.options ? 'select' : props.type)
let rowclass = '';
if (dataset.server_state == 'inprogress') {
rowclass = 'inprogress';
} else if (dataset.server_state == 'released') {
rowclass = 'released';
} else if (dataset.server_state == 'editor_accepted' || dataset.server_state == 'ejected_reviewer') {
rowclass = 'editor_accepted';
} else if (dataset.server_state == 'approved') {
rowclass = 'approved';
} else if (dataset.server_state == 'eviewed') {
rowclass = 'eviewed';
} else if (dataset.server_state == 'ejected_editor') {
rowclass = 'ejected_editor';
} else {
rowclass = '';
}
return rowclass;
};
// const formDelete = useForm({});
// async function destroy(id) {
// const destroy = async (id) => {
// // if (confirm('Are you sure you want to delete?')) {
// // await formDelete.delete(stardust.route('dataset.destroy', [id]));
// // }
// };
</script>
<template>
<LayoutAuthenticated>
<Head title="Submit Dataset" />
<Head title="Dataset List" />
<SectionMain>
<!-- <FormValidationErrors v-bind:errors="errors" /> -->
<NotificationBar v-if="flash.message" color="success" :icon="mdiAlertBoxOutline">
@ -77,7 +78,7 @@ const flash: ComputedRef<any> = computed(() => {
<!-- table -->
<CardBox class="mb-6" has-table>
<table>
<table class="pure-table">
<thead>
<tr>
<th>
@ -94,7 +95,7 @@ const flash: ComputedRef<any> = computed(() => {
</thead>
<tbody>
<tr v-for="dataset in props.datasets.data" :key="dataset.id">
<tr v-for="dataset in props.datasets.data" :key="dataset.id" :class="getRowClass(dataset)">
<td data-label="Login">
<!-- <Link v-bind:href="stardust.route('user.show', [user.id])"
class="no-underline hover:underline text-cyan-600 dark:text-cyan-400">
@ -108,19 +109,19 @@ const flash: ComputedRef<any> = computed(() => {
</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.server_date_modified }}
</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>
<td class="before:hidden lg:w-1 whitespace-nowrap">
<BaseButtons v-if="validStates.includes(dataset.server_state)"
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 />
<!-- && (dataset.server_state === 'inprogress' || dataset.server_state === 'rejected_editor')" -->
<BaseButton :route-name="stardust.route('dataset.edit', [dataset.id])"
<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"
:route-name="stardust.route('dataset.delete', [dataset.id])" :icon="mdiTrashCan"
small />
@ -149,3 +150,51 @@ const flash: ComputedRef<any> = computed(() => {
</SectionMain>
</LayoutAuthenticated>
</template>
<style scoped>
.pure-table tr.inprogress {
padding: 0.8em;
background-color: paleturquoise;
color: gray;
}
.pure-table tr.released {
background-color: greenyellow;
color: gray;
}
.pure-table tr.editor_accepted {
padding: 0.8em;
background-color: lightblue;
color: gray;
}
.pure-table tr.rejected_reviewer {
padding: 0.8em;
background-color: orange;
color: gray;
}
.pure-table tr.rejected_editor {
/* padding: 0.8em; */
background-color: orange;
color: gray;
}
.pure-table tr.reviewed {
/* padding: 0.8em; */
background-color: yellow;
color: gray;
}
.pure-table tr.approved {
/* padding: 0.8em; */
background-color: rgb(86, 86, 241);
color: whitesmoke;
}
.pure-table tr.reviewed {
/* padding: 0.8em; */
background-color: #ffed4a;
}</style>