diff --git a/messages/de.json b/messages/de.json index f958e2f11..0f7157efd 100644 --- a/messages/de.json +++ b/messages/de.json @@ -1278,7 +1278,8 @@ "group": { "data": "Daten", "reminders": "Erinnerungen", - "lifecycle": "Lebenszyklus" + "lifecycle": "Lebenszyklus", + "externalApi": "Externe API" }, "dataPortability": { "import": { diff --git a/messages/en.json b/messages/en.json index c445fc30d..a178a67c6 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1278,7 +1278,8 @@ "group": { "data": "Data", "reminders": "Reminders", - "lifecycle": "Lifecycle" + "lifecycle": "Lifecycle", + "externalApi": "External API" }, "dataPortability": { "import": { diff --git a/messages/es.json b/messages/es.json index f1e7155ef..d52467ffa 100644 --- a/messages/es.json +++ b/messages/es.json @@ -1278,7 +1278,8 @@ "group": { "data": "Datos", "reminders": "Recordatorios", - "lifecycle": "Ciclo de vida" + "lifecycle": "Ciclo de vida", + "externalApi": "API externa" }, "dataPortability": { "import": { diff --git a/messages/fr.json b/messages/fr.json index 20ff9269a..41e99c492 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -1278,7 +1278,8 @@ "group": { "data": "Données", "reminders": "Rappels", - "lifecycle": "Cycle de vie" + "lifecycle": "Cycle de vie", + "externalApi": "API externe" }, "dataPortability": { "import": { diff --git a/messages/it.json b/messages/it.json index fb830e1ae..bbae9bf67 100644 --- a/messages/it.json +++ b/messages/it.json @@ -1278,7 +1278,8 @@ "group": { "data": "Dati", "reminders": "Promemoria", - "lifecycle": "Ciclo di vita" + "lifecycle": "Ciclo di vita", + "externalApi": "API esterna" }, "dataPortability": { "import": { diff --git a/messages/pl.json b/messages/pl.json index e198df4ae..47ef01bbd 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -1278,7 +1278,8 @@ "group": { "data": "Dane", "reminders": "Przypomnienia", - "lifecycle": "Cykl życia" + "lifecycle": "Cykl życia", + "externalApi": "Zewnętrzne API" }, "dataPortability": { "import": { diff --git a/src/components/medications/__tests__/advanced-settings-sheet.test.tsx b/src/components/medications/__tests__/advanced-settings-sheet.test.tsx index 60931d50b..08d0355ba 100644 --- a/src/components/medications/__tests__/advanced-settings-sheet.test.tsx +++ b/src/components/medications/__tests__/advanced-settings-sheet.test.tsx @@ -1,13 +1,14 @@ /** * v1.7.0 — AdvancedSettingsSheet composition contract. * - * The sheet hosts four blocks — Reminders → Lifecycle → Data → Danger - * zone — composed from bare section bodies. `` - * wraps Radix portals that `renderToStaticMarkup` does not materialise, - * so we mock it to a passthrough that renders children only when `open` - * and echoes `contentWidth`. The bodies are mocked to ordered markers. - * The test pins: - * - the four blocks render in the documented order; + * The sheet hosts five blocks — Reminders → Lifecycle → Data → + * Externe API → Danger zone — composed from bare section bodies. + * `` wraps Radix portals that `renderToStaticMarkup` + * does not materialise, so we mock it to a passthrough that renders + * children only when `open` and echoes `contentWidth`. The bodies are + * mocked to ordered markers. The test pins: + * - the five blocks render in the documented order; + * - the external-API row lives in its own group, not in Data; * - the sheet opens at the `2xl` width token; * - `onRequestPhaseSheet` threads through to the phases row; * - `onOpenImport` wires the import button (co-located with export); @@ -107,7 +108,7 @@ function baseProps( } describe("AdvancedSettingsSheet (v1.7.0)", () => { - it("renders the four blocks in Reminders → Lifecycle → Data → Danger order", () => { + it("renders the five blocks in Reminders → Lifecycle → Data → Externe API → Danger order", () => { const html = renderToStaticMarkup( {} })} @@ -116,11 +117,26 @@ describe("AdvancedSettingsSheet (v1.7.0)", () => { const reminders = html.indexOf("advanced-group-reminders"); const lifecycle = html.indexOf("advanced-group-lifecycle"); const data = html.indexOf("advanced-group-data"); + const externalApi = html.indexOf("advanced-group-external-api"); const danger = html.indexOf("mock-danger"); expect(reminders).toBeGreaterThan(-1); expect(lifecycle).toBeGreaterThan(reminders); expect(data).toBeGreaterThan(lifecycle); - expect(danger).toBeGreaterThan(data); + expect(externalApi).toBeGreaterThan(data); + expect(danger).toBeGreaterThan(externalApi); + }); + + it("homes the external-API row in its own group, not in the Data group", () => { + const html = renderToStaticMarkup( + , + ); + // The API row marker must sit after the external-API group opens, + // not inside the Data group it used to share. + const dataGroup = html.indexOf("advanced-group-data"); + const externalApiGroup = html.indexOf("advanced-group-external-api"); + const apiRow = html.indexOf("mock-api-tokens"); + expect(apiRow).toBeGreaterThan(externalApiGroup); + expect(externalApiGroup).toBeGreaterThan(dataGroup); }); it("opens at the 2xl width token", () => { diff --git a/src/components/medications/advanced-settings-sheet.tsx b/src/components/medications/advanced-settings-sheet.tsx index 7d8974b20..171346be1 100644 --- a/src/components/medications/advanced-settings-sheet.tsx +++ b/src/components/medications/advanced-settings-sheet.tsx @@ -6,15 +6,21 @@ * grid. * v1.8.6 — rebuilt as a single column. The two-column data|reminders * grid read as overloaded; the sheet now narrows to `2xl` (~672px) and - * stacks four bordered section cards in most-used-first order: - * Reminders → Lifecycle → Data → Danger. One spacing rule throughout — - * `space-y-4` between cards, `divide-y` + `py-3` rows inside each card - * (the `` card owns the dividers). + * stacks bordered section cards in most-used-first order. One spacing + * rule throughout — `space-y-4` between cards, `divide-y` + `py-3` rows + * inside each card (the `` card owns the dividers). + * + * v1.9.0 — the Data group split. It had carried both operator data + * portability and the developer-facing external API in one frame; the + * API endpoint now sits in its own `Externe API` group so the two + * audiences no longer share a card. Order: Reminders → Lifecycle → + * Data → Externe API → Danger. * * - Reminders: notifications switch + reminder window (grace). * - Lifecycle: pause/resume + end course + phases. - * - Data: intake Import + medications CSV Export (co-located) + - * external-API endpoint / token. + * - Data: intake Import + medications CSV Export (co-located). + * - Externe API: the per-medication ingest endpoint + token, with the + * request examples collapsed by default. * - Danger zone: purge intake history + delete medication, set off by * its own destructive-tinted card so an irreversible action never * sits next to a routine toggle. @@ -142,7 +148,9 @@ export function AdvancedSettingsSheet({ )} - {/* DATA — import + export + external API */} + {/* DATA — import + export. The external API lives in its own + group below; this group stays scoped to operator data + portability so the two audiences don't share one frame. */} + + + {/* EXTERNAL API — the per-medication ingest endpoint + token. + Pulled out of the Data group into its own frame so the + developer/integration surface reads as a distinct, lowest- + frequency block right before the danger zone. */} +