Admin: Berichten-scherm met formulierschakelaar, lijst, detail en opnieuw mailen (CMS-U6)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 22:42:33 +01:00
co-authored by Claude Sonnet 5.5
parent 0d729b6413
commit fd13647139
22 changed files with 1675 additions and 10 deletions
@@ -17,12 +17,12 @@ Phase 2, frontend only (`frontend/src/features/contact`, `router.tsx`, `Sidebar.
7. All user-facing texts Dutch with English counterparts (`contact.*`); errors and 4xx/5xx mapped to translated messages, never the API's English titles. Accessibility: switch with accessible name and state, focus management in dialogs, status icons with text alternatives.
## Steps
- [ ] **Step 1 — Types, services and msw mocks** (settings get/put incl. 404 = unavailable, messages list/detail/patch/delete/resend with the real status codes and shapes).
- [ ] **Step 2 — Components**: `FormSwitchCard`, `MessagesFilterChips`, `MessagesTable` + pager, `MessageDialog`, `DeleteMessageDialog`.
- [ ] **Step 3 — Page, route, sidebar entry, guards, translations (nl/en)**.
- [ ] **Step 4 — Tests (Vitest + Testing Library + msw)**: sidebar entry visible/hidden (module missing, 404 on settings, role); direct route when unavailable; switch card off→on→off with server response, error path, first-time hint; list default shows no spam, each chip sends the right query, counter from `unreadCount`, paging; detail opens, marks unread as read, line breaks preserved, status change, un-spam moves the row, delete confirm/cancel, resend (`mailed` true/false, 409, 429 with seconds, email disabled), empty states, translated error codes; no raw API titles shown.
- [ ] **Step 5 — Verification (automatic)**: `pnpm lint`, `npx tsc -b`, full `pnpm test`; new files formatted with prettier (the 15 old prettier warnings in offerings stay); real output reported.
- [ ] **Step 6 — Docs/commit**: summary; one commit; no push.
- [x] **Step 1 — Types, services and msw mocks** (settings get/put incl. 404 = unavailable, messages list/detail/patch/delete/resend with the real status codes and shapes).
- [x] **Step 2 — Components**: `FormSwitchCard`, `MessagesFilterChips`, `MessagesTable` + pager, `MessageDialog`, `DeleteMessageDialog`.
- [x] **Step 3 — Page, route, sidebar entry, guards, translations (nl/en)**.
- [x] **Step 4 — Tests (Vitest + Testing Library + msw)**: sidebar entry visible/hidden (module missing, 404 on settings, role); direct route when unavailable; switch card off→on→off with server response, error path, first-time hint; list default shows no spam, each chip sends the right query, counter from `unreadCount`, paging; detail opens, marks unread as read, line breaks preserved, status change, un-spam moves the row, delete confirm/cancel, resend (`mailed` true/false, 409, 429 with seconds, email disabled), empty states, translated error codes; no raw API titles shown.
- [x] **Step 5 — Verification (automatic)**: `pnpm lint`, `npx tsc -b`, full `pnpm test`; new files formatted with prettier (the 15 old prettier warnings in offerings stay); real output reported.
- [x] **Step 6 — Docs/commit**: summary; one commit; no push.
## Explicitly NOT touched
Backend, auth/refresh, users, theme assets, existing features except the one entry in `Sidebar.tsx` and the route in `router.tsx`, shared UI primitives (used, not edited; a switch is built from the existing button/checkbox primitives unless a primitive is missing, then added as a new file).