Squashed commit of the following:
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 40s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 40s
commit 579f0878e5240dc17db69be1e0b0c0f5af7ef9fe
Author: Arno Kaimbacher <arno.kaimbacher@geosphere.at>
Date: Tue Jun 9 09:25:44 2026 +0200
feat: Refactor error handling in Dataset Edit form and improve validation messages
- Updated error handling in the Dataset Edit form to use a centralized formatError function for displaying validation messages.
- Enhanced user feedback by ensuring that error messages are displayed consistently across various fields.
- Modified the validation rule for arrayContainsTypes to provide clearer error messages for missing main and translated titles/abstracts.
- Introduced a new ValidationService to manage manual construction of validation errors.
- Updated Vite configuration to streamline asset loading and improve performance.
- Adjusted Inertia setup to utilize dynamic imports for page-specific assets.
- Cleaned up unnecessary comments and code in various files for better readability.
commit 5efddc2a58c0e164fef585cc7344c06155dbc2c1
Author: Arno Kaimbacher <arno.kaimbacher@geosphere.at>
Date: Mon Jan 12 17:02:47 2026 +0100
feat: add dataset change detection and form submission composables
- Implemented `useDatasetChangeDetection` for tracking unsaved changes in dataset forms, including comparisons for licenses, basic properties, files, coverage, and more.
- Added `useDatasetFormSubmission` for handling dataset form submissions with validation, success/error handling, and auto-save functionality.
This commit is contained in:
parent
0680879e2f
commit
9368a0dd8d
38 changed files with 5588 additions and 6181 deletions
|
|
@ -27,9 +27,20 @@ const form = useForm({
|
|||
permissions: [],
|
||||
});
|
||||
|
||||
const submit = async () => {
|
||||
await form.post(stardust.route('settings.role.store'));
|
||||
const submit = () => {
|
||||
form.post(stardust.route('settings.role.store'), {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => form.reset(),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Sicherer Helper für die Fehleranzeige
|
||||
*/
|
||||
// const formatError = (error: string | string[] | undefined) => {
|
||||
// if (!error) return '';
|
||||
// return Array.isArray(error) ? error.join(', ') : error;
|
||||
// };
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -46,58 +57,48 @@ const submit = async () => {
|
|||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
<!-- <CardBox form @submit.prevent="form.post(stardust.route('role.store'))"> -->
|
||||
<CardBox form @submit.prevent="submit()">
|
||||
<FormField label="Name" help="Required. Role name" :class="{ 'text-red-400': form.errors.name }">
|
||||
<FormControl v-model="form.name" type="text" placeholder="Enter Name" required :error="form.errors.name">
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.name">
|
||||
{{ form.errors.name }}
|
||||
</div>
|
||||
|
||||
<CardBox form @submit.prevent="submit">
|
||||
<FormField label="Name" help="Required. Technical role name" :errors="form.errors.name">
|
||||
<FormControl v-model="form.name" type="text" placeholder="e.g. manager" :error="form.errors.name"> </FormControl>
|
||||
</FormField>
|
||||
|
||||
<FormField label="Display Name" help="Optional. Readable name" :errors="form.errors.display_name">
|
||||
<FormControl v-model="form.display_name" placeholder="e.g. Project Manager" :error="form.errors.display_name">
|
||||
</FormControl>
|
||||
</FormField>
|
||||
|
||||
<FormField label="Display Name" help="Optional. Display name" :class="{ 'text-red-400': form.errors.display_name }">
|
||||
<FormControl v-model="form.display_name" name="display_name" :error="form.errors.display_name">
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.display_name">
|
||||
{{ form.errors.display_name }}
|
||||
</div>
|
||||
</FormControl>
|
||||
</FormField>
|
||||
|
||||
<FormField
|
||||
label="Description"
|
||||
help="Optional. Description of new role"
|
||||
:class="{ 'text-red-400': form.errors.description }"
|
||||
>
|
||||
<FormField label="Description" help="Optional. What does this role do?" :errors="form.errors.description">
|
||||
<FormControl
|
||||
v-model="form.description"
|
||||
v-bind:icon="mdiFormTextarea"
|
||||
name="display_name"
|
||||
:type="'textarea'"
|
||||
:icon="mdiFormTextarea"
|
||||
type="textarea"
|
||||
placeholder="Role description..."
|
||||
:error="form.errors.description"
|
||||
>
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.description">
|
||||
{{ form.errors.description }}
|
||||
</div>
|
||||
</FormControl>
|
||||
</FormField>
|
||||
|
||||
<BaseDivider />
|
||||
|
||||
<FormField label="Permissions" wrap-body>
|
||||
<FormField
|
||||
label="Permissions"
|
||||
wrap-body
|
||||
:class="{ 'text-red-400': form.errors.permissions }"
|
||||
:errors="form.errors.permissions"
|
||||
>
|
||||
<FormCheckRadioGroup v-model="form.permissions" name="permissions" is-column :options="props.permissions" />
|
||||
<!-- <div class="text-red-400 text-sm mt-1" v-if="form.errors.permissions">
|
||||
{{ formatError(form.errors.permissions) }}
|
||||
</div> -->
|
||||
</FormField>
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.permissions && Array.isArray(form.errors.permissions)">
|
||||
<!-- {{ errors.password_confirmation }} -->
|
||||
{{ form.errors.permissions.join(', ') }}
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<BaseButtons>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
color="info"
|
||||
label="Submit"
|
||||
label="Create Role"
|
||||
:class="{ 'opacity-25': form.processing }"
|
||||
:disabled="form.processing"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue