- default routing to "/app/dashboard"
Some checks failed
CI Pipeline / japa-tests (push) Failing after 53s

- default route after login "/app/dashboard" in AuthController.ts
- npm updates
- corrected route in menu.ts
- better styling for listing datasets for editor and submitter in Index.vue
- personal setting to route "/settings/user"
This commit is contained in:
Kaimbacher 2023-12-01 10:44:19 +01:00
parent 6fef581dd0
commit 0d51002903
10 changed files with 117 additions and 103 deletions

View file

@ -133,7 +133,7 @@ const logout = async () => {
<template #dropdown>
<!-- <NavBarItem> -->
<!-- <NavBarItem route-name="admin.account.info"> -->
<NavBarItem :route-name="'admin.account.info'">
<NavBarItem :route-name="'settings.user'">
<NavBarItemLabel :icon="mdiAccount" label="My Profile" />
</NavBarItem>
<NavBarItem v-if="userHasRoles(['moderator', 'administrator'])" :route-name="'settings'">

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, mdiTrashCan, mdiAlertBoxOutline, mdiLockOpen } from '@mdi/js';
import { mdiSquareEditOutline, mdiAlertBoxOutline } from '@mdi/js';
import { computed } from 'vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
@ -38,7 +38,6 @@ const flash: ComputedRef<any> = computed(() => {
return usePage().props.flash;
});
const validStates = ['inprogress', 'rejected_editor'];
const getRowClass = (dataset) => {
// (props.options ? 'select' : props.type)
@ -80,80 +79,83 @@ const getRowClass = (dataset) => {
<table class="pure-table">
<thead>
<tr>
<th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<!-- <Sort label="Dataset Title" attribute="title" :search="form.search" /> -->
Dataset Title
Title
</th>
<th>Submitter</th>
<th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
Submitter
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<!-- <Sort label="Email" attribute="email" :search="form.search" /> -->
<th>Server State</th>
State
</th>
<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">
Date of last modification
</th>
<th scope="col" class="relative px-6 py-3" v-if="can.edit || can.delete">
<span class="sr-only">Actions</span>
</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">
<tbody class="bg-white divide-y divide-gray-200">
<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">
<!-- <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 }}
<div class="text-sm font-medium">{{ dataset.main_title }}</div>
</td>
<td> {{ dataset.user.login }} </td>
<td>
{{ dataset.server_state }}
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<div class="text-sm">{{ dataset.user.login }}</div>
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<div class="text-sm">{{ dataset.server_state }}</div>
</td>
<td v-if="dataset.server_state === 'released'">
<small class="text-gray-500 dark:text-slate-400" :title="dataset.server_date_modified">
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white"
v-if="dataset.server_state === 'released'">
<div class="text-sm" :title="dataset.server_date_modified">
Preferred reviewer: {{ dataset.preferred_reviewer }}
</small>
</div>
</td>
<td
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white"
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">
<div class="text-sm" :title="dataset.server_date_modified">
In approval by: {{ dataset.editor?.login }}
</small>
</div>
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white" v-else>
<div class="text-sm">{{ dataset.editor?.login }}</div>
</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">
<td data-label="modified" class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<div class="text-sm" :title="dataset.server_date_modified">
{{ dataset.server_date_modified }}
</small>
</div>
</td>
<td class="before:hidden lg:w-1 whitespace-nowrap">
<td class="py-4 whitespace-nowrap text-right text-sm font-medium text-gray-700 dark:text-white">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<BaseButton
v-if="can.receive && (dataset.server_state == 'released')"
<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 /> -->
:icon="mdiSquareEditOutline" :label="'Receive task'" small />
</BaseButtons>
</td>
</tr>
</tbody>
</table>
<!-- <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 /> -->
<div class="py-4">
<Pagination v-bind:data="datasets.meta" />
@ -165,24 +167,23 @@ const getRowClass = (dataset) => {
<style scoped>
.pure-table tr.released {
background-color: greenyellow;
/* background-color: greenyellow; */
background-color: rgb(52 211 153);
color: gray;
}
.pure-table tr.editor_accepted {
padding: 0.8em;
background-color: lightblue;
/* background-color: lightblue; */
background-color: rgb(125 211 252);
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;
}

View file

@ -81,22 +81,26 @@ const getRowClass = (dataset) => {
<table class="pure-table">
<thead>
<tr>
<th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<!-- <Sort label="Dataset Title" attribute="title" :search="form.search" /> -->
Dataset Title
</th>
<th>
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
<!-- <Sort label="Email" attribute="email" :search="form.search" /> -->
<th>Server State</th>
Server State
</th>
<th scope="col" class="py-3 text-left text-xs font-medium uppercase tracking-wider">
Date of last modification
</th>
<th scope="col" class="relative px-6 py-3" v-if="can.edit || can.delete">
<span class="sr-only">Actions</span>
</th>
<th>Date of last modification</th>
<th v-if="can.edit || can.delete">Actions</th>
</tr>
</thead>
<tbody>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="dataset in props.datasets.data" :key="dataset.id" :class="getRowClass(dataset)">
<td data-label="Login">
<td data-label="Login" class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<!-- <Link v-bind:href="stardust.route('user.show', [user.id])"
class="no-underline hover:underline text-cyan-600 dark:text-cyan-400">
{{ user.login }}
@ -104,16 +108,16 @@ const getRowClass = (dataset) => {
<!-- {{ user.id }} -->
{{ dataset.main_title }}
</td>
<td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
{{ dataset.server_state }}
</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">
<td data-label="modified" class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
<div class="text-sm" :title="dataset.server_date_modified">
{{ dataset.server_date_modified }}
</small>
</div>
</td>
<td class="before:hidden lg:w-1 whitespace-nowrap">
<td class="py-4 whitespace-nowrap text-right text-sm font-medium text-gray-700 dark:text-white">
<BaseButtons v-if="validStates.includes(dataset.server_state)"
type="justify-start lg:justify-end" no-wrap>
<!-- release created dataset -->
@ -152,20 +156,22 @@ const getRowClass = (dataset) => {
</template>
<style scoped>
.pure-table tr.inprogress {
padding: 0.8em;
background-color: paleturquoise;
.pure-table tr.released {
/* background-color: greenyellow; */
background-color: rgb(52 211 153);
color: gray;
}
.pure-table tr.released {
background-color: greenyellow;
.pure-table tr.inprogress {
padding: 0.8em;
/* bg-teal-300 */
background-color: rgb(94 234 212);
color: gray;
}
.pure-table tr.editor_accepted {
padding: 0.8em;
background-color: lightblue;
/* background-color: lightblue; */
background-color: rgb(125 211 252);
color: gray;
}

View file

@ -88,7 +88,7 @@ export const MainService = defineStore('main', {
fetch(sampleDataKey) {
// sampleDataKey= clients or history
axios
.get(`data-sources/${sampleDataKey}.json`)
.get(`/data-sources/${sampleDataKey}.json`)
.then((r) => {
if (r.data && r.data.data) {
this[sampleDataKey] = r.data.data;
@ -102,7 +102,7 @@ export const MainService = defineStore('main', {
fetchApi(sampleDataKey) {
// sampleDataKey= authors or datasets
axios
.get(`api/${sampleDataKey}`)
.get(`/api/${sampleDataKey}`)
.then((r) => {
if (r.data) {
this[sampleDataKey] = r.data;

View file

@ -11,7 +11,7 @@ import {
export default [
{
route: 'dashboard',
route: 'app.dashboard',
icon: mdiMonitor,
label: 'Dashboard',
},