hotfix (dataset): improve dataset classification and review workflow

- 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
This commit is contained in:
Kaimbacher 2025-04-24 18:25:07 +02:00
parent c3ae4327b7
commit c245c8e97d
12 changed files with 277 additions and 253 deletions

View file

@ -96,14 +96,14 @@ const formatServerState = (state: string) => {
<table>
<thead>
<tr>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider dark:text-white">
<!-- <Sort label="Dataset Title" attribute="title" :search="form.search" /> -->
Title
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider dark:text-white">
ID
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider dark:text-white">
<!-- <Sort label="Email" attribute="email" :search="form.search" /> -->
State
</th>
@ -111,10 +111,10 @@ const formatServerState = (state: string) => {
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
Editor
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider dark:text-white">
Remaining Time
</th>
<th scope="col" class="relative px-6 py-3" v-if="can.edit || can.delete">
<th scope="col" class="relative px-6 py-3 dark:text-white" v-if="can.edit || can.delete">
<span class="sr-only">Actions</span>
</th>
</tr>
@ -123,28 +123,28 @@ const formatServerState = (state: string) => {
<tbody>
<tr v-for="dataset in props.datasets.data" :key="dataset.id" :class="[getRowClass(dataset)]">
<td data-label="Login"
class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
class="py-4 whitespace-nowrap text-gray-700">
<div class="text-sm table-title">{{ dataset.main_title }}</div>
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<td class="py-4 whitespace-nowrap text-gray-700">
<div class="text-sm">{{ dataset.id }}</div>
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<td class="py-4 whitespace-nowrap text-gray-700">
<div class="text-sm">{{ formatServerState(dataset.server_state) }}</div>
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<td class="py-4 whitespace-nowrap text-gray-700">
<div class="text-sm">{{ dataset.editor?.login }}</div>
</td>
<td data-label="modified" class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<td data-label="modified" class="py-4 whitespace-nowrap text-gray-700">
<div class="text-sm" :title="dataset.remaining_time">
{{ dataset.remaining_time + ' days' }}
</div>
</td>
<td
class="py-4 whitespace-nowrap text-right text-sm font-medium text-gray-700 dark:text-white">
class="py-4 whitespace-nowrap text-right text-sm font-medium text-gray-700">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<BaseButton v-if="can.review && (dataset.server_state == 'approved')"
:route-name="stardust.route('reviewer.dataset.review', [dataset.id])"

View file

@ -10,6 +10,7 @@ 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: {
@ -20,6 +21,10 @@ const props = defineProps({
type: Object,
required: true,
},
can: {
type: Object,
default: () => ({}),
},
});
const flash: Ref<any> = computed(() => {
@ -56,8 +61,8 @@ const handleSubmit = async (e) => {
<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 />
<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" />
@ -69,24 +74,23 @@ const handleSubmit = async (e) => {
</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>
<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>