@abyss-project/commons-front-core 18.1.3 → 18.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +4 -0
- package/catalog/catalog-entries.ts +4 -0
- package/catalog/pages/Callout.tsx +9 -0
- package/catalog/pages/CodeEditor.tsx +52 -0
- package/catalog/pages/DeliveryHistory.tsx +79 -79
- package/catalog/pages/DeliverySubscriptions.tsx +127 -127
- package/catalog/pages/LineChart.tsx +21 -0
- package/catalog/pages/MarkdownEditor.tsx +1 -1
- package/catalog/pages/ScheduledTasks.tsx +117 -117
- package/catalog/pages/SessionErrorScreen.tsx +20 -0
- package/catalog/pages/Toast.tsx +59 -1
- package/catalog/pages/index.ts +4 -0
- package/catalog/playwright.ci.config.ts +2 -2
- package/catalog/specs/captures.spec.ts +145 -145
- package/catalog/specs/global-review-captures.spec.ts +154 -0
- package/catalog/specs/markdown-editor.spec.ts +107 -0
- package/catalog/specs/toast-dialog-foot.spec.ts +83 -0
- package/catalog/specs/write-capture-index.ts +81 -81
- package/dist/{CookieConsentSettings-CLB1Mlv5.js → CookieConsentSettings-D97TY138.js} +53 -53
- package/dist/{Surface-B_wIEB3b.js → Surface-CN1zQYLJ.js} +144 -121
- package/dist/{Tabs-g7OaInVW.js → Tabs-CxD9y18t.js} +235 -229
- package/dist/components/CodeEditor/CodeEditor.component.spec.d.ts +1 -0
- package/dist/components/business/CookieConsent/use-banner-portal.d.ts +0 -17
- package/dist/components/data/LineChart/LineChart.d.ts +21 -2
- package/dist/components/data/LineChart/line-chart-ticks.d.ts +5 -2
- package/dist/components/editors/MarkdownEditor/crepe-styles.d.ts +7 -0
- package/dist/components/editors/MarkdownEditor/crepe-styles.spec.d.ts +1 -0
- package/dist/components/layers/Modal/active-modal.d.ts +14 -0
- package/dist/components/layers/Toast/Toast.d.ts +1 -0
- package/dist/components/layers/Toast/dialog-foot-clearance.d.ts +19 -0
- package/dist/components/layers/Toast/toast-clearance.d.ts +11 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-Bcu3EMIB.js → design-theme-GGVSCauN.js} +1 -1
- package/dist/{editors-DdGMdSh2.js → editors-CJ_6PXoL.js} +30129 -30094
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +18 -0
- package/dist/{index-cA9H4vaN.js → index-4MsOXuOU.js} +2 -2
- package/dist/{index-CNjQ-GTe.js → index-5BCfqxIs.js} +2 -2
- package/dist/{index-Be4u6vqC.js → index-5HFSSrP-.js} +1 -1
- package/dist/{index-CH4DiDpu.js → index-7M2xC_9h.js} +2 -2
- package/dist/{index-DBctH8lu.js → index-8o9jiKS2.js} +2 -2
- package/dist/{index-DMAlgOv6.js → index-B6QYagVk.js} +2 -2
- package/dist/{index-CYGd_IjS.js → index-BQFouU9U.js} +2 -2
- package/dist/{index-8LPOJLO8.js → index-BQLAeM_n.js} +2 -2
- package/dist/{index-CNx-Ok-t.js → index-BbbyRlLu.js} +2 -2
- package/dist/{index-BFZvgteF.js → index-Bbc0SjAt.js} +2 -2
- package/dist/{index-Cwo-CFS8.js → index-BcsTtdwQ.js} +4 -4
- package/dist/{index-DSIctaR0.js → index-Berc0QsZ.js} +4 -4
- package/dist/{index-DfGQhHnK.js → index-ByRUmH_4.js} +3 -3
- package/dist/{index-CH67WfFq.js → index-CXUHmTse.js} +2 -2
- package/dist/{index-zu64GUZu.js → index-Cl1UafyM.js} +2 -2
- package/dist/{index-BPF_Eb0U.js → index-DQgpUR1S.js} +3 -3
- package/dist/{index-CbH8XAvZ.js → index-Dh1lFi8d.js} +2 -2
- package/dist/{index-_7HwdzPE.js → index-Drwqi2Fr.js} +2 -2
- package/dist/{index-B12llGmk.js → index-Dtfo8fKg.js} +4 -4
- package/dist/{index-Vgp_uo0Y.js → index-VLxkKEWK.js} +3 -3
- package/dist/{index-CJ4-H8Ku.js → index-p3G-JM7E.js} +3 -3
- package/dist/index.js +5850 -5767
- package/dist/legacy.js +6 -6
- package/dist/translations/en.d.ts +9 -0
- package/dist/translations/fr.d.ts +9 -0
- package/package.json +1 -1
- package/dist/commons-front-core.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog — @abyss-project/commons-front-core
|
|
2
2
|
|
|
3
|
+
## 18.1.4
|
|
4
|
+
|
|
5
|
+
Card #286 (global review of AbyssMain, lot 1). No export removed, no signature changed. Changed behaviors, each listed below: the y domain of an unfilled `LineChart`, its x labels on a narrow chart, the block handle on a touch layout, the texts of `CodeEditor`.
|
|
6
|
+
|
|
7
|
+
- `MarkdownEditor`: Crepe's stylesheet now reaches consumers built on the published package. The build extracted it into `dist/commons-front-core.css`, which no chunk imports and `exports` does not expose, so block handle, slash menu and toolbar had no layout outside a source alias. The editor now puts it first in `head` itself; nothing to import. It weighs 1.5 MB, mostly KaTeX for Crepe's Latex feature, as a string in the `editors` chunk: only the screens that load an editor pay for it.
|
|
8
|
+
- `Toast`: below `md`, the region keeps above the foot of the open dialog when that dialog reaches the bottom edge: MUI's `DialogActions` (`AbyssModal`, a full-screen `Dialog`) and the actions of a `Modal` shown as a sheet. The region moves only when it would reach that foot from where it rests (safe area and cookie banner included): a full-screen dialog with short content has its foot high up, and the toast stays in its corner rather than covering the fields. The cookie banner's `--abyss-toast-clearance` and modal clearance are untouched.
|
|
9
|
+
- `LineChart`: an unfilled chart leaves 8 % of its span above and below its values, without crossing zero, so its ends no longer hug the frame. Filled and stacked charts are unchanged.
|
|
10
|
+
- `LineChart`: a narrow chart keeps labels under its x axis. When the nice ticks leave fewer than two labels inside the margins, the axis is labeled at its two ends, or at one point when two cannot stand side by side; the reserved band under the plot used to stay empty (24 h on a phone).
|
|
11
|
+
- `LineChart`: in the legend, the marks of `markers` have a round swatch, as they are drawn.
|
|
12
|
+
- `LineChart`: new optional `markers.tone` (`ChartSeriesTone`, or `LineChartMarkerTone.Series` for the color of the line); `status.danger` stays the default.
|
|
13
|
+
- `lineChartPlotMargin(space)`: the room around the plot of a `LineChart`, for a host that maps a pointer onto the plot.
|
|
14
|
+
- `Callout`: a `pre` in its content scrolls inside the callout.
|
|
15
|
+
- `CodeEditor`: the frame is never taller than an editor of a smaller numeric height, so no light band shows under a short editor. A `minHeight` above a numeric `height` is capped to it.
|
|
16
|
+
- `CodeEditor`: Monaco's input is named by `label`, else by `ds.editors.code.aria-label` (« Éditeur de code » / « Code editor »), instead of Monaco's English « Editor content ».
|
|
17
|
+
- `CodeEditor`, `FullScreenMonacoEditor`: every visible text is translated (`ds.editors.code.*`, FR and EN): « Plein écran », its tooltip, the loading text, the default title of the full-screen window. **They must be mounted under an `IntlProvider` holding the messages of the core**: there is no fallback, `useIntl` throws without one. `CodeEditor` already needed it through the `FullScreenMonacoEditor` it always mounts, and no front outside `abyss-main` uses them.
|
|
18
|
+
- `MarkdownEditor`: the room of the block handle goes from 88 to 56 px under a mouse (24 px controls, 4 px from the block). On a touch layout the block handle goes (its « + » covered the end of the line): the text takes the whole width and « / » opens the same menu.
|
|
19
|
+
- `MarkdownEditor`: the frame grows with a placeholder that wraps; its second line ran past the frame at 390 px.
|
|
20
|
+
|
|
21
|
+
Card #286 (admin, lot A3).
|
|
22
|
+
|
|
23
|
+
- `SupportMessageThread`: in the admin view (`isAdmin`), a ticket without any reply yet no longer shows the requester's « Votre demande est bien arrivée » but « Pas encore de réponse » / « No reply yet », saying the requester awaits the first reply of the support (new keys `support.detail.awaiting-reply-title` and `support.detail.awaiting-reply-subtitle`, FR and EN). The requester's view is unchanged.
|
|
24
|
+
- `SupportMessageThread`: the jump to the bottom (first load, new message, « Nouveaux messages ») brings the bottom of the thread to the bottom edge of every scrolling ancestor (`block: 'end'`). On a phone, where the detail around the thread scrolls and not the thread, the default top edge used to scroll the whole thread out of view above the reply field.
|
|
25
|
+
- `AuthFlow`: the e-mail step ledes write « adresse e-mail » with a non-breaking hyphen (U+2011), so the line never breaks between « e- » and « mail ».
|
|
26
|
+
|
|
3
27
|
## 18.1.3
|
|
4
28
|
|
|
5
29
|
- `DeliverySubscriptions`: the URL of a mobile card really wraps: the card's primary line is nowrap and ellipsised, the URL now overrides it.
|
package/README.md
CHANGED
|
@@ -25,6 +25,10 @@ pnpm add @abyss-project/commons-front-core
|
|
|
25
25
|
|
|
26
26
|
Voir la [documentation produit](https://docs.abyss-project.fr/abyss-project) pour les guides d'utilisation, la configuration du Core, les exemples d'appel et la référence des permissions.
|
|
27
27
|
|
|
28
|
+
## Éditeurs de code
|
|
29
|
+
|
|
30
|
+
`CodeEditor`, `ExpressionCodeEditor` et `FullScreenMonacoEditor` (entrée `@abyss-project/commons-front-core/editors`) lisent leurs textes dans `ds.editors.code.*`. Ils se montent sous un `IntlProvider` qui porte les messages du core : sans lui, `useIntl` lève une erreur, il n'y a pas de repli.
|
|
31
|
+
|
|
28
32
|
## RUM
|
|
29
33
|
|
|
30
34
|
Le RUM navigateur d'un front (SDK `@abyss-project/monitor-browser`, peer `^1.3.2` ; `setContact` et `setTheme` demandent la version publiée par #285 F) se démarre par `AbyssRumProvider`, monté **sous** `AbyssCookieConsentProvider`, sous le `ThemeProvider` MUI et, quand le front en a un, sous `AuthProvider` :
|
|
@@ -115,6 +115,9 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
115
115
|
entry('Menu', 'layers', 'menu'),
|
|
116
116
|
entry('AnchoredPanel', 'layers', 'anchored-panel', { mobileCapture: true }),
|
|
117
117
|
entry('Toast', 'layers', 'toast', { mobileCapture: true }),
|
|
118
|
+
entry('SessionErrorScreen', 'business', 'session-error-screen', {
|
|
119
|
+
mobileCapture: true,
|
|
120
|
+
}),
|
|
118
121
|
entry('CommandPalette', 'layers', 'command-palette'),
|
|
119
122
|
entry('ProductTour', 'layers', 'product-tour', { mobileCapture: true }),
|
|
120
123
|
entry('RichSelect', 'inputs', 'rich-select'),
|
|
@@ -135,6 +138,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
135
138
|
entry('DropZone', 'inputs', 'drop-zone', RESPONSIVE),
|
|
136
139
|
entry('ImportButton', 'inputs', 'import-button'),
|
|
137
140
|
entry('MarkdownEditor', 'inputs', 'markdown-editor', RESPONSIVE),
|
|
141
|
+
entry('CodeEditor', 'inputs', 'code-editor'),
|
|
138
142
|
entry('PdfEditor', 'inputs', 'pdf-editor', RESPONSIVE),
|
|
139
143
|
entry('ExpressionSearch', 'inputs', 'expression-search', {
|
|
140
144
|
mobileCapture: true,
|
|
@@ -6,6 +6,10 @@ import {
|
|
|
6
6
|
} from '../../src/components/states/Callout/Callout';
|
|
7
7
|
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
8
8
|
|
|
9
|
+
/** One line wider than the page at every width: it scrolls inside the callout. */
|
|
10
|
+
const LONG_LINE =
|
|
11
|
+
'curl -X POST https://console.abyss-project.fr/api/internal/v1/storage/deliveries --header "Authorization: Bearer $ABYSS_CONSOLE_TOKEN" --data-binary @payload.json --output response.json --retry 3 --retry-delay 5 --silent --show-error';
|
|
12
|
+
|
|
9
13
|
export const CalloutPage = () => {
|
|
10
14
|
const { log } = useEventLog();
|
|
11
15
|
return (
|
|
@@ -61,6 +65,11 @@ export const CalloutPage = () => {
|
|
|
61
65
|
Votre abonnement est pris en charge par votre famille.
|
|
62
66
|
</Callout>
|
|
63
67
|
</Example>
|
|
68
|
+
<Example title="Bloc de code long : il défile dans le bandeau">
|
|
69
|
+
<Callout severity={CalloutSeverity.Info} title="Variable à ajouter">
|
|
70
|
+
<pre data-testid="callout-pre">{LONG_LINE}</pre>
|
|
71
|
+
</Callout>
|
|
72
|
+
</Example>
|
|
64
73
|
<LastEvent />
|
|
65
74
|
</Showcase>
|
|
66
75
|
);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { CodeEditor } from '../../src/components/CodeEditor/CodeEditor.component';
|
|
3
|
+
import { Example, Showcase } from '../frame';
|
|
4
|
+
|
|
5
|
+
const EXPRESSION = `Bonjour {{ trigger.user.firstName }},
|
|
6
|
+
votre facture {{ trigger.invoice.number }} est disponible.
|
|
7
|
+
À bientôt.`;
|
|
8
|
+
|
|
9
|
+
const Editor = ({
|
|
10
|
+
height,
|
|
11
|
+
testId,
|
|
12
|
+
compact,
|
|
13
|
+
}: {
|
|
14
|
+
height: number;
|
|
15
|
+
testId: string;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
}) => {
|
|
18
|
+
const [value, setValue] = useState(EXPRESSION);
|
|
19
|
+
return (
|
|
20
|
+
<div data-testid={testId}>
|
|
21
|
+
<CodeEditor
|
|
22
|
+
value={value}
|
|
23
|
+
onChange={setValue}
|
|
24
|
+
height={height}
|
|
25
|
+
compact={compact}
|
|
26
|
+
language="handlebars"
|
|
27
|
+
prose
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const CodeEditorPage = () => (
|
|
34
|
+
<Showcase
|
|
35
|
+
family="Saisie"
|
|
36
|
+
name="CodeEditor"
|
|
37
|
+
description="Éditeur Monaco : un cadre aussi haut que l'éditeur, quelle que soit sa hauteur, et une fenêtre en plein écran. Textes traduits, à monter sous un IntlProvider."
|
|
38
|
+
>
|
|
39
|
+
<Example title="Hauteur courante" maxWidth={880}>
|
|
40
|
+
<Editor height={300} testId="code-editor-300" />
|
|
41
|
+
</Example>
|
|
42
|
+
<Example title="Court, 100 px" maxWidth={880}>
|
|
43
|
+
<Editor height={100} testId="code-editor-100" />
|
|
44
|
+
</Example>
|
|
45
|
+
<Example title="Court, 60 px" maxWidth={880}>
|
|
46
|
+
<Editor height={60} testId="code-editor-60" />
|
|
47
|
+
</Example>
|
|
48
|
+
<Example title="Compact, 60 px" maxWidth={880}>
|
|
49
|
+
<Editor height={60} testId="code-editor-compact" compact />
|
|
50
|
+
</Example>
|
|
51
|
+
</Showcase>
|
|
52
|
+
);
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { DeliveryHistory } from '../../src/components/business/Deliveries/DeliveryHistory.component';
|
|
2
|
-
import type { DeliveryHistoryProps } from '../../src/components/business/Deliveries/deliveries.types';
|
|
3
|
-
import {
|
|
4
|
-
delivery,
|
|
5
|
-
deliveryStatus,
|
|
6
|
-
failedDelivery,
|
|
7
|
-
page,
|
|
8
|
-
subscription,
|
|
9
|
-
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
10
|
-
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
11
|
-
|
|
12
|
-
const POPULATED = [
|
|
13
|
-
delivery(),
|
|
14
|
-
failedDelivery(),
|
|
15
|
-
delivery({
|
|
16
|
-
id: 'delivery-3',
|
|
17
|
-
eventKey: 'event-3',
|
|
18
|
-
deliveryId: 'sub-1:event-3',
|
|
19
|
-
status: deliveryStatus('RETRYING'),
|
|
20
|
-
attemptCount: 2,
|
|
21
|
-
lastResponseCode: 502,
|
|
22
|
-
lastResponseBody: null,
|
|
23
|
-
lastError: 'HTTP 502',
|
|
24
|
-
deliveredAt: null,
|
|
25
|
-
nextAttemptAt: new Date('2026-11-03T10:15:00Z'),
|
|
26
|
-
}),
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
export const DeliveryHistoryPage = () => {
|
|
30
|
-
const { log } = useEventLog();
|
|
31
|
-
const base = (list: DeliveryHistoryProps['list']): DeliveryHistoryProps => ({
|
|
32
|
-
list,
|
|
33
|
-
get: async (id) => POPULATED.find((row) => row.id === id) ?? delivery(),
|
|
34
|
-
replayDelivery: async (id) => log(`rejouer ${id}`),
|
|
35
|
-
canReplay: true,
|
|
36
|
-
getSubscription: async () =>
|
|
37
|
-
subscription({
|
|
38
|
-
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
39
|
-
eventTypes: ['MONITOR_EVENT', 'MONITOR_SENTINEL'],
|
|
40
|
-
}),
|
|
41
|
-
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
42
|
-
});
|
|
43
|
-
return (
|
|
44
|
-
<Showcase
|
|
45
|
-
family="Métier"
|
|
46
|
-
name="DeliveryHistory"
|
|
47
|
-
description="L'historique des livraisons d'un abonnement (URL et événements sous le titre) : filtre de statut, détail en panneau (données de l'événement, en-têtes envoyés, réponse, déroulé) et rejeu d'une livraison terminée."
|
|
48
|
-
>
|
|
49
|
-
<Example title="Peuplé" maxWidth={1100}>
|
|
50
|
-
<DeliveryHistory {...base(async () => page(POPULATED))} />
|
|
51
|
-
</Example>
|
|
52
|
-
<Example title="Vide" maxWidth={1100}>
|
|
53
|
-
<DeliveryHistory {...base(async () => page([]))} />
|
|
54
|
-
</Example>
|
|
55
|
-
<Example title="En cours de chargement" maxWidth={1100}>
|
|
56
|
-
<DeliveryHistory {...base(() => new Promise(() => undefined))} />
|
|
57
|
-
</Example>
|
|
58
|
-
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
59
|
-
<DeliveryHistory
|
|
60
|
-
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
61
|
-
/>
|
|
62
|
-
</Example>
|
|
63
|
-
<Example title="Sans abonnement ni lien vers Flow" maxWidth={1100}>
|
|
64
|
-
<DeliveryHistory
|
|
65
|
-
{...base(async () => page(POPULATED))}
|
|
66
|
-
getSubscription={undefined}
|
|
67
|
-
flowUrl={undefined}
|
|
68
|
-
/>
|
|
69
|
-
</Example>
|
|
70
|
-
<Example title="Sans droit de rejeu" maxWidth={1100}>
|
|
71
|
-
<DeliveryHistory
|
|
72
|
-
{...base(async () => page(POPULATED))}
|
|
73
|
-
canReplay={false}
|
|
74
|
-
/>
|
|
75
|
-
</Example>
|
|
76
|
-
<LastEvent />
|
|
77
|
-
</Showcase>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
1
|
+
import { DeliveryHistory } from '../../src/components/business/Deliveries/DeliveryHistory.component';
|
|
2
|
+
import type { DeliveryHistoryProps } from '../../src/components/business/Deliveries/deliveries.types';
|
|
3
|
+
import {
|
|
4
|
+
delivery,
|
|
5
|
+
deliveryStatus,
|
|
6
|
+
failedDelivery,
|
|
7
|
+
page,
|
|
8
|
+
subscription,
|
|
9
|
+
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
10
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
11
|
+
|
|
12
|
+
const POPULATED = [
|
|
13
|
+
delivery(),
|
|
14
|
+
failedDelivery(),
|
|
15
|
+
delivery({
|
|
16
|
+
id: 'delivery-3',
|
|
17
|
+
eventKey: 'event-3',
|
|
18
|
+
deliveryId: 'sub-1:event-3',
|
|
19
|
+
status: deliveryStatus('RETRYING'),
|
|
20
|
+
attemptCount: 2,
|
|
21
|
+
lastResponseCode: 502,
|
|
22
|
+
lastResponseBody: null,
|
|
23
|
+
lastError: 'HTTP 502',
|
|
24
|
+
deliveredAt: null,
|
|
25
|
+
nextAttemptAt: new Date('2026-11-03T10:15:00Z'),
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export const DeliveryHistoryPage = () => {
|
|
30
|
+
const { log } = useEventLog();
|
|
31
|
+
const base = (list: DeliveryHistoryProps['list']): DeliveryHistoryProps => ({
|
|
32
|
+
list,
|
|
33
|
+
get: async (id) => POPULATED.find((row) => row.id === id) ?? delivery(),
|
|
34
|
+
replayDelivery: async (id) => log(`rejouer ${id}`),
|
|
35
|
+
canReplay: true,
|
|
36
|
+
getSubscription: async () =>
|
|
37
|
+
subscription({
|
|
38
|
+
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
39
|
+
eventTypes: ['MONITOR_EVENT', 'MONITOR_SENTINEL'],
|
|
40
|
+
}),
|
|
41
|
+
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
42
|
+
});
|
|
43
|
+
return (
|
|
44
|
+
<Showcase
|
|
45
|
+
family="Métier"
|
|
46
|
+
name="DeliveryHistory"
|
|
47
|
+
description="L'historique des livraisons d'un abonnement (URL et événements sous le titre) : filtre de statut, détail en panneau (données de l'événement, en-têtes envoyés, réponse, déroulé) et rejeu d'une livraison terminée."
|
|
48
|
+
>
|
|
49
|
+
<Example title="Peuplé" maxWidth={1100}>
|
|
50
|
+
<DeliveryHistory {...base(async () => page(POPULATED))} />
|
|
51
|
+
</Example>
|
|
52
|
+
<Example title="Vide" maxWidth={1100}>
|
|
53
|
+
<DeliveryHistory {...base(async () => page([]))} />
|
|
54
|
+
</Example>
|
|
55
|
+
<Example title="En cours de chargement" maxWidth={1100}>
|
|
56
|
+
<DeliveryHistory {...base(() => new Promise(() => undefined))} />
|
|
57
|
+
</Example>
|
|
58
|
+
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
59
|
+
<DeliveryHistory
|
|
60
|
+
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
61
|
+
/>
|
|
62
|
+
</Example>
|
|
63
|
+
<Example title="Sans abonnement ni lien vers Flow" maxWidth={1100}>
|
|
64
|
+
<DeliveryHistory
|
|
65
|
+
{...base(async () => page(POPULATED))}
|
|
66
|
+
getSubscription={undefined}
|
|
67
|
+
flowUrl={undefined}
|
|
68
|
+
/>
|
|
69
|
+
</Example>
|
|
70
|
+
<Example title="Sans droit de rejeu" maxWidth={1100}>
|
|
71
|
+
<DeliveryHistory
|
|
72
|
+
{...base(async () => page(POPULATED))}
|
|
73
|
+
canReplay={false}
|
|
74
|
+
/>
|
|
75
|
+
</Example>
|
|
76
|
+
<LastEvent />
|
|
77
|
+
</Showcase>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { DeliverySubscriptions } from '../../src/components/business/Deliveries/DeliverySubscriptions.component';
|
|
2
|
-
import type { DeliverySubscriptionsProps } from '../../src/components/business/Deliveries/deliveries.types';
|
|
3
|
-
import {
|
|
4
|
-
EVENT_TYPES_BY_SOURCE,
|
|
5
|
-
SOURCES,
|
|
6
|
-
deliveryFormat,
|
|
7
|
-
page,
|
|
8
|
-
source,
|
|
9
|
-
subscription,
|
|
10
|
-
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
11
|
-
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
12
|
-
|
|
13
|
-
const PERMISSIONS = {
|
|
14
|
-
canCreate: true,
|
|
15
|
-
canUpdate: true,
|
|
16
|
-
canDelete: true,
|
|
17
|
-
canResetSecret: true,
|
|
18
|
-
canReadHistory: true,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const POPULATED = [
|
|
22
|
-
subscription(),
|
|
23
|
-
subscription({
|
|
24
|
-
id: 'sub-2',
|
|
25
|
-
source: source('FORM'),
|
|
26
|
-
eventTypes: ['FORM_SUBMISSION'],
|
|
27
|
-
url: 'https://discord.com/api/webhooks/1234/abcd',
|
|
28
|
-
format: deliveryFormat('DISCORD'),
|
|
29
|
-
consecutiveFailures: 3,
|
|
30
|
-
}),
|
|
31
|
-
subscription({
|
|
32
|
-
id: 'sub-3',
|
|
33
|
-
source: source('STORAGE'),
|
|
34
|
-
eventTypes: ['STORAGE_UPLOAD', 'STORAGE_DELETE'],
|
|
35
|
-
url: 'https://files.example.com/hooks/storage',
|
|
36
|
-
isEnabled: false,
|
|
37
|
-
disabledAt: new Date('2026-11-02T08:00:00Z'),
|
|
38
|
-
consecutiveFailures: 10,
|
|
39
|
-
}),
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
const secretFor = (id: string) => `whsec_catalog_${id}_do-not-use`;
|
|
43
|
-
|
|
44
|
-
export const DeliverySubscriptionsPage = () => {
|
|
45
|
-
const { log } = useEventLog();
|
|
46
|
-
const base = (
|
|
47
|
-
list: DeliverySubscriptionsProps['list'],
|
|
48
|
-
): DeliverySubscriptionsProps => ({
|
|
49
|
-
sources: SOURCES,
|
|
50
|
-
eventTypesBySource: EVENT_TYPES_BY_SOURCE,
|
|
51
|
-
list,
|
|
52
|
-
create: async (body) => {
|
|
53
|
-
log(`créer ${body.url}`);
|
|
54
|
-
return {
|
|
55
|
-
deliverySubscription: subscription({ id: 'sub-new', url: body.url }),
|
|
56
|
-
secret: secretFor('new'),
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
update: async (id, body) => {
|
|
60
|
-
log(`modifier ${id}`);
|
|
61
|
-
return subscription({ id, ...body });
|
|
62
|
-
},
|
|
63
|
-
remove: async (id) => log(`supprimer ${id}`),
|
|
64
|
-
resetSecret: async (id) => {
|
|
65
|
-
log(`secret ${id}`);
|
|
66
|
-
return {
|
|
67
|
-
deliverySubscription: subscription({ id }),
|
|
68
|
-
secret: secretFor(id),
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
onOpenHistory: (row) => log(`historique ${row.id}`),
|
|
72
|
-
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
73
|
-
permissions: PERMISSIONS,
|
|
74
|
-
});
|
|
75
|
-
return (
|
|
76
|
-
<Showcase
|
|
77
|
-
family="Métier"
|
|
78
|
-
name="DeliverySubscriptions"
|
|
79
|
-
description="Les abonnements de livraison d'un périmètre : liste, création et édition en panneau, secret affiché une seule fois, activation, suppression confirmée. Les données et les actions passent par des props."
|
|
80
|
-
>
|
|
81
|
-
<Example title="Peuplé" maxWidth={1100}>
|
|
82
|
-
<DeliverySubscriptions {...base(async () => page(POPULATED))} />
|
|
83
|
-
</Example>
|
|
84
|
-
<Example title="Une seule source, sans lien vers Flow" maxWidth={1100}>
|
|
85
|
-
<DeliverySubscriptions
|
|
86
|
-
{...base(async () =>
|
|
87
|
-
page([
|
|
88
|
-
subscription({
|
|
89
|
-
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
90
|
-
}),
|
|
91
|
-
subscription({
|
|
92
|
-
id: 'sub-4',
|
|
93
|
-
url: 'https://ops.example.com/webhooks/abyss/monitor-events/staging',
|
|
94
|
-
}),
|
|
95
|
-
]),
|
|
96
|
-
)}
|
|
97
|
-
sources={[source('MONITOR')]}
|
|
98
|
-
flowUrl={undefined}
|
|
99
|
-
/>
|
|
100
|
-
</Example>
|
|
101
|
-
<Example title="Vide" maxWidth={1100}>
|
|
102
|
-
<DeliverySubscriptions {...base(async () => page([]))} />
|
|
103
|
-
</Example>
|
|
104
|
-
<Example title="En cours de chargement" maxWidth={1100}>
|
|
105
|
-
<DeliverySubscriptions {...base(() => new Promise(() => undefined))} />
|
|
106
|
-
</Example>
|
|
107
|
-
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
108
|
-
<DeliverySubscriptions
|
|
109
|
-
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
110
|
-
/>
|
|
111
|
-
</Example>
|
|
112
|
-
<Example title="Lecture seule" maxWidth={1100}>
|
|
113
|
-
<DeliverySubscriptions
|
|
114
|
-
{...base(async () => page(POPULATED))}
|
|
115
|
-
permissions={{
|
|
116
|
-
canCreate: false,
|
|
117
|
-
canUpdate: false,
|
|
118
|
-
canDelete: false,
|
|
119
|
-
canResetSecret: false,
|
|
120
|
-
canReadHistory: true,
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
</Example>
|
|
124
|
-
<LastEvent />
|
|
125
|
-
</Showcase>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
1
|
+
import { DeliverySubscriptions } from '../../src/components/business/Deliveries/DeliverySubscriptions.component';
|
|
2
|
+
import type { DeliverySubscriptionsProps } from '../../src/components/business/Deliveries/deliveries.types';
|
|
3
|
+
import {
|
|
4
|
+
EVENT_TYPES_BY_SOURCE,
|
|
5
|
+
SOURCES,
|
|
6
|
+
deliveryFormat,
|
|
7
|
+
page,
|
|
8
|
+
source,
|
|
9
|
+
subscription,
|
|
10
|
+
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
11
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
12
|
+
|
|
13
|
+
const PERMISSIONS = {
|
|
14
|
+
canCreate: true,
|
|
15
|
+
canUpdate: true,
|
|
16
|
+
canDelete: true,
|
|
17
|
+
canResetSecret: true,
|
|
18
|
+
canReadHistory: true,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const POPULATED = [
|
|
22
|
+
subscription(),
|
|
23
|
+
subscription({
|
|
24
|
+
id: 'sub-2',
|
|
25
|
+
source: source('FORM'),
|
|
26
|
+
eventTypes: ['FORM_SUBMISSION'],
|
|
27
|
+
url: 'https://discord.com/api/webhooks/1234/abcd',
|
|
28
|
+
format: deliveryFormat('DISCORD'),
|
|
29
|
+
consecutiveFailures: 3,
|
|
30
|
+
}),
|
|
31
|
+
subscription({
|
|
32
|
+
id: 'sub-3',
|
|
33
|
+
source: source('STORAGE'),
|
|
34
|
+
eventTypes: ['STORAGE_UPLOAD', 'STORAGE_DELETE'],
|
|
35
|
+
url: 'https://files.example.com/hooks/storage',
|
|
36
|
+
isEnabled: false,
|
|
37
|
+
disabledAt: new Date('2026-11-02T08:00:00Z'),
|
|
38
|
+
consecutiveFailures: 10,
|
|
39
|
+
}),
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const secretFor = (id: string) => `whsec_catalog_${id}_do-not-use`;
|
|
43
|
+
|
|
44
|
+
export const DeliverySubscriptionsPage = () => {
|
|
45
|
+
const { log } = useEventLog();
|
|
46
|
+
const base = (
|
|
47
|
+
list: DeliverySubscriptionsProps['list'],
|
|
48
|
+
): DeliverySubscriptionsProps => ({
|
|
49
|
+
sources: SOURCES,
|
|
50
|
+
eventTypesBySource: EVENT_TYPES_BY_SOURCE,
|
|
51
|
+
list,
|
|
52
|
+
create: async (body) => {
|
|
53
|
+
log(`créer ${body.url}`);
|
|
54
|
+
return {
|
|
55
|
+
deliverySubscription: subscription({ id: 'sub-new', url: body.url }),
|
|
56
|
+
secret: secretFor('new'),
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
update: async (id, body) => {
|
|
60
|
+
log(`modifier ${id}`);
|
|
61
|
+
return subscription({ id, ...body });
|
|
62
|
+
},
|
|
63
|
+
remove: async (id) => log(`supprimer ${id}`),
|
|
64
|
+
resetSecret: async (id) => {
|
|
65
|
+
log(`secret ${id}`);
|
|
66
|
+
return {
|
|
67
|
+
deliverySubscription: subscription({ id }),
|
|
68
|
+
secret: secretFor(id),
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
onOpenHistory: (row) => log(`historique ${row.id}`),
|
|
72
|
+
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
73
|
+
permissions: PERMISSIONS,
|
|
74
|
+
});
|
|
75
|
+
return (
|
|
76
|
+
<Showcase
|
|
77
|
+
family="Métier"
|
|
78
|
+
name="DeliverySubscriptions"
|
|
79
|
+
description="Les abonnements de livraison d'un périmètre : liste, création et édition en panneau, secret affiché une seule fois, activation, suppression confirmée. Les données et les actions passent par des props."
|
|
80
|
+
>
|
|
81
|
+
<Example title="Peuplé" maxWidth={1100}>
|
|
82
|
+
<DeliverySubscriptions {...base(async () => page(POPULATED))} />
|
|
83
|
+
</Example>
|
|
84
|
+
<Example title="Une seule source, sans lien vers Flow" maxWidth={1100}>
|
|
85
|
+
<DeliverySubscriptions
|
|
86
|
+
{...base(async () =>
|
|
87
|
+
page([
|
|
88
|
+
subscription({
|
|
89
|
+
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
90
|
+
}),
|
|
91
|
+
subscription({
|
|
92
|
+
id: 'sub-4',
|
|
93
|
+
url: 'https://ops.example.com/webhooks/abyss/monitor-events/staging',
|
|
94
|
+
}),
|
|
95
|
+
]),
|
|
96
|
+
)}
|
|
97
|
+
sources={[source('MONITOR')]}
|
|
98
|
+
flowUrl={undefined}
|
|
99
|
+
/>
|
|
100
|
+
</Example>
|
|
101
|
+
<Example title="Vide" maxWidth={1100}>
|
|
102
|
+
<DeliverySubscriptions {...base(async () => page([]))} />
|
|
103
|
+
</Example>
|
|
104
|
+
<Example title="En cours de chargement" maxWidth={1100}>
|
|
105
|
+
<DeliverySubscriptions {...base(() => new Promise(() => undefined))} />
|
|
106
|
+
</Example>
|
|
107
|
+
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
108
|
+
<DeliverySubscriptions
|
|
109
|
+
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
110
|
+
/>
|
|
111
|
+
</Example>
|
|
112
|
+
<Example title="Lecture seule" maxWidth={1100}>
|
|
113
|
+
<DeliverySubscriptions
|
|
114
|
+
{...base(async () => page(POPULATED))}
|
|
115
|
+
permissions={{
|
|
116
|
+
canCreate: false,
|
|
117
|
+
canUpdate: false,
|
|
118
|
+
canDelete: false,
|
|
119
|
+
canResetSecret: false,
|
|
120
|
+
canReadHistory: true,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
</Example>
|
|
124
|
+
<LastEvent />
|
|
125
|
+
</Showcase>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
LineChartSeries,
|
|
4
4
|
LineChartX,
|
|
5
5
|
} from '../../src/components/data/LineChart/LineChart';
|
|
6
|
+
import { LineChartMarkerTone } from '../../src/components/data/LineChart/LineChart';
|
|
6
7
|
import { ChartSeriesTone } from '../../src/components/data/chart-series-tone';
|
|
7
8
|
import { Surface } from '../../src/components/structure/Surface/Surface';
|
|
8
9
|
import { Example, Showcase } from '../frame';
|
|
@@ -88,6 +89,26 @@ export const LineChartPage = () => (
|
|
|
88
89
|
/>
|
|
89
90
|
</Surface>
|
|
90
91
|
</Example>
|
|
92
|
+
<Example title="Courbe non remplie, marques dans la couleur de la ligne">
|
|
93
|
+
<Surface padding={4}>
|
|
94
|
+
<LineChart
|
|
95
|
+
series={[
|
|
96
|
+
{
|
|
97
|
+
...hourly('latency', 'Latence p95', LATENCY),
|
|
98
|
+
markers: {
|
|
99
|
+
label: 'Mesure isolée',
|
|
100
|
+
xs: [atHour(9), atHour(14)],
|
|
101
|
+
tone: LineChartMarkerTone.Series,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
]}
|
|
105
|
+
height={240}
|
|
106
|
+
formatX={formatHour}
|
|
107
|
+
formatY={(y) => count.format(y)}
|
|
108
|
+
label="Latence p95 par heure, avec deux mesures marquées"
|
|
109
|
+
/>
|
|
110
|
+
</Surface>
|
|
111
|
+
</Example>
|
|
91
112
|
<Example title="Deux séries">
|
|
92
113
|
<Surface padding={4}>
|
|
93
114
|
<LineChart
|
|
@@ -28,7 +28,7 @@ export const MarkdownEditorPage = () => {
|
|
|
28
28
|
<Showcase
|
|
29
29
|
family="Saisie"
|
|
30
30
|
name="MarkdownEditor"
|
|
31
|
-
description="Éditeur Markdown de l'écosystème : Crepe, aux couleurs et aux polices du design system, libellés traduits. Un « / » ouvre le menu des blocs ; la poignée à gauche d'un bloc l'ajoute ou le déplace. Sur un écran tactile, la poignée et les boutons font 44 px."
|
|
31
|
+
description="Éditeur Markdown de l'écosystème : Crepe, aux couleurs et aux polices du design system, libellés traduits. Un « / » ouvre le menu des blocs ; la poignée à gauche d'un bloc l'ajoute ou le déplace. Sur un écran tactile, la poignée de bloc disparaît, « / » ouvre le même menu, et les boutons font 44 px."
|
|
32
32
|
>
|
|
33
33
|
<Example title="Édition d'une note" maxWidth={880}>
|
|
34
34
|
<MarkdownEditor
|