Files

3.5 KiB

Functional Design: admin screens (unit H5)

New navigation item "Hero" (visible when /api/v1/System/capabilities lists the Hero module; for the Administrator role and higher). Follows the existing admin conventions (React Query, nl and en translation files, the Offerings feature as the pattern). Admin texts live in the frontend translation files.

Screen: Hero

[Hero]                                           [Live | Niet live  van .. tot ..]
-------------------------------------------------------------------------------
Tekst        Titel (meerdere regels)      Tagline         Lead
Weergave     ( ) Enkel  ( ) Diavoorstelling
Knoppen      Knop 1: label + doel         Knop 2: label + doel     (0 tot 2)
Planning     Aan/uit   Van ...   Tot ...
-------------------------------------------------------------------------------
Slides       [+ Afbeelding toevoegen]
             #1 [thumb]  alt-tekst / decoratief   aan/uit   omhoog omlaag   [Focus] [Verwijder]
             #2 ...
-------------------------------------------------------------------------------
                                                     [Opslaan]
  • Badge (Bryan, Q5): "Live" or "Niet live" with the schedule dates; no reason text. It reflects the public rules (active, within the schedule, a title, at least one usable slide) as computed by the server (GET /hero/all returns isLive).
  • Form validates on the server; messages come back per field and are shown at the field. A button target hint shows the three accepted forms. A slide without alt text and not marked decorative blocks saving, with the message at that slide.
  • Slides are listed in order; reorder with up and down buttons (keyboard accessible); on/off per slide; the number is not limited in the screen (a notice appears above the safety ceiling).
  • Upload: a file picker and a drop area; shows the accepted formats (from the server's capability list) and the 10 MB limit; progress; the server message on rejection (unsupported_format, too_large, corrupt, too_many_pixels, busy, unavailable).
  • Delete of an image or slide: a confirmation; the server refuses an image still in use (409) and the screen shows the message.

Dialog: Focus

  • The image with a draggable focus point (keyboard: arrow keys move by 1%, with shift by 5%), a zoom slider (1 to 4), the numeric values, and two live previews: wide (3:2) and tall (4:5), each cut exactly as the host will cut (shared maths, TypeScript twin of FocusMath with the same test vectors).
  • Tabs or toggles: "Algemeen punt" (default centre) and optional "Alleen wide" / "Alleen tall" overrides; a "Gebruik algemeen punt" reset per ratio.
  • Save sends PUT /api/v1/hero/images/{id}/focus; the previews update from the response variants.

States

Loading, empty (no hero yet: an empty form with the button "Opslaan"), saving, error (server messages), saved. Unsaved-changes warning when leaving the screen.

API used

GET /api/v1/hero/all, PUT /api/v1/hero, POST /api/v1/hero/images (multipart), PUT /api/v1/hero/images/{id}/focus, DELETE /api/v1/hero/images/{id}, GET /api/v1/System/capabilities.

Accessibility and tests

Labels and descriptions on all fields, focus management in the dialog, keyboard operation of reorder and focus point, aria-live for save and upload results. Tests: component tests (form validation display, slide reorder, upload errors, badge), the focusMath vectors shared with the C# tests, and an interaction test for the focus dialog.