- added @adonisjs/mail
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m2s

- mail_settings_controller for setting smtp settings
- added view ror rjecting dataset for editor
- added new model AppConfig for stroing appwide config values
- better validate_chesum.ts command with process chunking
- added vue3 apps 'BasicSettings' like email, profile settings
- started with 2 multilingual capabilities
- npm updates
This commit is contained in:
Kaimbacher 2024-09-16 17:59:46 +02:00
parent 010bead723
commit b06ccae603
67 changed files with 7820 additions and 1463 deletions

View file

@ -2,7 +2,7 @@
import { Head, useForm, usePage } from '@inertiajs/vue3';
import { ref, watch, computed, ComputedRef } from 'vue';
import FormValidationErrors from '@/Components/FormValidationErrors.vue';
import { Dataset, Description, Title, Subject } from '@/Dataset';
import { Dataset, Title, Subject } from '@/Dataset';
import {
mdiDatabasePlus,
mdiMinusCircle,
@ -44,6 +44,7 @@ import { LayerOptions } from '@/Components/Map/LayerOptions';
import TableKeywords from '@/Components/TableKeywords.vue';
import NotificationBar from '@/Components/NotificationBar.vue';
import FileUploadComponent from '@/Components/FileUpload.vue';
import Person from '#models/person';
const props = defineProps({
licenses: {
@ -276,7 +277,7 @@ const mapId = 'test';
// };
const nextStep = async () => {
let route;
let route ="";
if (formStep.value == 1) {
route = stardust.route('dataset.first.step');
} else if (formStep.value == 2) {
@ -381,7 +382,7 @@ const addTitle = () => {
//this.dataset.files.push(uploadedFiles[i]);
form.titles.push(newTitle);
};
const removeTitle = (key) => {
const removeTitle = (key: number) => {
form.titles.splice(key, 1);
};
@ -390,11 +391,11 @@ const addDescription = () => {
//this.dataset.files.push(uploadedFiles[i]);
form.descriptions.push(newDescription);
};
const removeDescription = (key) => {
const removeDescription = (key: number) => {
form.descriptions.splice(key, 1);
};
const onAddAuthor = (person) => {
const onAddAuthor = (person: Person) => {
if (form.authors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as author' }, 4000);
} else if (form.contributors.filter((e) => e.id === person.id).length > 0) {
@ -404,7 +405,7 @@ const onAddAuthor = (person) => {
notify({ type: 'info', text: 'person has been successfully added as author' });
}
};
const onAddContributor = (person) => {
const onAddContributor = (person: Person) => {
if (form.contributors.filter((e) => e.id === person.id).length > 0) {
notify({ type: 'warning', title: 'Warning', text: 'person is already defined as contributor' }, 4000);
} else if (form.authors.filter((e) => e.id === person.id).length > 0) {
@ -417,7 +418,7 @@ const onAddContributor = (person) => {
}
};
// const onMapInitializedEvent = "onMapInitializedEvent";
const onMapInitialized = (newItem) => {
const onMapInitialized = (newItem: any) => {
// notify({ type: 'info', text: message });
console.log(newItem);
};
@ -439,7 +440,7 @@ const addReference = () => {
/*
Removes a selected reference
*/
const removeReference = (key) => {
const removeReference = (key: number) => {
form.references.splice(key, 1);
};
/*
@ -593,8 +594,8 @@ Removes a selected keyword
<FormField label="Main Title *" help="required: main title"
:class="{ 'text-red-400': form.errors['titles.0.value'] }"
class="w-full mx-2 flex-1">
<FormControl required v-model="form.titles[0].value" type="text"
placeholder="[enter main title]">
<FormControl required v-model="form.titles[0].value" type="textarea"
placeholder="[enter main title]" :show-char-count="true" :max-input-length="255">
<div class="text-red-400 text-sm"
v-if="form.errors['titles.0.value'] && Array.isArray(form.errors['titles.0.value'])">
{{ form.errors['titles.0.value'].join(', ') }}
@ -739,7 +740,7 @@ Removes a selected keyword
</CardBox>
<!-- authors -->
<CardBox class="mb-6 shadow" has-table title="Authors" :icon="mdiBookOpenPageVariant">
<CardBox class="mb-6 shadow" has-table title="Creators" :icon="mdiBookOpenPageVariant">
<SearchAutocomplete source="/api/persons" :response-property="'first_name'"
placeholder="search in person table...." v-on:person="onAddAuthor"></SearchAutocomplete>

View file

@ -239,11 +239,11 @@
</CardBox>
<!-- (7) authors -->
<CardBox class="mb-6 shadow" has-table title="Authors" :icon="mdiBookOpenPageVariant">
<CardBox class="mb-6 shadow" has-table title="Creators" :icon="mdiBookOpenPageVariant">
<SearchAutocomplete source="/api/persons" :response-property="'first_name'"
placeholder="search in person table...." v-on:person="onAddAuthor"></SearchAutocomplete>
<TablePersons :persons="form.authors" v-if="form.authors.length > 0" />
<TablePersons :persons="form.authors" v-if="form.authors.length > 0" :relation="'authors'"/>
<div class="text-red-400 text-sm" v-if="form.errors.authors && Array.isArray(form.errors.authors)">
{{ form.errors.authors.join(', ') }}
</div>
@ -257,7 +257,7 @@
</SearchAutocomplete>
<TablePersons :persons="form.contributors" v-if="form.contributors.length > 0"
:contributortypes="contributorTypes" :errors="form.errors" />
:contributortypes="contributorTypes" :errors="form.errors" :relation="'contributors'" />
<div class="text-red-400 text-sm"
v-if="form.errors.contributors && Array.isArray(form.errors.contributors)">
{{ form.errors.contributors.join(', ') }}

View file

@ -10,7 +10,7 @@ import BaseButton from '@/Components/BaseButton.vue';
import CardBox from '@/Components/CardBox.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import NotificationBar from '@/Components/NotificationBar.vue';
import Pagination from '@/Components/Admin/Pagination.vue';
import Pagination from '@/Components/Pagination.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
@ -61,6 +61,20 @@ const getRowClass = (dataset) => {
return rowclass;
};
// New method to format server state
const formatServerState = (state: string) => {
if (state === 'inprogress') {
return 'draft';
} else if (state === 'released') {
return 'submitted';
} else if (state === 'approved') {
return 'ready for review';
} else if (state === 'reviewer_accepted') {
return 'in review';
}
return state; // Return the original state for other cases
};
</script>
<template>
@ -109,7 +123,7 @@ const getRowClass = (dataset) => {
{{ dataset.main_title }}
</td>
<td class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
{{ dataset.server_state }}
{{ formatServerState(dataset.server_state) }}
</td>
<td data-label="modified" class="py-4 whitespace-nowrap text-gray-700 dark:text-white">
@ -135,42 +149,26 @@ const getRowClass = (dataset) => {
</tbody>
</table>
<div class="py-4">
<Pagination v-bind:data="datasets.meta" />
<!-- <ul>
<li>
<a href="{{ users.page == 1 ? '#' : '?page=' + (users.page - 1) }}">Previous</a>
</li>
@each(page in ???)
<li>
<a href="?page={{ page }}">{{ page }}</a>
</li>
@endeach
<li>
<a href="{{ users.lastPage == users.page ? '#' : '?page=' + (users.page + 1) }}">Next</a>
</li>
</ul> -->
<Pagination v-bind:data="datasets.meta" />
</div>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>
<style scoped lang="css">
.pure-table tr.released {
/* background-color: greenyellow; */
<!-- <style scoped lang="css">
.pure-table tr.released {
background-color: rgb(52 211 153);
color: gray;
}
.pure-table tr.inprogress {
padding: 0.8em;
/* bg-teal-300 */
padding: 0.8em;
background-color: rgb(94 234 212);
color: gray;
}
.pure-table tr.editor_accepted {
/* background-color: lightblue; */
.pure-table tr.editor_accepted {
background-color: rgb(125 211 252);
color: gray;
}
@ -181,24 +179,21 @@ const getRowClass = (dataset) => {
color: gray;
}
.pure-table tr.rejected_editor {
/* padding: 0.8em; */
.pure-table tr.rejected_editor {
background-color: orange;
color: gray;
}
.pure-table tr.reviewed {
/* padding: 0.8em; */
.pure-table tr.reviewed {
background-color: yellow;
color: gray;
}
.pure-table tr.approved {
/* padding: 0.8em; */
.pure-table tr.approved {
background-color: rgb(86, 86, 241);
color: whitesmoke;
}
</style>
</style> -->