- small adaptions for AsideMenuItem.vue, AsideMenuLayer.vue
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s
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:
parent
c1e056b9fc
commit
6fef581dd0
11 changed files with 550 additions and 84 deletions
189
resources/js/Pages/Editor/Dataset/Index.vue
Normal file
189
resources/js/Pages/Editor/Dataset/Index.vue
Normal file
|
@ -0,0 +1,189 @@
|
|||
<script setup lang="ts">
|
||||
// import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3';
|
||||
import { Head, usePage } from '@inertiajs/vue3';
|
||||
import { ComputedRef } from 'vue';
|
||||
import { mdiSquareEditOutline, mdiTrashCan, mdiAlertBoxOutline, mdiLockOpen } from '@mdi/js';
|
||||
import { computed } from 'vue';
|
||||
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
|
||||
import SectionMain from '@/Components/SectionMain.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 { stardust } from '@eidellev/adonis-stardust/client';
|
||||
|
||||
const props = defineProps({
|
||||
datasets: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
filters: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
can: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
// user: {
|
||||
// type: Object,
|
||||
// default: () => ({}),
|
||||
// }
|
||||
});
|
||||
|
||||
const flash: ComputedRef<any> = computed(() => {
|
||||
// let test = usePage();
|
||||
// console.log(test);
|
||||
return usePage().props.flash;
|
||||
});
|
||||
|
||||
const validStates = ['inprogress', 'rejected_editor'];
|
||||
|
||||
const getRowClass = (dataset) => {
|
||||
// (props.options ? 'select' : props.type)
|
||||
let rowclass = '';
|
||||
if (dataset.server_state == 'editor_accepted') {
|
||||
rowclass = 'editor_accepted';
|
||||
} else if (dataset.server_state == 'rejected_reviewer') {
|
||||
rowclass = 'rejected_reviewer';
|
||||
} else if (dataset.server_state == 'reviewed') {
|
||||
rowclass = 'reviewed';
|
||||
} else if (dataset.server_state == 'released') {
|
||||
rowclass = 'released';
|
||||
} else if (dataset.server_state == 'published') {
|
||||
rowclass = 'released';
|
||||
} else {
|
||||
rowclass = '';
|
||||
}
|
||||
return rowclass;
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
|
||||
<Head title="Dataset List" />
|
||||
<SectionMain>
|
||||
<!-- <FormValidationErrors v-bind:errors="errors" /> -->
|
||||
<NotificationBar v-if="flash.message" color="success" :icon="mdiAlertBoxOutline">
|
||||
{{ flash.message }}
|
||||
</NotificationBar>
|
||||
<NotificationBar v-if="flash.warning" color="warning" :icon="mdiAlertBoxOutline">
|
||||
{{ flash.warning }}
|
||||
</NotificationBar>
|
||||
|
||||
<!-- table -->
|
||||
<CardBox class="mb-6" has-table>
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<!-- <Sort label="Dataset Title" attribute="title" :search="form.search" /> -->
|
||||
Dataset Title
|
||||
</th>
|
||||
<th>Submitter</th>
|
||||
<th>
|
||||
<!-- <Sort label="Email" attribute="email" :search="form.search" /> -->
|
||||
<th>Server State</th>
|
||||
</th>
|
||||
<th>Editor</th>
|
||||
<th>Date of last modification</th>
|
||||
<th v-if="can.edit || can.delete">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<!-- <th>Dataset Title</th>
|
||||
<th>ID</th>
|
||||
<th>Server State</th>
|
||||
<th>Editor</th>
|
||||
<th>Date of last modification</th>
|
||||
<th></th> -->
|
||||
|
||||
<tbody>
|
||||
<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">
|
||||
{{ user.login }}
|
||||
</Link> -->
|
||||
<!-- {{ user.id }} -->
|
||||
{{ dataset.main_title }}
|
||||
</td>
|
||||
<td> {{ dataset.user.login }} </td>
|
||||
<td>
|
||||
{{ dataset.server_state }}
|
||||
</td>
|
||||
|
||||
<td v-if="dataset.server_state === 'released'">
|
||||
<small class="text-gray-500 dark:text-slate-400" :title="dataset.server_date_modified">
|
||||
Preferred reviewer: {{ dataset.preferred_reviewer }}
|
||||
</small>
|
||||
</td>
|
||||
<td
|
||||
v-else-if="dataset.server_state === 'editor_accepted' || dataset.server_state === 'rejected_reviewer'">
|
||||
<small class="text-gray-500 dark:text-slate-400" :title="dataset.server_date_modified">
|
||||
In approval by: {{ dataset.editor?.login }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td v-else>
|
||||
{{ dataset.editor?.login }}
|
||||
</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.server_date_modified }}
|
||||
</small>
|
||||
</td>
|
||||
<td class="before:hidden lg:w-1 whitespace-nowrap">
|
||||
<BaseButtons type="justify-start lg:justify-end" no-wrap>
|
||||
<BaseButton
|
||||
v-if="can.receive && (dataset.server_state == 'released')"
|
||||
:route-name="stardust.route('editor.dataset.receive', [dataset.id])" color="info"
|
||||
:icon="mdiSquareEditOutline" :label="'Receive task'" small />
|
||||
<!-- <BaseButton
|
||||
v-if="can.edit && (dataset.server_state == 'editor_accepted' || dataset.server_state == 'rejected_reviewer')"
|
||||
:route-name="stardust.route('editor.dataset.edit', [dataset.id])" color="info"
|
||||
:icon="mdiSquareEditOutline" :label="'Edit'" small /> -->
|
||||
</BaseButtons>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="py-4">
|
||||
<Pagination v-bind:data="datasets.meta" />
|
||||
|
||||
</div>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.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.reviewed {
|
||||
/* padding: 0.8em; */
|
||||
background-color: yellow;
|
||||
color: gray;
|
||||
}
|
||||
</style>
|
105
resources/js/Pages/Editor/Dataset/Receive.vue
Normal file
105
resources/js/Pages/Editor/Dataset/Receive.vue
Normal file
|
@ -0,0 +1,105 @@
|
|||
<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, mdiLockOpen } from '@mdi/js';
|
||||
import FormValidationErrors from '@/Components/FormValidationErrors.vue';
|
||||
|
||||
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 isPreferationRequired = computed(() => form.preferation === 'yes_preferation');
|
||||
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
// await form.put(stardust.route('dataset.releaseUpdate', [props.dataset.id]));
|
||||
// // await form.put(stardust.route('editor.dataset.update', [props.dataset.id]));
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
|
||||
<Head title="Receive dataset" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton :icon="mdiLockOpen" title="Receive released dataset" main>
|
||||
<BaseButton :route-name="stardust.route('editor.dataset.list')" :icon="mdiArrowLeftBoldOutline" label="Back"
|
||||
color="white" rounded-full small />
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox form @submit.prevent="handleSubmit">
|
||||
<FormValidationErrors v-bind:errors="errors" />
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <div class="flex flex-col md:flex-row items-center"> -->
|
||||
<div class="w-full">
|
||||
<label class="block font-bold mb-2" for="owner">Submitter:</label>
|
||||
<div class="w-full p-2 rounded-md">{{ dataset.user.login }}</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label class="block font-bold mb-2" for="title">Dataset title:</label>
|
||||
<div class="w-full p-2 rounded-md" v-if="dataset.main_title">
|
||||
{{ dataset.main_title }}
|
||||
</div>
|
||||
<div class="w-full p-2 rounded-md" v-else>
|
||||
No title available
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<label class="block font-bold mb-2" for="title">Dataset abstract:</label>
|
||||
<div class="w-full p-2 rounded-md" v-if="dataset.main_abstract">
|
||||
{{ dataset.main_abstract }}
|
||||
</div>
|
||||
<div class="w-full p-2 rounded-md" v-else>
|
||||
No abstract available
|
||||
</div>
|
||||
</div>
|
||||
<!-- </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="info" label="Receive"
|
||||
:class="{ 'opacity-25': form.processing }" :disabled="form.processing" /> -->
|
||||
</BaseButtons>
|
||||
</template>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue