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
|
|
@ -1,6 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { mdiFolderPlus, mdiArrowLeftBoldOutline, mdiFormTextarea, mdiContentSave } from '@mdi/js';
|
||||
import {
|
||||
mdiFolderPlus,
|
||||
mdiArrowLeftBoldOutline,
|
||||
mdiFormTextarea,
|
||||
mdiContentSave,
|
||||
mdiTagOutline,
|
||||
mdiText,
|
||||
} from '@mdi/js';
|
||||
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
|
||||
import SectionMain from '@/Components/SectionMain.vue';
|
||||
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
|
||||
|
|
@ -37,46 +44,48 @@ const submit = async () => {
|
|||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
|
||||
<CardBox form @submit.prevent="submit()" class="shadow-lg">
|
||||
<div class="grid grid-cols-1 gap-6">
|
||||
<FormField label="Label" help="Lowercase letters, numbers, and hyphens only" :class="{ 'text-red-400': form.errors.label }">
|
||||
<CardBox form @submit.prevent="submit()" class="relative overflow-hidden shadow-lg">
|
||||
<!-- Subtle accent bar -->
|
||||
<div class="absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-blue-500 via-indigo-500 to-blue-500"></div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-7 pt-2">
|
||||
<!-- Label -->
|
||||
<FormField
|
||||
label="Label"
|
||||
help="Lowercase letters, numbers, and hyphens only"
|
||||
:errors="form.errors.label"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.label"
|
||||
v-model="form.label"
|
||||
:icon="mdiTagOutline"
|
||||
type="text"
|
||||
placeholder="e.g., my-awesome-project"
|
||||
placeholder="e.g., my-awesome-project"
|
||||
required
|
||||
:error="form.errors.label"
|
||||
class="transition-all focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<div class="text-red-400 text-sm mt-1" v-if="form.errors.label">
|
||||
{{ form.errors.label }}
|
||||
</div>
|
||||
</FormControl>
|
||||
class="font-mono transition-all duration-200 focus-within:ring-2 focus-within:ring-blue-500/40"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<!-- Name -->
|
||||
<FormField
|
||||
label="Name"
|
||||
help="Required. Project title shown to users"
|
||||
:class="{ 'text-red-400': form.errors.name }"
|
||||
:errors="form.errors.name"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.name"
|
||||
:icon="mdiText"
|
||||
type="text"
|
||||
placeholder="Enter a descriptive titel..."
|
||||
placeholder="Enter a descriptive title..."
|
||||
required
|
||||
:error="form.errors.name"
|
||||
class="font-mono transition-all focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<div class="text-red-400 text-sm mt-1" v-if="form.errors.name">
|
||||
{{ form.errors.name }}
|
||||
</div>
|
||||
</FormControl>
|
||||
class="transition-all duration-200 focus-within:ring-2 focus-within:ring-blue-500/40"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<!-- Description -->
|
||||
<FormField
|
||||
label="Description"
|
||||
help="Optional. Detailed description of the project"
|
||||
:class="{ 'text-red-400': form.errors.description }"
|
||||
:errors="form.errors.description"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.description"
|
||||
|
|
@ -84,19 +93,19 @@ const submit = async () => {
|
|||
name="description"
|
||||
type="textarea"
|
||||
placeholder="Describe what this project is about..."
|
||||
:error="form.errors.description"
|
||||
class="transition-all focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<div class="text-red-400 text-sm mt-1" v-if="form.errors.description">
|
||||
{{ form.errors.description }}
|
||||
</div>
|
||||
</FormControl>
|
||||
class="transition-all duration-200 focus-within:ring-2 focus-within:ring-blue-500/40"
|
||||
/>
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<BaseButtons class="justify-between">
|
||||
<BaseButton :route-name="stardust.route('settings.project.index')" label="Cancel" color="white" outline />
|
||||
<BaseButton
|
||||
:route-name="stardust.route('settings.project.index')"
|
||||
label="Cancel"
|
||||
color="white"
|
||||
outline
|
||||
/>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
color="info"
|
||||
|
|
@ -104,7 +113,7 @@ const submit = async () => {
|
|||
label="Create Project"
|
||||
:class="{ 'opacity-25': form.processing }"
|
||||
:disabled="form.processing"
|
||||
class="transition-all hover:shadow-lg"
|
||||
class="transition-all hover:shadow-lg hover:-translate-y-0.5"
|
||||
/>
|
||||
</BaseButtons>
|
||||
</template>
|
||||
|
|
@ -116,15 +125,17 @@ const submit = async () => {
|
|||
>
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="flex-shrink-0">
|
||||
<div class="w-10 h-10 rounded-full bg-blue-500 dark:bg-blue-600 flex items-center justify-center">
|
||||
<div
|
||||
class="w-10 h-10 rounded-full bg-blue-500 dark:bg-blue-600 flex items-center justify-center shadow-md shadow-blue-500/30"
|
||||
>
|
||||
<span class="text-white text-lg">💡</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-2">Quick Tips</h3>
|
||||
<ul class="text-sm text-gray-700 dark:text-gray-300 space-y-1">
|
||||
<li>• <strong>Label</strong> is a technical identifier (use lowercase and hyphens) </li>
|
||||
<li>• <strong>Name</strong> is what users will see in the interface - short title</li>
|
||||
<li>• <strong>Label</strong> is a technical identifier (use lowercase and hyphens)</li>
|
||||
<li>• <strong>Name</strong> is what users will see in the interface — short title</li>
|
||||
<li>• <strong>Description</strong> helps team members understand the project's purpose</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -132,4 +143,4 @@ const submit = async () => {
|
|||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
||||
</template>
|
||||
|
|
@ -1,6 +1,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { mdiFolderEdit, mdiArrowLeftBoldOutline, mdiFormTextarea, mdiContentSave } from '@mdi/js';
|
||||
import {
|
||||
mdiFolderEdit,
|
||||
mdiArrowLeftBoldOutline,
|
||||
mdiFormTextarea,
|
||||
mdiContentSave,
|
||||
mdiTagOutline,
|
||||
mdiText,
|
||||
} from '@mdi/js';
|
||||
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
|
||||
import SectionMain from '@/Components/SectionMain.vue';
|
||||
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
|
||||
|
|
@ -43,45 +50,40 @@ const submit = async () => {
|
|||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
|
||||
<CardBox form @submit.prevent="submit()" class="shadow-lg">
|
||||
<div class="grid grid-cols-1 gap-6">
|
||||
<FormField
|
||||
label="Label"
|
||||
help="Lowercase letters, numbers, and hyphens only"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.label"
|
||||
type="text"
|
||||
help="Lowercase letters, numbers, and hyphens only"
|
||||
:is-read-only=true
|
||||
class="bg-gray-100 dark:bg-slate-800 cursor-not-allowed opacity-75"
|
||||
|
||||
<CardBox form @submit.prevent="submit()" class="relative overflow-hidden shadow-lg">
|
||||
<!-- Subtle accent bar -->
|
||||
<div class="absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-blue-500 via-indigo-500 to-blue-500"></div>
|
||||
|
||||
<div class="grid grid-cols-1 gap-7 pt-2">
|
||||
<!-- Label (read-only) -->
|
||||
<FormField label="Label" help="Lowercase letters, numbers, and hyphens only">
|
||||
<FormControl
|
||||
v-model="form.label"
|
||||
:icon="mdiTagOutline"
|
||||
type="text"
|
||||
:is-read-only="true"
|
||||
class="font-mono bg-gray-100 dark:bg-slate-800 cursor-not-allowed opacity-75"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField
|
||||
label="Name"
|
||||
help="Required. Project title shown to users"
|
||||
:class="{ 'text-red-400': form.errors.name }"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
required
|
||||
:error="form.errors.name"
|
||||
class="font-mono transition-all focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<div class="text-red-400 text-sm mt-1" v-if="form.errors.name">
|
||||
{{ form.errors.name }}
|
||||
</div>
|
||||
</FormControl>
|
||||
<!-- Name -->
|
||||
<FormField label="Name" help="Required. Project title shown to users" :errors="form.errors.name">
|
||||
<FormControl
|
||||
v-model="form.name"
|
||||
:icon="mdiText"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
required
|
||||
class="transition-all duration-200 focus-within:ring-2 focus-within:ring-blue-500/40"
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<!-- Description -->
|
||||
<FormField
|
||||
label="Description"
|
||||
help="Optional. Detailed description of the project"
|
||||
:class="{ 'text-red-400': form.errors.description }"
|
||||
:errors="form.errors.description"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.description"
|
||||
|
|
@ -89,13 +91,8 @@ const submit = async () => {
|
|||
name="description"
|
||||
type="textarea"
|
||||
placeholder="Enter project description..."
|
||||
:error="form.errors.description"
|
||||
class="transition-all focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<div class="text-red-400 text-sm mt-1" v-if="form.errors.description">
|
||||
{{ form.errors.description }}
|
||||
</div>
|
||||
</FormControl>
|
||||
class="transition-all duration-200 focus-within:ring-2 focus-within:ring-blue-500/40"
|
||||
/>
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
|
|
@ -114,17 +111,19 @@ const submit = async () => {
|
|||
label="Save Changes"
|
||||
:class="{ 'opacity-25': form.processing }"
|
||||
:disabled="form.processing"
|
||||
class="transition-all hover:shadow-lg"
|
||||
class="transition-all hover:shadow-lg hover:-translate-y-0.5"
|
||||
/>
|
||||
</BaseButtons>
|
||||
</template>
|
||||
</CardBox>
|
||||
|
||||
<!-- Project Info Card -->
|
||||
<CardBox class="mt-6 bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-800 dark:to-slate-900">
|
||||
<CardBox class="mt-6 bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-800 dark:to-slate-900 border-l-4 border-blue-500">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="flex-shrink-0">
|
||||
<div class="w-12 h-12 rounded-lg bg-blue-500 dark:bg-blue-600 flex items-center justify-center">
|
||||
<div
|
||||
class="w-12 h-12 rounded-lg bg-blue-500 dark:bg-blue-600 flex items-center justify-center shadow-md shadow-blue-500/30"
|
||||
>
|
||||
<span class="text-white text-xl font-bold">
|
||||
{{ project.label.charAt(0).toUpperCase() }}
|
||||
</span>
|
||||
|
|
@ -139,11 +138,11 @@ const submit = async () => {
|
|||
</p>
|
||||
<div class="flex items-center gap-4 text-xs text-gray-500 dark:text-gray-500">
|
||||
<span>
|
||||
<span class="font-medium">Created:</span>
|
||||
<span class="font-medium">Created:</span>
|
||||
{{ new Date(project.created_at).toLocaleDateString() }}
|
||||
</span>
|
||||
<span>
|
||||
<span class="font-medium">Updated:</span>
|
||||
<span class="font-medium">Updated:</span>
|
||||
{{ new Date(project.updated_at).toLocaleDateString() }}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue