AI Implementation feature(883): Admin Area General Settings and Categories 1.01 #23

Merged
m0rph3us1987 merged 2 commits from feature-883-1784722870941 into dev 2026-07-22 12:32:00 +00:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit 5470623197 - Show all commits
+2 -1
View File
@@ -41,7 +41,8 @@ removes the row.
`PUT /settings` is validated by `GeneralSettingsSchema` (zod):
* `pageTitle` 1120 chars
* `pageTitle` is trimmed server-side and must be 1120 chars after
trimming (whitespace-only values are rejected).
* `logo` up to 2048 chars (a public URL — uploaded separately)
* `welcomeMarkdown` up to 64 000 chars
* `themeKey` is one of `THEME_IDS`
+8 -2
View File
@@ -38,7 +38,7 @@ The page is a single reactive form with these controls (every
| Label | `data-testid` | Backend field | Notes |
|------------------------|---------------------------|-------------------------|-------|
| Page title | `general-pageTitle` | `pageTitle` | Required, max 120 chars. |
| Page title | `general-pageTitle` | `pageTitle` | Required, non-blank, max 120 chars; trimmed server-side. |
| Logo (file picker) | `general-logo-file` | `logo` (public URL) | Uploads via `POST /api/v1/uploads/logo`; the returned `publicUrl` is bound to a hidden input `general-logo`. |
| Logo upload status | `general-logo-uploading` / `general-logo-error` / `general-logo-current` | — | Inline status text under the file picker. |
| Global theme | `general-themeKey` | `themeKey` | `<select>` populated from `/themes`. Value is one of `THEME_IDS`. |
@@ -75,7 +75,13 @@ The page is a single reactive form with these controls (every
`general-endBeforeStart` appears under the end input. Save remains
disabled.
* **Save:** clicking Save sends `PUT /api/v1/admin/general/settings`
with all fields. On success the form is patched with the response,
with all fields. The Page title input is validated client-side for
non-blank content; an empty or whitespace-only Page title disables the
Save button and renders `general-pageTitle-error` so the request is
never issued. The server trims surrounding whitespace and re-validates
against the same 1120 character rule, so invalid payloads return
`400 VALIDATION_FAILED` and the stored Page title is unchanged.
On success the form is patched with the response,
`general-save-ok` renders briefly, and the backend emits an SSE
`general` event via `SseHubService` so other tabs refresh their theme.
* **Error states:** load failures render `general-error`; save failures