@abyss-project/commons-front-core 20.4.0 → 20.5.1
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 +16 -1
- package/catalog/pages/DeliveryHistory.tsx +142 -142
- package/catalog/specs/captures.spec.ts +156 -156
- package/catalog/specs/write-capture-index.ts +82 -82
- package/dist/{CookieConsentSettings-JQqB3ZoC.js → CookieConsentSettings-BGIHx7eH.js} +1 -1
- package/dist/{Surface-rKrLIx9x.js → Surface-B74cXq1M.js} +3 -1
- package/dist/{Tabs-C3ZY5xT8.js → Tabs-nH2IBqqa.js} +1 -1
- package/dist/components/business/Deliveries/deliveries.types.d.ts +27 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-CeGUipuM.js → design-theme-DtU1zQos.js} +1 -1
- package/dist/{editors-DNQ00p6Y.js → editors-s-GER37R.js} +27 -27
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +18 -0
- package/dist/{index-BQUxvLoP.js → index-1n03jgsr.js} +3 -3
- package/dist/{index-On5L36UF.js → index-8L4OftHM.js} +2 -2
- package/dist/{index-CHy_RxpP.js → index-B-oGxRVH.js} +2 -2
- package/dist/{index-CzCDSQiD.js → index-B635dFQ2.js} +2 -2
- package/dist/{index-BXfdxGL2.js → index-BZgkwoZ5.js} +2 -2
- package/dist/{index-CQ9U6YlK.js → index-B_fqzhtm.js} +3 -3
- package/dist/{index-DAVJlVe-.js → index-Bn9RgQrP.js} +2 -2
- package/dist/{index-qGV3av53.js → index-BxlF9T05.js} +2 -2
- package/dist/{index-DWnlMFqj.js → index-CE-4v9ue.js} +3 -3
- package/dist/{index-2mUgohFa.js → index-CO6rjqWZ.js} +4 -4
- package/dist/{index-ehhIl57c.js → index-CVN6HOlq.js} +2 -2
- package/dist/{index-DpR-QTUA.js → index-CXEf_Hel.js} +4 -4
- package/dist/{index-DgiI-dK3.js → index-D4kZ3Yip.js} +2 -2
- package/dist/{index-a47WpMOx.js → index-D9IW7UEw.js} +2 -2
- package/dist/{index-DQtcZD9Y.js → index-DctO0l5q.js} +1 -1
- package/dist/{index-BQlO5Fp0.js → index-Dka20zad.js} +2 -2
- package/dist/{index-GvBY_FDT.js → index-DoWxAfPn.js} +4 -4
- package/dist/{index-CJnZcgwL.js → index-NX_Kd4oz.js} +3 -3
- package/dist/{index-CIpdjZHz.js → index-YkgGwyfx.js} +2 -2
- package/dist/{index-7lQ_E_am.js → index-genxamHw.js} +2 -2
- package/dist/{index-8lBj2Ffk.js → index-yqn8Hbay.js} +2 -2
- package/dist/index.js +7211 -7189
- package/dist/legacy.js +6 -6
- package/dist/translations/en.d.ts +1 -0
- package/dist/translations/fr.d.ts +1 -0
- package/package.json +1 -1
- package/test-results/catalog/.last-run.json +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# Changelog — @abyss-project/commons-front-core
|
|
2
2
|
|
|
3
|
+
## 20.5.0
|
|
4
|
+
|
|
5
|
+
Card #792 (P5 L3c, after the final review: Monitor's tasks, webhooks and history pages carried two titles).
|
|
6
|
+
|
|
7
|
+
- `ScheduledTasks`, `DeliverySubscriptions`: new optional `hostHeader: { actions }`, for a host whose page header names the page. With it, the component draws no `PageHeader` of its own and portals its create button (« Nouvelle tâche », « Nouvel abonnement », drawn only with the right to create) into `actions`, an element of the host's header (`null` while it is not mounted: the button appears once it is). Without it, nothing changes.
|
|
8
|
+
- `DeliveryHistory`: new optional `hostHeader: { subtitle }`, the same for the history. With it, no `PageHeader` of its own (no « Livraisons » title), and the subscription it lists (`getSubscription`: its URL and its events) is portalled into `subtitle`. Without it, nothing changes.
|
|
9
|
+
- New exported types: `DeliveryHostHeader`, `DeliveryHistoryHostHeader`.
|
|
10
|
+
- `ScheduledTasks`, mobile card: a task's name wraps onto a second line before its ellipsis (it was cut on one line, room left).
|
|
11
|
+
- `DeliverySubscriptions`, mobile card: the events of a subscription are named under its URL, as the table's column does.
|
|
12
|
+
- `ScheduledTasks`, run filters: the request id field's placeholder reads « UUID, 36 caractères » (« UUID, 36 characters »), new key `deliveries.tasks.runs.filters.request-id-placeholder`; the 36-character example id it showed was cut on desktop and mobile.
|
|
13
|
+
|
|
3
14
|
## 20.4.0
|
|
4
15
|
|
|
5
16
|
Card #792 (P5 L3c: Monitor's webhooks and cron tasks on the common components). Peer and dev dependency `@abyss-project/flow` ^1.7.0 (run `requestId`, `startedAt`, `responseHeaders`, task `retryBackoff`, run filters `from`, `to`, `requestId`).
|
|
6
17
|
|
|
7
|
-
- `ScheduledTasks`: `flowUrl` is optional (no link without it). New required action `get(id)` (one task, for a deep link
|
|
18
|
+
- `ScheduledTasks`: `flowUrl` is optional (no link without it). New required action `get(id)` (one task, for a deep link): a host that mounts the component must pass it; Monitor (abyss-main, same card) does. New optional props: `initialTaskId` opens the panel of that task on arrival (loading, failure with a retry, « Tâche introuvable » on a 404), `onCloseTask()` says the panel closed, `runLogsHref(run)` draws a link to the host's logs of a run's request in the run detail, `renderTaskState(task)` draws the host's state card at the head of the task panel, `renderIncidentPolicy({ value, onChange, task })` draws the host's incident-policy editor in the form (with it, `incidentPolicy` is sent; without it, never).
|
|
8
19
|
- `ScheduledTasks` panel of a task: run filters (period of whole days sent as `from`/`to`, a whole request id sent as `requestId`, an outcome that narrows the page loaded and says so), « Effacer les filtres », and a run detail in place of the list (status, `x-request-id`, scheduled and started dates, attempt, duration, code, error, response headers and body; « Détail archivé » past 30 days).
|
|
9
20
|
- `ScheduledTasks` form: `retryBackoff` (« Croissante » `LINEAR`, Flow's default, or « Fixe » `FIXED`), always sent.
|
|
10
21
|
- `DeliverySubscriptions`: new optional `renderFilters({ source, eventTypes, value, onChange, subscription })`, the host's filters editor in the form; with it, the creation and the update send `filters` (`null` for none; a change of source empties them); without it, never.
|
|
@@ -15,6 +26,10 @@ Also card #798, merged on develop before this release:
|
|
|
15
26
|
|
|
16
27
|
- `InvoiceDetailView`: the unit printed next to a line quantity is read from the host's `billing.unit.*` entry with the quantity as `count`, so a host whose entries are ICU plural messages shows « 1 invocation » / « 1 250 invocations » instead of the raw message. A host whose entries are plain strings is unaffected: the extra value is ignored.
|
|
17
28
|
|
|
29
|
+
Card #680 (a scan that could not run).
|
|
30
|
+
|
|
31
|
+
- `ScanBadge`: the error verdict reads « Analyse impossible » (EN « Scan failed », unchanged) instead of « Analyse en erreur ». The `ds.meaning.scan.error` key is the single source of the label; a host with its own copy of the text (`ds-storage-files.scan.error` in the main front) follows.
|
|
32
|
+
|
|
18
33
|
## 20.3.0
|
|
19
34
|
|
|
20
35
|
Card #788 (toasts above the fixed bottom bars).
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
import { DeliveryHistory } from '../../src/components/business/Deliveries/DeliveryHistory.component';
|
|
2
|
-
import type {
|
|
3
|
-
DeliveryArchiveActions,
|
|
4
|
-
DeliveryHistoryProps,
|
|
5
|
-
} from '../../src/components/business/Deliveries/deliveries.types';
|
|
6
|
-
import {
|
|
7
|
-
archivedDay,
|
|
8
|
-
archivedDelivery,
|
|
9
|
-
daysAgo,
|
|
10
|
-
delivery,
|
|
11
|
-
deliveryStatus,
|
|
12
|
-
failedDelivery,
|
|
13
|
-
page,
|
|
14
|
-
rehydratedDelivery,
|
|
15
|
-
rehydrationJob,
|
|
16
|
-
subscription,
|
|
17
|
-
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
18
|
-
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
19
|
-
|
|
20
|
-
const POPULATED = [
|
|
21
|
-
delivery(),
|
|
22
|
-
failedDelivery(),
|
|
23
|
-
delivery({
|
|
24
|
-
id: 'delivery-3',
|
|
25
|
-
eventKey: 'event-3',
|
|
26
|
-
deliveryId: 'sub-1:event-3',
|
|
27
|
-
status: deliveryStatus('RETRYING'),
|
|
28
|
-
attemptCount: 2,
|
|
29
|
-
lastResponseCode: 502,
|
|
30
|
-
lastResponseBody: null,
|
|
31
|
-
lastError: 'HTTP 502',
|
|
32
|
-
deliveredAt: null,
|
|
33
|
-
nextAttemptAt: new Date('2026-11-03T10:15:00Z'),
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
/** Past 30 days: one row archived, one brought back online. */
|
|
38
|
-
const WITH_ARCHIVE = [...POPULATED, archivedDelivery(), rehydratedDelivery()];
|
|
39
|
-
|
|
40
|
-
const ARCHIVE_JOB = rehydrationJob({
|
|
41
|
-
rangeStart: daysAgo(41),
|
|
42
|
-
rangeEnd: daysAgo(39),
|
|
43
|
-
effectiveExpiresAt: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const DeliveryHistoryPage = () => {
|
|
47
|
-
const { log } = useEventLog();
|
|
48
|
-
const archive: DeliveryArchiveActions = {
|
|
49
|
-
listDays: async () => [
|
|
50
|
-
archivedDay({ dayValue: '2026-09-20' }),
|
|
51
|
-
archivedDay({ dayValue: '2026-09-21', rowCount: 42 }),
|
|
52
|
-
],
|
|
53
|
-
listRehydrations: async () => ({ jobs: [ARCHIVE_JOB], truncated: false }),
|
|
54
|
-
estimate: async () => ({
|
|
55
|
-
admittedDays: ['2026-09-20'],
|
|
56
|
-
archiveBytes: 3 * 1024 * 1024,
|
|
57
|
-
expectedRows: 128,
|
|
58
|
-
skippedDays: [],
|
|
59
|
-
maxLeaseDays: 30,
|
|
60
|
-
}),
|
|
61
|
-
rehydrate: async (body) => {
|
|
62
|
-
log(`remettre en ligne ${body.rangeStart} - ${body.rangeEnd}`);
|
|
63
|
-
return { job: ARCHIVE_JOB, skippedDays: [] };
|
|
64
|
-
},
|
|
65
|
-
extend: async (jobId) => {
|
|
66
|
-
log(`prolonger ${jobId}`);
|
|
67
|
-
return ARCHIVE_JOB;
|
|
68
|
-
},
|
|
69
|
-
release: async (jobId) => {
|
|
70
|
-
log(`libérer ${jobId}`);
|
|
71
|
-
return ARCHIVE_JOB;
|
|
72
|
-
},
|
|
73
|
-
purge: async (body) => {
|
|
74
|
-
log(`supprimer de l'archive ${body.from} - ${body.to}`);
|
|
75
|
-
return { purgedDays: [body.from], deletedRows: 0, releasedJobs: 0 };
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
const base = (list: DeliveryHistoryProps['list']): DeliveryHistoryProps => ({
|
|
79
|
-
list,
|
|
80
|
-
get: async (id) => WITH_ARCHIVE.find((row) => row.id === id) ?? delivery(),
|
|
81
|
-
replayDelivery: async (id) => log(`rejouer ${id}`),
|
|
82
|
-
canReplay: true,
|
|
83
|
-
archive,
|
|
84
|
-
canManageArchive: true,
|
|
85
|
-
canPurgeArchive: true,
|
|
86
|
-
getSubscription: async () =>
|
|
87
|
-
subscription({
|
|
88
|
-
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
89
|
-
eventTypes: ['MONITOR_EVENT', 'MONITOR_SENTINEL'],
|
|
90
|
-
}),
|
|
91
|
-
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
92
|
-
});
|
|
93
|
-
return (
|
|
94
|
-
<Showcase
|
|
95
|
-
family="Métier"
|
|
96
|
-
name="DeliveryHistory"
|
|
97
|
-
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é), rejeu d'une livraison terminée (refusé au-delà de 30 jours) et section Archive : jours archivés, remises en ligne, suppression."
|
|
98
|
-
>
|
|
99
|
-
<Example title="Peuplé" maxWidth={1100}>
|
|
100
|
-
<DeliveryHistory {...base(async () => page(POPULATED))} />
|
|
101
|
-
</Example>
|
|
102
|
-
<Example
|
|
103
|
-
title="Avec une livraison archivée et une remise en ligne"
|
|
104
|
-
maxWidth={1100}
|
|
105
|
-
>
|
|
106
|
-
<DeliveryHistory {...base(async () => page(WITH_ARCHIVE))} />
|
|
107
|
-
</Example>
|
|
108
|
-
<Example title="Archive en lecture seule" maxWidth={1100}>
|
|
109
|
-
<DeliveryHistory
|
|
110
|
-
{...base(async () => page(WITH_ARCHIVE))}
|
|
111
|
-
canManageArchive={false}
|
|
112
|
-
canPurgeArchive={false}
|
|
113
|
-
/>
|
|
114
|
-
</Example>
|
|
115
|
-
<Example title="Vide" maxWidth={1100}>
|
|
116
|
-
<DeliveryHistory {...base(async () => page([]))} />
|
|
117
|
-
</Example>
|
|
118
|
-
<Example title="En cours de chargement" maxWidth={1100}>
|
|
119
|
-
<DeliveryHistory {...base(() => new Promise(() => undefined))} />
|
|
120
|
-
</Example>
|
|
121
|
-
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
122
|
-
<DeliveryHistory
|
|
123
|
-
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
124
|
-
/>
|
|
125
|
-
</Example>
|
|
126
|
-
<Example title="Sans abonnement ni lien vers Flow" maxWidth={1100}>
|
|
127
|
-
<DeliveryHistory
|
|
128
|
-
{...base(async () => page(POPULATED))}
|
|
129
|
-
getSubscription={undefined}
|
|
130
|
-
flowUrl={undefined}
|
|
131
|
-
/>
|
|
132
|
-
</Example>
|
|
133
|
-
<Example title="Sans droit de rejeu" maxWidth={1100}>
|
|
134
|
-
<DeliveryHistory
|
|
135
|
-
{...base(async () => page(POPULATED))}
|
|
136
|
-
canReplay={false}
|
|
137
|
-
/>
|
|
138
|
-
</Example>
|
|
139
|
-
<LastEvent />
|
|
140
|
-
</Showcase>
|
|
141
|
-
);
|
|
142
|
-
};
|
|
1
|
+
import { DeliveryHistory } from '../../src/components/business/Deliveries/DeliveryHistory.component';
|
|
2
|
+
import type {
|
|
3
|
+
DeliveryArchiveActions,
|
|
4
|
+
DeliveryHistoryProps,
|
|
5
|
+
} from '../../src/components/business/Deliveries/deliveries.types';
|
|
6
|
+
import {
|
|
7
|
+
archivedDay,
|
|
8
|
+
archivedDelivery,
|
|
9
|
+
daysAgo,
|
|
10
|
+
delivery,
|
|
11
|
+
deliveryStatus,
|
|
12
|
+
failedDelivery,
|
|
13
|
+
page,
|
|
14
|
+
rehydratedDelivery,
|
|
15
|
+
rehydrationJob,
|
|
16
|
+
subscription,
|
|
17
|
+
} from '../../src/components/business/Deliveries/test-support/deliveries.fixtures';
|
|
18
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
19
|
+
|
|
20
|
+
const POPULATED = [
|
|
21
|
+
delivery(),
|
|
22
|
+
failedDelivery(),
|
|
23
|
+
delivery({
|
|
24
|
+
id: 'delivery-3',
|
|
25
|
+
eventKey: 'event-3',
|
|
26
|
+
deliveryId: 'sub-1:event-3',
|
|
27
|
+
status: deliveryStatus('RETRYING'),
|
|
28
|
+
attemptCount: 2,
|
|
29
|
+
lastResponseCode: 502,
|
|
30
|
+
lastResponseBody: null,
|
|
31
|
+
lastError: 'HTTP 502',
|
|
32
|
+
deliveredAt: null,
|
|
33
|
+
nextAttemptAt: new Date('2026-11-03T10:15:00Z'),
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
/** Past 30 days: one row archived, one brought back online. */
|
|
38
|
+
const WITH_ARCHIVE = [...POPULATED, archivedDelivery(), rehydratedDelivery()];
|
|
39
|
+
|
|
40
|
+
const ARCHIVE_JOB = rehydrationJob({
|
|
41
|
+
rangeStart: daysAgo(41),
|
|
42
|
+
rangeEnd: daysAgo(39),
|
|
43
|
+
effectiveExpiresAt: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const DeliveryHistoryPage = () => {
|
|
47
|
+
const { log } = useEventLog();
|
|
48
|
+
const archive: DeliveryArchiveActions = {
|
|
49
|
+
listDays: async () => [
|
|
50
|
+
archivedDay({ dayValue: '2026-09-20' }),
|
|
51
|
+
archivedDay({ dayValue: '2026-09-21', rowCount: 42 }),
|
|
52
|
+
],
|
|
53
|
+
listRehydrations: async () => ({ jobs: [ARCHIVE_JOB], truncated: false }),
|
|
54
|
+
estimate: async () => ({
|
|
55
|
+
admittedDays: ['2026-09-20'],
|
|
56
|
+
archiveBytes: 3 * 1024 * 1024,
|
|
57
|
+
expectedRows: 128,
|
|
58
|
+
skippedDays: [],
|
|
59
|
+
maxLeaseDays: 30,
|
|
60
|
+
}),
|
|
61
|
+
rehydrate: async (body) => {
|
|
62
|
+
log(`remettre en ligne ${body.rangeStart} - ${body.rangeEnd}`);
|
|
63
|
+
return { job: ARCHIVE_JOB, skippedDays: [] };
|
|
64
|
+
},
|
|
65
|
+
extend: async (jobId) => {
|
|
66
|
+
log(`prolonger ${jobId}`);
|
|
67
|
+
return ARCHIVE_JOB;
|
|
68
|
+
},
|
|
69
|
+
release: async (jobId) => {
|
|
70
|
+
log(`libérer ${jobId}`);
|
|
71
|
+
return ARCHIVE_JOB;
|
|
72
|
+
},
|
|
73
|
+
purge: async (body) => {
|
|
74
|
+
log(`supprimer de l'archive ${body.from} - ${body.to}`);
|
|
75
|
+
return { purgedDays: [body.from], deletedRows: 0, releasedJobs: 0 };
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
const base = (list: DeliveryHistoryProps['list']): DeliveryHistoryProps => ({
|
|
79
|
+
list,
|
|
80
|
+
get: async (id) => WITH_ARCHIVE.find((row) => row.id === id) ?? delivery(),
|
|
81
|
+
replayDelivery: async (id) => log(`rejouer ${id}`),
|
|
82
|
+
canReplay: true,
|
|
83
|
+
archive,
|
|
84
|
+
canManageArchive: true,
|
|
85
|
+
canPurgeArchive: true,
|
|
86
|
+
getSubscription: async () =>
|
|
87
|
+
subscription({
|
|
88
|
+
url: 'https://ops.example.com/webhooks/abyss/monitor-events/production',
|
|
89
|
+
eventTypes: ['MONITOR_EVENT', 'MONITOR_SENTINEL'],
|
|
90
|
+
}),
|
|
91
|
+
flowUrl: 'https://flow.abyss.example/deliveries',
|
|
92
|
+
});
|
|
93
|
+
return (
|
|
94
|
+
<Showcase
|
|
95
|
+
family="Métier"
|
|
96
|
+
name="DeliveryHistory"
|
|
97
|
+
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é), rejeu d'une livraison terminée (refusé au-delà de 30 jours) et section Archive : jours archivés, remises en ligne, suppression."
|
|
98
|
+
>
|
|
99
|
+
<Example title="Peuplé" maxWidth={1100}>
|
|
100
|
+
<DeliveryHistory {...base(async () => page(POPULATED))} />
|
|
101
|
+
</Example>
|
|
102
|
+
<Example
|
|
103
|
+
title="Avec une livraison archivée et une remise en ligne"
|
|
104
|
+
maxWidth={1100}
|
|
105
|
+
>
|
|
106
|
+
<DeliveryHistory {...base(async () => page(WITH_ARCHIVE))} />
|
|
107
|
+
</Example>
|
|
108
|
+
<Example title="Archive en lecture seule" maxWidth={1100}>
|
|
109
|
+
<DeliveryHistory
|
|
110
|
+
{...base(async () => page(WITH_ARCHIVE))}
|
|
111
|
+
canManageArchive={false}
|
|
112
|
+
canPurgeArchive={false}
|
|
113
|
+
/>
|
|
114
|
+
</Example>
|
|
115
|
+
<Example title="Vide" maxWidth={1100}>
|
|
116
|
+
<DeliveryHistory {...base(async () => page([]))} />
|
|
117
|
+
</Example>
|
|
118
|
+
<Example title="En cours de chargement" maxWidth={1100}>
|
|
119
|
+
<DeliveryHistory {...base(() => new Promise(() => undefined))} />
|
|
120
|
+
</Example>
|
|
121
|
+
<Example title="Le chargement a échoué" maxWidth={1100}>
|
|
122
|
+
<DeliveryHistory
|
|
123
|
+
{...base(() => Promise.reject(new Error('Flow indisponible')))}
|
|
124
|
+
/>
|
|
125
|
+
</Example>
|
|
126
|
+
<Example title="Sans abonnement ni lien vers Flow" maxWidth={1100}>
|
|
127
|
+
<DeliveryHistory
|
|
128
|
+
{...base(async () => page(POPULATED))}
|
|
129
|
+
getSubscription={undefined}
|
|
130
|
+
flowUrl={undefined}
|
|
131
|
+
/>
|
|
132
|
+
</Example>
|
|
133
|
+
<Example title="Sans droit de rejeu" maxWidth={1100}>
|
|
134
|
+
<DeliveryHistory
|
|
135
|
+
{...base(async () => page(POPULATED))}
|
|
136
|
+
canReplay={false}
|
|
137
|
+
/>
|
|
138
|
+
</Example>
|
|
139
|
+
<LastEvent />
|
|
140
|
+
</Showcase>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
2
|
-
import { expect, test } from '@playwright/test';
|
|
3
|
-
import type { Page } from '@playwright/test';
|
|
4
|
-
import { CAPTURES, CAPTURES_DIR, VIEWPORT_HEIGHT } from '../captures-plan';
|
|
5
|
-
import type { CaptureState } from '../captures-plan';
|
|
6
|
-
import { openCatalogPage, settle } from './catalog-page';
|
|
7
|
-
|
|
8
|
-
// Criterion 13: one PNG per component in light and dark at 1440 px, plus 390 px for the
|
|
9
|
-
// components that change form below 768 px, and the two composed scenes at 1440 and 390 px.
|
|
10
|
-
|
|
11
|
-
/** Opens the « Actions » menu of the first row of the page and picks the item named `item`. */
|
|
12
|
-
const chooseRowAction = async (
|
|
13
|
-
page: Page,
|
|
14
|
-
item: string | RegExp,
|
|
15
|
-
): Promise<void> => {
|
|
16
|
-
await page
|
|
17
|
-
.getByRole('button', { name: /^Actions de / })
|
|
18
|
-
.first()
|
|
19
|
-
.click();
|
|
20
|
-
await page.getByRole('menuitem', { name: item }).click();
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/** How each state beyond arrival is reached, and what proves it is shown. */
|
|
24
|
-
const REACH: Record<
|
|
25
|
-
Exclude<CaptureState, 'arrival'>,
|
|
26
|
-
(page: Page) => Promise<void>
|
|
27
|
-
> = {
|
|
28
|
-
'sheet-open': async (page) => {
|
|
29
|
-
await page
|
|
30
|
-
.getByRole('button', { name: /avis-imposition-2026\.pdf/ })
|
|
31
|
-
.click();
|
|
32
|
-
await expect(
|
|
33
|
-
page.getByRole('dialog', { name: 'avis-imposition-2026.pdf' }),
|
|
34
|
-
).toBeVisible();
|
|
35
|
-
},
|
|
36
|
-
'list-open': async (page) => {
|
|
37
|
-
await page.getByRole('combobox').first().click();
|
|
38
|
-
await expect(page.getByRole('listbox')).toBeVisible();
|
|
39
|
-
},
|
|
40
|
-
'calendar-open': async (page) => {
|
|
41
|
-
await page
|
|
42
|
-
.getByRole('button', { name: /Choisir une date/ })
|
|
43
|
-
.first()
|
|
44
|
-
.click();
|
|
45
|
-
await expect(page.getByRole('dialog')).toBeVisible();
|
|
46
|
-
},
|
|
47
|
-
// The value of a list (six actions): the menu lists every action with its label.
|
|
48
|
-
'menu-open': async (page) => {
|
|
49
|
-
await page.getByRole('button', { name: /Actions sur requestId/ }).click();
|
|
50
|
-
const menu = page.getByRole('menu').or(page.getByRole('dialog'));
|
|
51
|
-
await expect(menu).toBeVisible();
|
|
52
|
-
await expect(menu.getByRole('menuitem')).toHaveCount(6);
|
|
53
|
-
},
|
|
54
|
-
// The delivery components: the first row's « Actions » menu, then the panel an action opens.
|
|
55
|
-
'form-open': async (page) => {
|
|
56
|
-
await page
|
|
57
|
-
.getByRole('button', { name: /^Nouvel(le)? (abonnement|tâche)$/ })
|
|
58
|
-
.first()
|
|
59
|
-
.click();
|
|
60
|
-
await expect(
|
|
61
|
-
page.getByRole('dialog', {
|
|
62
|
-
name: /^Nouvel abonnement$|^Nouvelle tâche planifiée$/,
|
|
63
|
-
}),
|
|
64
|
-
).toBeVisible();
|
|
65
|
-
},
|
|
66
|
-
'secret-shown': async (page) => {
|
|
67
|
-
await chooseRowAction(page, /Réinitialiser le secret|Régénérer le secret/);
|
|
68
|
-
await page
|
|
69
|
-
.getByRole('dialog')
|
|
70
|
-
.getByRole('button', { name: /^(Réinitialiser|Régénérer)$/ })
|
|
71
|
-
.click();
|
|
72
|
-
await expect(
|
|
73
|
-
page.getByText(/Ce secret n’est affiché qu’une seule fois/),
|
|
74
|
-
).toBeVisible();
|
|
75
|
-
},
|
|
76
|
-
'delete-confirm': async (page) => {
|
|
77
|
-
await chooseRowAction(page, 'Supprimer');
|
|
78
|
-
await expect(
|
|
79
|
-
page.getByRole('dialog', { name: /^Supprimer cet(te)? / }),
|
|
80
|
-
).toBeVisible();
|
|
81
|
-
},
|
|
82
|
-
'detail-open': async (page) => {
|
|
83
|
-
await chooseRowAction(page, 'Détail de la livraison');
|
|
84
|
-
await expect(
|
|
85
|
-
page.getByRole('dialog', { name: 'Détail de la livraison' }),
|
|
86
|
-
).toBeVisible();
|
|
87
|
-
await expect(page.getByText('x-abyss-delivery-id').first()).toBeVisible();
|
|
88
|
-
},
|
|
89
|
-
'runs-open': async (page) => {
|
|
90
|
-
await chooseRowAction(page, 'Exécutions');
|
|
91
|
-
await expect(
|
|
92
|
-
page.getByRole('dialog', { name: /^Exécutions de / }),
|
|
93
|
-
).toBeVisible();
|
|
94
|
-
await expect(page.getByText('Réussie').first()).toBeVisible();
|
|
95
|
-
},
|
|
96
|
-
// The detail of a run, in the panel of its task: the list gives way to it.
|
|
97
|
-
'run-detail-open': async (page) => {
|
|
98
|
-
await chooseRowAction(page, 'Exécutions');
|
|
99
|
-
const panel = page.getByRole('dialog', { name: /^Exécutions de / });
|
|
100
|
-
await panel
|
|
101
|
-
.getByRole('button', { name: /^Actions de / })
|
|
102
|
-
.first()
|
|
103
|
-
.click();
|
|
104
|
-
await page.getByRole('menuitem', { name: 'Détail de l’exécution' }).click();
|
|
105
|
-
await expect(panel.getByText('x-request-id')).toBeVisible();
|
|
106
|
-
},
|
|
107
|
-
// The cookie banner's settings: the banner leaves while the sheet is open.
|
|
108
|
-
'settings-open': async (page) => {
|
|
109
|
-
await page.getByRole('button', { name: 'Personnaliser' }).click();
|
|
110
|
-
await expect(
|
|
111
|
-
page.getByRole('dialog', { name: 'Personnaliser mes cookies' }),
|
|
112
|
-
).toBeVisible();
|
|
113
|
-
await expect(
|
|
114
|
-
page.getByRole('dialog', { name: 'Vos préférences de cookies' }),
|
|
115
|
-
).toHaveCount(0);
|
|
116
|
-
},
|
|
117
|
-
// The first top bar trigger of the page: the notifications bell or the account avatar.
|
|
118
|
-
'panel-open': async (page) => {
|
|
119
|
-
await page.locator('[aria-haspopup]').first().click();
|
|
120
|
-
await expect(
|
|
121
|
-
page.getByRole('dialog').or(page.getByRole('menu')),
|
|
122
|
-
).toBeVisible();
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
for (const capture of CAPTURES) {
|
|
127
|
-
test(`capture ${capture.file}`, async ({ page }) => {
|
|
128
|
-
await openCatalogPage(page, capture.entry.name, capture.theme, {
|
|
129
|
-
width: capture.width,
|
|
130
|
-
height: VIEWPORT_HEIGHT[capture.width],
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
if (capture.state !== 'arrival') {
|
|
134
|
-
await REACH[capture.state](page);
|
|
135
|
-
await settle(page);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// A taller window rather than `fullPage`: the sticky sidebar (`100vh`) then spans the whole
|
|
139
|
-
// page, as it does on screen while scrolling. A mobile frame (`100dvh`) is never taller.
|
|
140
|
-
const documentHeight = await page.evaluate(
|
|
141
|
-
() => document.documentElement.scrollHeight,
|
|
142
|
-
);
|
|
143
|
-
if (documentHeight > VIEWPORT_HEIGHT[capture.width]) {
|
|
144
|
-
await page.setViewportSize({
|
|
145
|
-
width: capture.width,
|
|
146
|
-
height: documentHeight,
|
|
147
|
-
});
|
|
148
|
-
await settle(page);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
await page.screenshot({
|
|
152
|
-
path: resolve(CAPTURES_DIR, capture.file),
|
|
153
|
-
animations: 'disabled',
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { expect, test } from '@playwright/test';
|
|
3
|
+
import type { Page } from '@playwright/test';
|
|
4
|
+
import { CAPTURES, CAPTURES_DIR, VIEWPORT_HEIGHT } from '../captures-plan';
|
|
5
|
+
import type { CaptureState } from '../captures-plan';
|
|
6
|
+
import { openCatalogPage, settle } from './catalog-page';
|
|
7
|
+
|
|
8
|
+
// Criterion 13: one PNG per component in light and dark at 1440 px, plus 390 px for the
|
|
9
|
+
// components that change form below 768 px, and the two composed scenes at 1440 and 390 px.
|
|
10
|
+
|
|
11
|
+
/** Opens the « Actions » menu of the first row of the page and picks the item named `item`. */
|
|
12
|
+
const chooseRowAction = async (
|
|
13
|
+
page: Page,
|
|
14
|
+
item: string | RegExp,
|
|
15
|
+
): Promise<void> => {
|
|
16
|
+
await page
|
|
17
|
+
.getByRole('button', { name: /^Actions de / })
|
|
18
|
+
.first()
|
|
19
|
+
.click();
|
|
20
|
+
await page.getByRole('menuitem', { name: item }).click();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** How each state beyond arrival is reached, and what proves it is shown. */
|
|
24
|
+
const REACH: Record<
|
|
25
|
+
Exclude<CaptureState, 'arrival'>,
|
|
26
|
+
(page: Page) => Promise<void>
|
|
27
|
+
> = {
|
|
28
|
+
'sheet-open': async (page) => {
|
|
29
|
+
await page
|
|
30
|
+
.getByRole('button', { name: /avis-imposition-2026\.pdf/ })
|
|
31
|
+
.click();
|
|
32
|
+
await expect(
|
|
33
|
+
page.getByRole('dialog', { name: 'avis-imposition-2026.pdf' }),
|
|
34
|
+
).toBeVisible();
|
|
35
|
+
},
|
|
36
|
+
'list-open': async (page) => {
|
|
37
|
+
await page.getByRole('combobox').first().click();
|
|
38
|
+
await expect(page.getByRole('listbox')).toBeVisible();
|
|
39
|
+
},
|
|
40
|
+
'calendar-open': async (page) => {
|
|
41
|
+
await page
|
|
42
|
+
.getByRole('button', { name: /Choisir une date/ })
|
|
43
|
+
.first()
|
|
44
|
+
.click();
|
|
45
|
+
await expect(page.getByRole('dialog')).toBeVisible();
|
|
46
|
+
},
|
|
47
|
+
// The value of a list (six actions): the menu lists every action with its label.
|
|
48
|
+
'menu-open': async (page) => {
|
|
49
|
+
await page.getByRole('button', { name: /Actions sur requestId/ }).click();
|
|
50
|
+
const menu = page.getByRole('menu').or(page.getByRole('dialog'));
|
|
51
|
+
await expect(menu).toBeVisible();
|
|
52
|
+
await expect(menu.getByRole('menuitem')).toHaveCount(6);
|
|
53
|
+
},
|
|
54
|
+
// The delivery components: the first row's « Actions » menu, then the panel an action opens.
|
|
55
|
+
'form-open': async (page) => {
|
|
56
|
+
await page
|
|
57
|
+
.getByRole('button', { name: /^Nouvel(le)? (abonnement|tâche)$/ })
|
|
58
|
+
.first()
|
|
59
|
+
.click();
|
|
60
|
+
await expect(
|
|
61
|
+
page.getByRole('dialog', {
|
|
62
|
+
name: /^Nouvel abonnement$|^Nouvelle tâche planifiée$/,
|
|
63
|
+
}),
|
|
64
|
+
).toBeVisible();
|
|
65
|
+
},
|
|
66
|
+
'secret-shown': async (page) => {
|
|
67
|
+
await chooseRowAction(page, /Réinitialiser le secret|Régénérer le secret/);
|
|
68
|
+
await page
|
|
69
|
+
.getByRole('dialog')
|
|
70
|
+
.getByRole('button', { name: /^(Réinitialiser|Régénérer)$/ })
|
|
71
|
+
.click();
|
|
72
|
+
await expect(
|
|
73
|
+
page.getByText(/Ce secret n’est affiché qu’une seule fois/),
|
|
74
|
+
).toBeVisible();
|
|
75
|
+
},
|
|
76
|
+
'delete-confirm': async (page) => {
|
|
77
|
+
await chooseRowAction(page, 'Supprimer');
|
|
78
|
+
await expect(
|
|
79
|
+
page.getByRole('dialog', { name: /^Supprimer cet(te)? / }),
|
|
80
|
+
).toBeVisible();
|
|
81
|
+
},
|
|
82
|
+
'detail-open': async (page) => {
|
|
83
|
+
await chooseRowAction(page, 'Détail de la livraison');
|
|
84
|
+
await expect(
|
|
85
|
+
page.getByRole('dialog', { name: 'Détail de la livraison' }),
|
|
86
|
+
).toBeVisible();
|
|
87
|
+
await expect(page.getByText('x-abyss-delivery-id').first()).toBeVisible();
|
|
88
|
+
},
|
|
89
|
+
'runs-open': async (page) => {
|
|
90
|
+
await chooseRowAction(page, 'Exécutions');
|
|
91
|
+
await expect(
|
|
92
|
+
page.getByRole('dialog', { name: /^Exécutions de / }),
|
|
93
|
+
).toBeVisible();
|
|
94
|
+
await expect(page.getByText('Réussie').first()).toBeVisible();
|
|
95
|
+
},
|
|
96
|
+
// The detail of a run, in the panel of its task: the list gives way to it.
|
|
97
|
+
'run-detail-open': async (page) => {
|
|
98
|
+
await chooseRowAction(page, 'Exécutions');
|
|
99
|
+
const panel = page.getByRole('dialog', { name: /^Exécutions de / });
|
|
100
|
+
await panel
|
|
101
|
+
.getByRole('button', { name: /^Actions de / })
|
|
102
|
+
.first()
|
|
103
|
+
.click();
|
|
104
|
+
await page.getByRole('menuitem', { name: 'Détail de l’exécution' }).click();
|
|
105
|
+
await expect(panel.getByText('x-request-id')).toBeVisible();
|
|
106
|
+
},
|
|
107
|
+
// The cookie banner's settings: the banner leaves while the sheet is open.
|
|
108
|
+
'settings-open': async (page) => {
|
|
109
|
+
await page.getByRole('button', { name: 'Personnaliser' }).click();
|
|
110
|
+
await expect(
|
|
111
|
+
page.getByRole('dialog', { name: 'Personnaliser mes cookies' }),
|
|
112
|
+
).toBeVisible();
|
|
113
|
+
await expect(
|
|
114
|
+
page.getByRole('dialog', { name: 'Vos préférences de cookies' }),
|
|
115
|
+
).toHaveCount(0);
|
|
116
|
+
},
|
|
117
|
+
// The first top bar trigger of the page: the notifications bell or the account avatar.
|
|
118
|
+
'panel-open': async (page) => {
|
|
119
|
+
await page.locator('[aria-haspopup]').first().click();
|
|
120
|
+
await expect(
|
|
121
|
+
page.getByRole('dialog').or(page.getByRole('menu')),
|
|
122
|
+
).toBeVisible();
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
for (const capture of CAPTURES) {
|
|
127
|
+
test(`capture ${capture.file}`, async ({ page }) => {
|
|
128
|
+
await openCatalogPage(page, capture.entry.name, capture.theme, {
|
|
129
|
+
width: capture.width,
|
|
130
|
+
height: VIEWPORT_HEIGHT[capture.width],
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (capture.state !== 'arrival') {
|
|
134
|
+
await REACH[capture.state](page);
|
|
135
|
+
await settle(page);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// A taller window rather than `fullPage`: the sticky sidebar (`100vh`) then spans the whole
|
|
139
|
+
// page, as it does on screen while scrolling. A mobile frame (`100dvh`) is never taller.
|
|
140
|
+
const documentHeight = await page.evaluate(
|
|
141
|
+
() => document.documentElement.scrollHeight,
|
|
142
|
+
);
|
|
143
|
+
if (documentHeight > VIEWPORT_HEIGHT[capture.width]) {
|
|
144
|
+
await page.setViewportSize({
|
|
145
|
+
width: capture.width,
|
|
146
|
+
height: documentHeight,
|
|
147
|
+
});
|
|
148
|
+
await settle(page);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
await page.screenshot({
|
|
152
|
+
path: resolve(CAPTURES_DIR, capture.file),
|
|
153
|
+
animations: 'disabled',
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|