Skip to content

Overview, entity sets, External entities and Authsources in Storybook - #164

Merged
sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/148
Nov 25, 2026
Merged

sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/148

Conversation

@sgomez

@sgomez sgomez commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Closes #148. Part of #135.

Summary

Overview, the Identity providers and Hosted IdP lists, External entities with an entity's detail, and Authsources with Add authsource, as pages over domain slices with ports. They are Storybook-only: not routed and no HTTP adapter. Each slice has a port and a memory adapter with the board's fixtures, so wiring the API later means adding an app/http/<slice>.ts and a route.

frontend/src/
├── domain/
│   ├── entities/     the list generalised by set: sets.ts (SET_WORDS), listRoute/newRoute, editPath(id, set),
│   │                 useEntityList(set), Pager/Listing/row worded per set; Listing takes `elsewhere`
│   │                 ("Search External entities"); RowNote and notesOf take any labelled row;
│   │                 useDeleteEntity takes an optional `remove` (used by authsources)
│   ├── overrides/    + External entities: external.ts (types, paths), useExternalList (set, q, source/page
│   │                 in the URL; ticks per source), ExternalList/ExternalSource, useExternalEntity,
│   │                 ExternalDetail + ManagedCopyBar; OverridesPort gains external() and externalEntity()
│   ├── overview/     new slice: OverviewPort, attention.ts (wording and target of each line), OverviewView
│   └── authsources/  new slice: AuthsourcesPort, AuthsourceRows (managed, then From authsources.php), AddAuthsource
├── design-system/    + FileButton (React Aria FileTrigger); Row `pick` (a checkbox beside the row's link,
│                     not inside it); Check `hideLabel`, `disabled`
├── pages/            EntityListPage({ set }) replaces ServiceProvidersPage; OverviewPage, ExternalPage,
│                     ExternalEntityPage, AuthsourcesPage, AddAuthsourcePage (+ stories, jsdom tests)
└── app/
    ├── adapters/memory/  overview, authsources, external (sources), idps; overrides extended
    └── test/StoryScreens + storyRoutes: every sidebar entry now opens its page in Storybook

frontend/lint/layers.js: new slices overview: [session, entities, publication, nodes, overrides] and authsources: [session, entities]. The production list route renders <EntityListPage set="saml20-sp-remote" />. HttpEntities is unchanged: a set's list gets its own EntitiesPort instance, provided per route.

Stories (all screenshot):

  • Pages/Overview: First run, Clear, Draft: Needs attention, Draft: Nothing published
  • Pages/Identity providers: Draft: List, Draft: No match, Draft: Hosted IdP, Draft: No hosted IdP
  • Pages/External entities: Board (three ticked by its play function), Draft: Nothing ticked, Draft: All of a source ticked, Draft: Unreadable source, Draft: No match, Draft: Identity providers
  • Pages/External entity: Board, Draft: Several copies
  • Pages/Authsources: Board, Draft: Row labels, Draft: None managed
  • Pages/Add authsource: Board (Start empty), Draft: Paste, Draft: Upload
  • Design system/File button, Design system/Check (Hidden label, Disabled), Design system/Card (Rows with a checkbox)

Evidence

  • I compared the stories with the boards in light and dark, at 1440 and 400 px. Layout, wording and spacing match except for the differences listed below.
  • npm test: 622 passed, lines 99.0 %. npm run test:visual: three runs of 448 with zero diffs; 88 references are new and 4 changed (see below). Lint, type check and composer size are clean. composer test: 607 passed. composer static is ok. composer build is committed with no further diff. No PHP changed.

Board differences

  • Overview, first run. I left out the board's sentence "Entities and authsources you add here are checked, versioned and published to every node.", following the clean-interface rule as the Publish intro (B1) did. The buttons follow the board: "Add a service provider" and "Import existing entities". SPEC 10.7 asks for the Add action of each set plus "Add authsource". Needs a ruling.
  • Overview, clear. SPEC 10.7 also asks for the count of managed entities per set and of authsources. The board doesn't show them, so they aren't shown. The port carries them anyway, to tell the first run apart.
  • External entities, set select. It offers Service providers and Identity providers, as the board does. SPEC 9.1 reads all three managed sets.
  • External entities, rows with a checkbox. On the board the checkbox sits inside the row's <a>, which is invalid nesting and fails axe. Here the checkbox sits beside the link (Row pick), and only the link part of the row opens the entity. At 400 px the checkbox wraps onto its own line, as on the board.
  • External entities, board ticks. The board shows three rows ticked. SPEC says nothing is ticked at first, so the Board story ticks them in its play function.
  • External entities, "Import N". It is shown as on the board, but it does nothing yet: the confirmation step and ImportResult are not part of this issue.
  • External entities, the source "File". The board lists 2 rows under the count "12". The fixture holds 12, so all 12 show. A source's pager shows only when it has more than one page; the board's File section has none.
  • External entity, several copies (Draft). Each copy has its source line, the PHP and Copy, and the served copy is marked "Served". The board's bar offers "Create managed copy" for the served copy only. SPEC 9.2 says every copy offers it.
  • Add authsource. Paste is the default tab, as on AddEntity. The AddAuthsource board shows Start empty selected, which the Board story reproduces. "Review" stays disabled because reading pasted configuration and the editor it opens are not built. The type rows link to /authsources/new?type=…, the hand-off to the editor of a new authsource. SPEC 10.4 gives no route for it. There is no "Detected" select, because PHP array is the only format for an authsource.
  • Service providers, no match. The list now shows "Search External entities" next to "Clear search", as the SpEmpty board does, wherever the session serves External entities. That covers Storybook only. This changes the 4 service-providers-page-no-match-* references.
  • Header at 400 px. "Review 7 changes" shows as "7", as everywhere since Shell, sidebar and navigation as the boards show them #141.

Departures (states without a board, Draft:)

  • Identity providers and Hosted IdP: the SP list's components, with the set's wording ("Add identity provider", "1 to 6 of 6 identity providers", "No hosted IdPs yet"). No board shows these lists.
  • Needs attention lines: "7 changes to publish" leads to Publish. "idp-2 is 2 Snapshots behind", "idp-3 has not checked in for 12 min" and "idp-1 has problems" lead to Nodes. "Moodle: certificate expires in 12 days" (or "has expired", in red) leads to the edit screen. "Library catalogue: external source changed" / "not reviewed" leads to the Override comparison. "console:Snapshot is not in metadata.sources: Override and Shadowed labels mean nothing here" leads to Nodes.
  • The Snapshot's comment shows under "Published …". Before the first Publication the Live card reads "Nothing published yet".
  • An unreadable source shows its heading and location, then an error callout "Source unreadable" with the error in monospace.
  • "No external entity matches “zoom”" offers Clear search. "No External identity providers" appears when a set has none.
  • Authsource rows carry the labels of the entity list. An Unreadable one carries "Delete…", which uses the entity delete dialog with the authsource's port. "No authsources yet" appears above the file's authsources.
  • Upload reads a local file into the text area in the browser and returns to Paste.

Merge Danger

Door: two-way

Blast Radius: small

In production only the service provider list changes, and only in code: it renders through EntityListPage, and "Search External entities" stays hidden because the session does not serve External entities. Shared files touched: domain/entities (routes, list, pager, row, notes, delete hook; signatures widened with defaults where the edit screen calls them), Row, Check, console.css (one appended block and two selectors widened) and StoryScreens. This PR adds 88 reference screenshots and changes 4, so it waits for the maintainer's visual-change label.

@sgomez
sgomez merged commit bda85b6 into frontend-rebuild Nov 25, 2026
16 checks passed
@sgomez
sgomez deleted the agent/frontend/148 branch November 25, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant