feat: Enhance Dataset Edit Page with Unsaved Changes Indicator and Improved Structure
Some checks failed
build.yaml / feat: Enhance Dataset Edit Page with Unsaved Changes Indicator and Improved Structure (push) Failing after 0s

- Added a progress indicator for unsaved changes at the top of the dataset edit page.
- Enhanced the title section with a dataset status badge and improved layout.
- Introduced collapsible sections for better organization of form fields.
- Improved notifications for success/error messages.
- Refactored form fields into distinct sections: Basic Information, Licenses, Titles, Descriptions, Creators & Contributors, Additional Metadata, Geographic Coverage, and Files.
- Enhanced loading spinner with a more visually appealing overlay.
- Added new project validation logic in the backend with create and update validators.
This commit is contained in:
Kaimbacher 2025-10-29 11:20:27 +01:00
commit 3d8f2354cb
9 changed files with 863 additions and 625 deletions

View file

@ -1,6 +1,7 @@
// app/controllers/projects_controller.ts
import Project from '#models/project';
import type { HttpContext } from '@adonisjs/core/http';
import { createProjectValidator, updateProjectValidator } from '#validators/project';
export default class ProjectsController {
// GET /settings/projects
@ -23,7 +24,8 @@ export default class ProjectsController {
// POST /settings/projects
public async store({ request, response, session }: HttpContext) {
const data = request.only(['label', 'name', 'description']);
// Validate the request data
const data = await request.validateUsing(createProjectValidator);
await Project.create(data);
@ -40,7 +42,9 @@ export default class ProjectsController {
// PUT /settings/projects/:id
public async update({ params, request, response, session }: HttpContext) {
const project = await Project.findOrFail(params.id);
const data = request.only(['label', 'name', 'description']);
// Validate the request data
const data = await request.validateUsing(updateProjectValidator);
await project.merge(data).save();