2.8 KiB
2.8 KiB
Business Rules — Unit 3: frontend-cms-page
Table Display (Q1: B+C)
- BR-FE-01: The
CmsInstanceListtable displays six columns: Name, URL, Status, Last Contact, DisableMessage, Actions. - BR-FE-02:
lastContactedAtis formatted as a localised date/time string; displays "—" whennull. - BR-FE-03:
disableMessagedisplays "—" whennullor empty.
Inactive Row Styling (Q2: A)
- BR-FE-04: A
<TableRow>whoseinstance.status === 'Inactive'receivesclassName="opacity-50". All cells within that row are visually dimmed as a result.
Status Badge Colors
- BR-FE-05:
Available→ green badge (secondaryor custom green variant). - BR-FE-06:
NotAvailable→ red badge (destructivevariant). - BR-FE-07:
Inactive→ muted badge (outlinevariant).
SetStatusDialog — DisableMessage (Q3 note, existing unit-of-work)
- BR-FE-08: The DisableMessage field is only rendered when the selected status is
NotAvailable. - BR-FE-09: DisableMessage is required (non-empty) when status is
NotAvailable. Form submit is blocked if it is empty. - BR-FE-10: When status changes away from
NotAvailable, the DisableMessage field is hidden and its value is reset to"". - BR-FE-11: The value sent to the API is
nullfor all statuses exceptNotAvailable; forNotAvailableit is the trimmed string value.
UpdateStatusResult Toast (Q3: B, "cliënt" terminology)
- BR-FE-12: On HTTP 200 with
slaveContactSuccess === true: show toast "Status updated — cliënt confirmed". - BR-FE-13: On HTTP 200 with
slaveContactSuccess === false: show toast "Status saved — cliënt unreachable". - BR-FE-14: The word "slave" must not appear in any user-visible text. Use "cliënt" in all UI strings.
AddCmsInstanceDialog Error Handling (Q4: A)
- BR-FE-15: On HTTP 400 from
POST /api/v1/CmsInstances: display aFormBannerErrorat the top of the dialog. The dialog remains open. - BR-FE-16: On network error: display a
FormBannerErrorat the top of the dialog. The dialog remains open. - BR-FE-17: On success (HTTP 201): close the dialog and show a success toast.
Empty State (Q5: A)
- BR-FE-18: When
useCmsInstancesreturns an empty array, render a centered placeholder instead of the table. The placeholder contains:- A
LayoutGridicon (consistent with the existingCmsPageplaceholder). - A heading: "No CMS instances yet".
- A description: "Add your first CMS instance to get started."
- An "Add CMS" button that opens
AddCmsInstanceDialog.
- A
- BR-FE-19: The "Add CMS" button in the page header is always visible regardless of empty state.
Access Control
- BR-FE-20: The
/cmsroute is already guarded byRoleGuard allowedRoles={['Owner']}. No additional guard logic is needed insideCmsPage.