- addes @adonisjs/redis fo saving session into redis with redis.ts contract and config
Some checks failed
CI Pipeline / japa-tests (push) Failing after 52s

- npm updated
- added createHashValues and dlete inside File.ts
- added dataset_count property inside Subject.ts
- corrected rotes.ts with correct permissions
This commit is contained in:
Kaimbacher 2023-11-27 17:17:22 +01:00
parent d8bdce1369
commit b6fdfbff41
29 changed files with 496 additions and 201 deletions

View file

@ -290,14 +290,15 @@ const submit = async () => {
// this.currentStatus = STATUS_SAVING;
// serrors = [];
// const files = form.files.map((obj) => {
// return new File([obj.blob], obj.label, { type: obj.type, lastModified: obj.lastModified });
// });
const files = form.files.map((obj) => {
return new File([obj.blob], obj.label, { type: obj.type, lastModified: obj.lastModified });
});
// formStep.value++;
await form
.transform((data) => ({
...data,
files: files,
rights: form.rights && form.rights == true ? 'true' : 'false',
}))
.post(route, {
@ -404,7 +405,7 @@ const onMapInitialized = (newItem) => {
adds a new Keyword
*/
const addKeyword = () => {
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled' };
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled', dataset_count: 0 };
//this.dataset.files.push(uploadedFiles[i]);
form.subjects.push(newSubject);
};

View file

@ -8,11 +8,15 @@
color="white" rounded-full small />
</SectionTitleLineWithButton>
<NotificationBar v-if="flash.message" color="success" :icon="mdiAlertBoxOutline">
{{ flash.message }}
</NotificationBar>
<FormValidationErrors v-bind:errors="errors" />
<!-- max-w-2xl max-width: 42rem; /* 672px */ -->
<!-- <div class="max-w-2xl mx-auto"> -->
<CardBox :form="true">
<FormValidationErrors v-bind:errors="errors" />
<!-- <FormValidationErrors v-bind:errors="errors" /> -->
<div class="mb-4">
<!-- <label for="title" class="block text-gray-700 font-bold mb-2">Title:</label>
<input
@ -218,8 +222,8 @@
<td class="before:hidden lg:w-1 whitespace-nowrap">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<!-- <BaseButton color="info" :icon="mdiEye" small @click="isModalActive = true" /> -->
<BaseButton color="danger" :icon="mdiTrashCan" small v-if="item.id == undefined"
@click.prevent="removeDescription(index)" />
<BaseButton color="danger" :icon="mdiTrashCan" small
v-if="item.id == undefined" @click.prevent="removeDescription(index)" />
</BaseButtons>
</td>
</tr>
@ -469,7 +473,8 @@
// import { Component, Vue, Prop, Setup, toNative } from 'vue-facing-decorator';
// import AuthLayout from '@/Layouts/Auth.vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import { useForm, Head } from '@inertiajs/vue3';
import { useForm, Head, usePage } from '@inertiajs/vue3';
import { computed, ComputedRef } from 'vue';
// import { ref } from 'vue';
// import { MainService } from '@/Stores/main';
// import FormInput from '@/Components/FormInput.vue'; // @/Components/FormInput.vue'
@ -502,8 +507,10 @@ import {
mdiTrashCan,
mdiBookOpenPageVariant,
mdiEarthPlus,
mdiAlertBoxOutline,
} from '@mdi/js';
import { notify } from '@/notiwind';
import NotificationBar from '@/Components/NotificationBar.vue';
const props = defineProps({
errors: {
@ -557,6 +564,11 @@ const props = defineProps({
});
const flash: ComputedRef<any> = computed(() => {
// let test = usePage();
// console.log(test);
return usePage().props.flash;
});
// const projects = reactive([]);
@ -639,11 +651,17 @@ const submit = async (): Promise<void> => {
form.licenses = form.licenses.map((obj) => obj.id.toString());
}
// const files = form.files.map((obj) => {
// return new File([obj.blob], obj.label, { type: obj.type, lastModified: obj.lastModified });
// });
const [fileUploads, fileInputs] = form.files?.reduce(
([fileUploads, fileInputs], obj) => {
if (!obj.id) {
// return MultipartFile for file upload
fileUploads[obj.sort_order] = new File([obj.blob], obj.label, { type: obj.type, lastModified: obj.lastModified });
let file = new File([obj.blob], `${obj.label}?sortOrder=${obj.sort_order}`, { type: obj.type, lastModified: obj.lastModified });
// fileUploads[obj.sort_order] = file;
fileUploads.push(file);
} else {
// return normal request input
fileInputs.push(obj);
@ -723,7 +741,7 @@ const onAddContributor = (person) => {
};
const addKeyword = () => {
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled' };
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled', dataset_count: 0 };
//this.dataset.files.push(uploadedFiles[i]);
form.subjects.push(newSubject);
};
@ -743,7 +761,7 @@ const onMapInitialized = (newItem) => {
};
</script>
<style>
<style scoped>
.max-w-2xl {
max-width: 2xl;
}

View file

@ -118,7 +118,7 @@ const flash: ComputedRef<any> = computed(() => {
:route-name="stardust.route('dataset.release', [dataset.id])" color="info"
:icon="mdiLockOpen" :label="'Release'" small />
<!-- && (dataset.server_state === 'inprogress' || dataset.server_state === 'rejected_editor')" -->
<BaseButton v-if="can.edit" :route-name="stardust.route('dataset.edit', [dataset.id])"
<BaseButton :route-name="stardust.route('dataset.edit', [dataset.id])"
color="info" :icon="mdiSquareEditOutline" :label="'Edit'" small />
<!-- @click="destroy(dataset.id)" -->
<BaseButton v-if="can.delete" color="danger"

View file

@ -215,8 +215,8 @@ class EditComponent extends Vue {
}
}
public addKeyword() {
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled' };
public addKeyword() {
let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled', dataset_count: 0 };
//this.dataset.files.push(uploadedFiles[i]);
this.form.subjects.push(newSubject);
}