- npm updates
Some checks failed
CI Pipeline / japa-tests (push) Failing after 51s

- added views and controller coder for reviewer role
- added program logic for publishing a dataset by editor
- added reviewer menu
- adapted routes.ts for additional routes
This commit is contained in:
Kaimbacher 2024-01-04 16:40:05 +01:00
parent c70fa4a0d8
commit 18635f77b3
17 changed files with 1224 additions and 393 deletions

View file

@ -2,7 +2,7 @@
// import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3';
import { Head, usePage } from '@inertiajs/vue3';
import { ComputedRef } from 'vue';
import { mdiSquareEditOutline, mdiAlertBoxOutline, mdiShareVariant } from '@mdi/js';
import { mdiSquareEditOutline, mdiAlertBoxOutline, mdiShareVariant, mdiBookEdit } from '@mdi/js';
import { computed } from 'vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
@ -42,16 +42,16 @@ const flash: ComputedRef<any> = computed(() => {
const getRowClass = (dataset) => {
// (props.options ? 'select' : props.type)
let rowclass = '';
if (dataset.server_state == 'editor_accepted') {
rowclass = 'editor_accepted';
if (dataset.server_state == 'accepted') {
rowclass = 'bg-accepted';
} else if (dataset.server_state == 'rejected_reviewer') {
rowclass = 'rejected_reviewer';
rowclass = 'bg-rejected-reviewer';
} else if (dataset.server_state == 'reviewed') {
rowclass = 'reviewed';
rowclass = 'bg-reviewed';
} else if (dataset.server_state == 'released') {
rowclass = 'released';
rowclass = 'bg-released';
} else if (dataset.server_state == 'published') {
rowclass = 'released';
rowclass = 'bg-published';
} else {
rowclass = '';
}
@ -77,7 +77,7 @@ const getRowClass = (dataset) => {
<!-- table -->
<CardBox class="mb-6" has-table>
<div v-if="props.datasets.data.length > 0">
<table class="pure-table">
<table>
<thead>
<tr>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
@ -152,6 +152,12 @@ const getRowClass = (dataset) => {
v-if="can.approve && (dataset.server_state == 'editor_accepted' || dataset.server_state == 'rejected_reviewer')"
:route-name="stardust.route('editor.dataset.approve', [dataset.id])"
color="info" :icon="mdiShareVariant" :label="'Approve'" small />
<BaseButton
v-if="can.publish && (dataset.server_state == 'reviewed')"
:route-name="stardust.route('editor.dataset.publish', [dataset.id])"
color="info" :icon="mdiBookEdit" :label="'Publish'" small />
</BaseButtons>
</td>
</tr>
@ -179,27 +185,3 @@ const getRowClass = (dataset) => {
</SectionMain>
</LayoutAuthenticated>
</template>
<style scoped>
.pure-table tr.released {
/* background-color: greenyellow; */
background-color: rgb(52 211 153);
color: gray;
}
.pure-table tr.editor_accepted {
/* background-color: lightblue; */
background-color: rgb(125 211 252);
color: gray;
}
.pure-table tr.rejected_reviewer {
background-color: orange;
color: gray;
}
.pure-table tr.reviewed {
background-color: yellow;
color: gray;
}
</style>