- Renamed "Collections" to "Classify" in dataset category views for submitters and editors to better reflect the page's purpose. - Modified the `SectionTitleLineWithButton` component to conditionally render the cog button based on the `showCogButton` prop. - Updated the Dataset Edit and Create views to use `textarea` instead of `text` for title and description input fields, allowing for multi-line text. - Added authorization checks for dataset review and reject actions in the `Reviewer/DatasetController`, and passed the `can` object to the `Review` view. - Added a "Reject" button to the dataset review page, visible only to users with the `dataset-review-reject` permission and when the dataset is in the 'approved' state. - Improved the display of dataset information in index views by adding dark mode styling to table headers. - Removed unused code and comments from the Dashboard.vue file. - Removed the `show-header-icon` property from the CardBox component in the Create.vue file. - Updated dependencies
99 lines
3.8 KiB
Vue
99 lines
3.8 KiB
Vue
<script setup lang="ts">
|
|
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
|
|
import SectionMain from '@/Components/SectionMain.vue';
|
|
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
|
|
import { router, 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, mdiGlasses } from '@mdi/js';
|
|
import FormValidationErrors from '@/Components/FormValidationErrors.vue';
|
|
import { mdiReiterate } from '@mdi/js';
|
|
|
|
const props = defineProps({
|
|
dataset: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
fields: {
|
|
type: Object,
|
|
required: true,
|
|
},
|
|
can: {
|
|
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 router.put(stardust.route('reviewer.dataset.reviewUpdate', [props.dataset.id]));
|
|
// 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="Review dataset" />
|
|
<SectionMain>
|
|
<SectionTitleLineWithButton :icon="mdiGlasses" title="Review approved dataset" main>
|
|
<BaseButton :route-name="stardust.route('reviewer.dataset.list')" :icon="mdiArrowLeftBoldOutline"
|
|
label="Back" color="white" rounded-full small />
|
|
</SectionTitleLineWithButton>
|
|
<CardBox form @submit.prevent="handleSubmit">
|
|
<FormValidationErrors v-bind:errors="errors" />
|
|
|
|
<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>
|
|
|
|
<div class="flex flex-col">
|
|
<div class="flex flex-row items-center justify-between dark:bg-slate-900 bg-gray-200 p-2 mb-2"
|
|
v-for="(fieldValue, field) in fields" :key="field">
|
|
|
|
<label :for="field" class="font-bold h-6 mt-3 text-xs leading-8 uppercase">{{ field }}</label>
|
|
<span class="text-sm text-gray-600" v-html="fieldValue"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<template #footer>
|
|
<BaseButtons>
|
|
<!-- <BaseButton type="submit" color="info" label="Receive"
|
|
:class="{ 'opacity-25': router.processing }" :disabled="form.processing" /> -->
|
|
<BaseButton type="submit" color="info" label="Accept" />
|
|
<BaseButton v-if="can.reject && (dataset.server_state == 'approved')"
|
|
:route-name="stardust.route('reviewer.dataset.reject', [dataset.id])" color="info"
|
|
:icon="mdiReiterate" :label="'Reject'" />
|
|
</BaseButtons>
|
|
</template>
|
|
</CardBox>
|
|
</SectionMain>
|
|
</LayoutAuthenticated>
|
|
</template>
|