hotfix (dataset): implement reject to reviewer functionality for editors

- Added "rejected_to_reviewer" state to the `ServerStates` enum.
- Implemented routes and controller actions (`rejectToReviewer`, `rejectToReviewerUpdate`) for editors to reject datasets back to reviewers with a rejection note.
- Added UI elements (button) in the editor dataset index and publish views to trigger the "reject to reviewer" action.
- Updated the reviewer dataset index view to display datasets in the "rejected_to_reviewer" state and show the editor's rejection note.
- Modified the reviewer dataset review page to allow reviewers to view and accept datasets that have been rejected back to them by editors.
- Updated the database migration to include the "rejected_to_reviewer" state in the `documents_server_state_check` constraint.
- Updated dependencies (pinia, redis).
This commit is contained in:
Kaimbacher 2025-05-02 14:35:58 +02:00
parent c245c8e97d
commit be6b38d0a3
15 changed files with 1647 additions and 404 deletions

View file

@ -10,7 +10,7 @@ import FormControl from '@/Components/FormControl.vue';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
import { mdiArrowLeftBoldOutline, mdiReiterate } from '@mdi/js';
import { mdiArrowLeftBoldOutline, mdiReiterate, mdiBookEdit, mdiUndo } from '@mdi/js';
import FormValidationErrors from '@/Components/FormValidationErrors.vue';
const props = defineProps({
@ -18,6 +18,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
can: {
type: Object,
default: () => ({}),
},
});
const flash: Ref<any> = computed(() => {
@ -93,7 +97,11 @@ const handleSubmit = async (e) => {
</p>
<BaseButtons>
<BaseButton type="submit" color="info" label="Set published"
:class="{ 'opacity-25': form.processing }" :disabled="form.processing" />
:class="{ 'opacity-25': form.processing }" :disabled="form.processing" :icon="mdiBookEdit" small />
<BaseButton v-if="can.reject && (dataset.server_state == 'reviewed')"
:route-name="stardust.route('editor.dataset.rejectToReviewer', [dataset.id])"
color="info" :icon="mdiUndo" :label="'Reject To Reviewer'" small
class="col-span-1" />
</BaseButtons>
</template>
</CardBox>