@stapel/alerts-react 0.1.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 +109 -0
- package/LICENSE +21 -0
- package/MODULE.md +140 -0
- package/README.md +147 -0
- package/dist/analytics/events.d.ts +29 -0
- package/dist/analytics/events.d.ts.map +1 -0
- package/dist/analytics/events.js +28 -0
- package/dist/analytics/events.js.map +1 -0
- package/dist/api/alertsApi.d.ts +84 -0
- package/dist/api/alertsApi.d.ts.map +1 -0
- package/dist/api/alertsApi.js +127 -0
- package/dist/api/alertsApi.js.map +1 -0
- package/dist/api/generated/schema.d.ts +453 -0
- package/dist/api/generated/schema.d.ts.map +1 -0
- package/dist/api/generated/schema.js +2 -0
- package/dist/api/generated/schema.js.map +1 -0
- package/dist/api/types.d.ts +78 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +44 -0
- package/dist/api/types.js.map +1 -0
- package/dist/default/FixIssueDialog.d.ts +15 -0
- package/dist/default/FixIssueDialog.d.ts.map +1 -0
- package/dist/default/FixIssueDialog.js +67 -0
- package/dist/default/FixIssueDialog.js.map +1 -0
- package/dist/default/IssueDetail.d.ts +10 -0
- package/dist/default/IssueDetail.d.ts.map +1 -0
- package/dist/default/IssueDetail.js +83 -0
- package/dist/default/IssueDetail.js.map +1 -0
- package/dist/default/IssueFilterBar.d.ts +21 -0
- package/dist/default/IssueFilterBar.d.ts.map +1 -0
- package/dist/default/IssueFilterBar.js +86 -0
- package/dist/default/IssueFilterBar.js.map +1 -0
- package/dist/default/IssuesFeed.d.ts +10 -0
- package/dist/default/IssuesFeed.d.ts.map +1 -0
- package/dist/default/IssuesFeed.js +137 -0
- package/dist/default/IssuesFeed.js.map +1 -0
- package/dist/default/MuteIssueDialog.d.ts +19 -0
- package/dist/default/MuteIssueDialog.d.ts.map +1 -0
- package/dist/default/MuteIssueDialog.js +72 -0
- package/dist/default/MuteIssueDialog.js.map +1 -0
- package/dist/default/index.d.ts +32 -0
- package/dist/default/index.d.ts.map +1 -0
- package/dist/default/index.js +26 -0
- package/dist/default/index.js.map +1 -0
- package/dist/default/labels.d.ts +40 -0
- package/dist/default/labels.d.ts.map +1 -0
- package/dist/default/labels.js +94 -0
- package/dist/default/labels.js.map +1 -0
- package/dist/default/layout.d.ts +32 -0
- package/dist/default/layout.d.ts.map +1 -0
- package/dist/default/layout.js +44 -0
- package/dist/default/layout.js.map +1 -0
- package/dist/default/types.d.ts +27 -0
- package/dist/default/types.d.ts.map +1 -0
- package/dist/default/types.js +2 -0
- package/dist/default/types.js.map +1 -0
- package/dist/flows/errors.d.ts +12 -0
- package/dist/flows/errors.d.ts.map +1 -0
- package/dist/flows/errors.js +13 -0
- package/dist/flows/errors.js.map +1 -0
- package/dist/flows/registry.d.ts +22 -0
- package/dist/flows/registry.d.ts.map +1 -0
- package/dist/flows/registry.js +20 -0
- package/dist/flows/registry.js.map +1 -0
- package/dist/headless/AlertsProvider.d.ts +19 -0
- package/dist/headless/AlertsProvider.d.ts.map +1 -0
- package/dist/headless/AlertsProvider.js +15 -0
- package/dist/headless/AlertsProvider.js.map +1 -0
- package/dist/i18n/errorsMap.d.ts +10 -0
- package/dist/i18n/errorsMap.d.ts.map +1 -0
- package/dist/i18n/errorsMap.js +20 -0
- package/dist/i18n/errorsMap.js.map +1 -0
- package/dist/i18n/es.d.ts +20 -0
- package/dist/i18n/es.d.ts.map +1 -0
- package/dist/i18n/es.js +152 -0
- package/dist/i18n/es.js.map +1 -0
- package/dist/i18n/generated/errors.es.gen.d.ts +9 -0
- package/dist/i18n/generated/errors.es.gen.d.ts.map +1 -0
- package/dist/i18n/generated/errors.es.gen.js +57 -0
- package/dist/i18n/generated/errors.es.gen.js.map +1 -0
- package/dist/i18n/generated/errors.gen.d.ts +323 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -0
- package/dist/i18n/generated/errors.gen.js +165 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -0
- package/dist/i18n/generated/errors.ru.gen.d.ts +9 -0
- package/dist/i18n/generated/errors.ru.gen.d.ts.map +1 -0
- package/dist/i18n/generated/errors.ru.gen.js +57 -0
- package/dist/i18n/generated/errors.ru.gen.js.map +1 -0
- package/dist/i18n/keys.d.ts +164 -0
- package/dist/i18n/keys.d.ts.map +1 -0
- package/dist/i18n/keys.js +300 -0
- package/dist/i18n/keys.js.map +1 -0
- package/dist/i18n/ru.d.ts +27 -0
- package/dist/i18n/ru.d.ts.map +1 -0
- package/dist/i18n/ru.js +159 -0
- package/dist/i18n/ru.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/model/context.d.ts +11 -0
- package/dist/model/context.d.ts.map +1 -0
- package/dist/model/context.js +16 -0
- package/dist/model/context.js.map +1 -0
- package/dist/model/issues.d.ts +103 -0
- package/dist/model/issues.d.ts.map +1 -0
- package/dist/model/issues.js +230 -0
- package/dist/model/issues.js.map +1 -0
- package/dist/model/queryKeys.d.ts +11 -0
- package/dist/model/queryKeys.d.ts.map +1 -0
- package/dist/model/queryKeys.js +32 -0
- package/dist/model/queryKeys.js.map +1 -0
- package/dist/model/refusals.d.ts +25 -0
- package/dist/model/refusals.d.ts.map +1 -0
- package/dist/model/refusals.js +73 -0
- package/dist/model/refusals.js.map +1 -0
- package/dist/model/runtime.d.ts +51 -0
- package/dist/model/runtime.d.ts.map +1 -0
- package/dist/model/runtime.js +29 -0
- package/dist/model/runtime.js.map +1 -0
- package/dist/model/status.d.ts +60 -0
- package/dist/model/status.d.ts.map +1 -0
- package/dist/model/status.js +116 -0
- package/dist/model/status.js.map +1 -0
- package/dist/nav/manifest.d.ts +43 -0
- package/dist/nav/manifest.d.ts.map +1 -0
- package/dist/nav/manifest.js +36 -0
- package/dist/nav/manifest.js.map +1 -0
- package/llms.txt +84 -0
- package/manifest.json +694 -0
- package/nav-manifest.json +46 -0
- package/package.json +119 -0
- package/src/analytics/events.ts +29 -0
- package/src/analytics/generated/events.json +7 -0
- package/src/api/alertsApi.ts +259 -0
- package/src/api/generated/schema.ts +455 -0
- package/src/api/types.ts +113 -0
- package/src/default/FixIssueDialog.tsx +158 -0
- package/src/default/IssueDetail.tsx +431 -0
- package/src/default/IssueFilterBar.tsx +197 -0
- package/src/default/IssuesFeed.tsx +343 -0
- package/src/default/MuteIssueDialog.tsx +186 -0
- package/src/default/index.ts +37 -0
- package/src/default/labels.ts +113 -0
- package/src/default/layout.ts +52 -0
- package/src/default/types.ts +27 -0
- package/src/flows/errors.ts +16 -0
- package/src/flows/registry.ts +32 -0
- package/src/headless/AlertsProvider.tsx +20 -0
- package/src/i18n/errorsMap.ts +31 -0
- package/src/i18n/es.ts +181 -0
- package/src/i18n/generated/errors.es.gen.ts +63 -0
- package/src/i18n/generated/errors.gen.ts +196 -0
- package/src/i18n/generated/errors.json +370 -0
- package/src/i18n/generated/errors.ru.gen.ts +63 -0
- package/src/i18n/keys.ts +341 -0
- package/src/i18n/ru.ts +188 -0
- package/src/index.ts +152 -0
- package/src/model/context.tsx +28 -0
- package/src/model/issues.ts +311 -0
- package/src/model/queryKeys.ts +41 -0
- package/src/model/refusals.ts +82 -0
- package/src/model/runtime.ts +80 -0
- package/src/model/status.ts +179 -0
- package/src/nav/manifest.ts +76 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* `<IssuesFeed>` — the triage board: every bug this fleet has recorded, one
|
|
4
|
+
* row each, grouped by the service that reported it.
|
|
5
|
+
*
|
|
6
|
+
* ── Grouped by service, worst first ───────────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* The wire order is "newest activity first", which answers "what moved" and
|
|
9
|
+
* not "what is broken". In a fleet of a dozen services those are different
|
|
10
|
+
* questions and the second one is why somebody opened this screen: a single
|
|
11
|
+
* service throwing fatals is an outage, and the same twelve rows interleaved
|
|
12
|
+
* with everybody's warnings reads as background noise. So the page is grouped
|
|
13
|
+
* (`groupIssuesByService`) and the groups are ordered by their worst level and
|
|
14
|
+
* then by how loud they are — never alphabetically, which would file an outage
|
|
15
|
+
* under whatever letter it starts with.
|
|
16
|
+
*
|
|
17
|
+
* ── The three refusals are three different sentences ──────────────────────
|
|
18
|
+
*
|
|
19
|
+
* Every route here is `IsStaffUser`. A 403 means "signed in as the wrong
|
|
20
|
+
* account", a 401 means "sign in again", and anything else is a failure to
|
|
21
|
+
* READ the tracker. All three are named, and none of them is ever drawn as an
|
|
22
|
+
* empty table: "nothing is broken" is the one sentence an error tracker must
|
|
23
|
+
* not say by accident.
|
|
24
|
+
*
|
|
25
|
+
* ── The poll is conditional and says so quietly ───────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* There is no stream in this module. The feed re-asks on the runtime's
|
|
28
|
+
* interval with the `ETag` it holds, so the usual answer is a 304 and nothing
|
|
29
|
+
* repaints. "Up to date" is one line of secondary text rather than a spinner,
|
|
30
|
+
* because a board that flickers every minute is a board nobody leaves open.
|
|
31
|
+
*/
|
|
32
|
+
import { useState } from "react";
|
|
33
|
+
import { Card, Flex, Typography } from "antd";
|
|
34
|
+
import { spacing } from "@stapel/tokens";
|
|
35
|
+
import { DataTable, EmptyState, ErrorAlert, Page, SkinButton, StatusTag, } from "@stapel/tokens-antd/skin";
|
|
36
|
+
import { matchList, useFormat, useT } from "@stapel/core";
|
|
37
|
+
import { clearedIssueFilters, useIssues } from "../model/issues.js";
|
|
38
|
+
import { isAlertsStaffOnly, isAlertsUnauthorized, } from "../model/refusals.js";
|
|
39
|
+
import { ALERTS_I18N_KEYS } from "../i18n/keys.js";
|
|
40
|
+
import { IssueFilterBar } from "./IssueFilterBar.js";
|
|
41
|
+
import { levelFamily, levelKey, statusFamily, statusKey } from "./labels.js";
|
|
42
|
+
export function IssuesFeed(props) {
|
|
43
|
+
const t = useT();
|
|
44
|
+
const fmt = useFormat();
|
|
45
|
+
const testId = props.testId ?? "alerts-feed";
|
|
46
|
+
const [filters, setFilters] = useState(props.initialFilters ?? {});
|
|
47
|
+
const bag = useIssues(filters);
|
|
48
|
+
const absent = t(ALERTS_I18N_KEYS.none);
|
|
49
|
+
// `limit` is a page size, not a filter: it must not turn "nothing has
|
|
50
|
+
// failed" into "nothing matches these filters".
|
|
51
|
+
const anyFilter = Object.keys(filters).some((key) => key !== "limit");
|
|
52
|
+
// The services the caller can actually offer the filter bar: the ones on
|
|
53
|
+
// this page. The tracker serves no service registry (there is a `Service`
|
|
54
|
+
// table, and it is the reporters' key store, not a directory of names an
|
|
55
|
+
// operator may filter by), so inventing a fuller list would mean inventing.
|
|
56
|
+
const services = bag.rows.status === "ready"
|
|
57
|
+
? [...new Set(bag.rows.data.map((row) => row.service))].sort()
|
|
58
|
+
: [];
|
|
59
|
+
const rowActions = (row) => {
|
|
60
|
+
const href = props.issueHref?.(row.id);
|
|
61
|
+
if (href === undefined && props.onOpenIssue === undefined)
|
|
62
|
+
return [];
|
|
63
|
+
return [
|
|
64
|
+
{
|
|
65
|
+
key: "open",
|
|
66
|
+
label: t(ALERTS_I18N_KEYS.rowOpen),
|
|
67
|
+
primary: true,
|
|
68
|
+
testId: `${testId}-open-${row.id}`,
|
|
69
|
+
...(href !== undefined
|
|
70
|
+
? { href }
|
|
71
|
+
: { onClick: () => props.onOpenIssue?.(row.id) }),
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
const group = (entry) => (_jsx(Card, { size: "small", title: _jsxs(Flex, { gap: spacing[2], align: "center", wrap: true, children: [_jsx(StatusTag, { status: levelFamily(entry.worstLevel), testId: `${testId}-group-level-${entry.service}`, children: t(levelKey(entry.worstLevel), { level: entry.worstLevel }) }), _jsx(Typography.Text, { strong: true, children: entry.service })] }), extra: _jsx(Typography.Text, { type: "secondary", children: t(ALERTS_I18N_KEYS.feedGroupSummary, {
|
|
76
|
+
issues: entry.issues.length,
|
|
77
|
+
count: entry.count,
|
|
78
|
+
}) }), "data-testid": `${testId}-group-${entry.service}`, children: _jsx(DataTable, { rows: entry.issues, rowKey: (row) => row.id, ariaLabel: entry.service, testId: `${testId}-rows-${entry.service}`, rowActions: rowActions, columns: [
|
|
79
|
+
{
|
|
80
|
+
key: "title",
|
|
81
|
+
title: t(ALERTS_I18N_KEYS.colIssue),
|
|
82
|
+
cardRole: "title",
|
|
83
|
+
render: (row) => (_jsxs(Flex, { vertical: true, children: [_jsx(Typography.Text, { children: row.title }), _jsx(Typography.Text, { type: "secondary", children: row.culprit.length > 0 ? row.culprit : absent })] })),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "level",
|
|
87
|
+
title: t(ALERTS_I18N_KEYS.colLevel),
|
|
88
|
+
cardRole: "badge",
|
|
89
|
+
render: (row) => (_jsx(StatusTag, { status: levelFamily(row.level), testId: `${testId}-level-${row.id}`, children: t(levelKey(row.level), { level: row.level }) })),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: "status",
|
|
93
|
+
title: t(ALERTS_I18N_KEYS.colStatus),
|
|
94
|
+
cardRole: "badge",
|
|
95
|
+
render: (row) => (_jsx(StatusTag, { status: statusFamily(row.status), testId: `${testId}-status-${row.id}`, children: t(statusKey(row.status), { status: row.status }) })),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "count",
|
|
99
|
+
title: t(ALERTS_I18N_KEYS.colCount),
|
|
100
|
+
align: "end",
|
|
101
|
+
render: (row) => (_jsxs(Flex, { vertical: true, align: "end", children: [_jsx(Typography.Text, { children: String(row.count) }), row.status === "regressed" ? (_jsx(Typography.Text, { type: "secondary", children: t(ALERTS_I18N_KEYS.rowSinceFix, {
|
|
102
|
+
count: row.count_since_fix,
|
|
103
|
+
}) })) : null] })),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "seen",
|
|
107
|
+
title: t(ALERTS_I18N_KEYS.colLastSeen),
|
|
108
|
+
render: (row) => (_jsxs(Flex, { vertical: true, children: [_jsx(Typography.Text, { children: fmt.relative(row.last_seen) ?? absent }), _jsx(Typography.Text, { type: "secondary", children: t(ALERTS_I18N_KEYS.rowSeenRange, {
|
|
109
|
+
first: fmt.relative(row.first_seen) ?? absent,
|
|
110
|
+
last: fmt.relative(row.last_seen) ?? absent,
|
|
111
|
+
}) })] })),
|
|
112
|
+
},
|
|
113
|
+
] }) }, entry.service));
|
|
114
|
+
const from = bag.total === 0 ? 0 : bag.offset + 1;
|
|
115
|
+
const to = Math.min(bag.offset + bag.pageSize, bag.total);
|
|
116
|
+
return (_jsx(Page, { title: t(ALERTS_I18N_KEYS.feedTitle), intro: t(ALERTS_I18N_KEYS.feedIntro), "data-testid": testId, ...(props.mode !== undefined ? { mode: props.mode } : {}), actions: _jsxs(Flex, { gap: spacing[2], align: "center", children: [_jsx(Typography.Text, { type: "secondary", "data-testid": `${testId}-freshness`, children: bag.isFetching
|
|
117
|
+
? t(ALERTS_I18N_KEYS.feedChecking)
|
|
118
|
+
: t(ALERTS_I18N_KEYS.feedUpToDate) }), _jsx(SkinButton, { size: "small", "data-testid": `${testId}-refresh`, "data-analytics": "none", "data-analytics-reason": "a conditional re-read of a board \u2014 no decision was taken", onClick: bag.refetch, children: t(ALERTS_I18N_KEYS.feedRefresh) })] }), children: _jsxs(Flex, { vertical: true, gap: spacing[4], children: [_jsx(IssueFilterBar, { value: filters, onChange: setFilters, services: services, testId: `${testId}-filters`, ...(props.mode !== undefined ? { mode: props.mode } : {}) }), matchList(bag.groups, {
|
|
119
|
+
loading: () => (_jsx(Typography.Text, { type: "secondary", "data-testid": `${testId}-loading`, children: t(ALERTS_I18N_KEYS.feedLoading) })),
|
|
120
|
+
failed: (error) => isAlertsStaffOnly(error) ? (_jsx(EmptyState, { testId: `${testId}-staff-only`, title: t(ALERTS_I18N_KEYS.feedStaffOnly), hint: t(ALERTS_I18N_KEYS.feedStaffOnlyHint) })) : isAlertsUnauthorized(error) ? (_jsx(EmptyState, { testId: `${testId}-signed-out`, title: t(ALERTS_I18N_KEYS.feedSignedOut), hint: t(ALERTS_I18N_KEYS.feedSignedOutHint) })) : (_jsx(ErrorAlert, { testId: `${testId}-failed`, thrown: error, message: t(ALERTS_I18N_KEYS.feedFailed), onRetry: bag.refetch })),
|
|
121
|
+
empty: () => (_jsx(EmptyState, { testId: `${testId}-empty`, title: t(anyFilter
|
|
122
|
+
? ALERTS_I18N_KEYS.feedEmptyFiltered
|
|
123
|
+
: ALERTS_I18N_KEYS.feedEmpty), hint: t(anyFilter
|
|
124
|
+
? ALERTS_I18N_KEYS.feedEmptyFilteredHint
|
|
125
|
+
: ALERTS_I18N_KEYS.feedEmptyHint), ...(anyFilter
|
|
126
|
+
? {
|
|
127
|
+
action: (_jsx(SkinButton, { "data-testid": `${testId}-empty-clear`, "data-analytics": "none", "data-analytics-reason": "clearing a filter is a view change, not a decision about a bug", onClick: () => setFilters(clearedIssueFilters(filters)), children: t(ALERTS_I18N_KEYS.filterClear) })),
|
|
128
|
+
}
|
|
129
|
+
: {}) })),
|
|
130
|
+
ready: (groups) => (_jsxs(Flex, { vertical: true, gap: spacing[4], "data-testid": `${testId}-groups`, children: [groups.map(group), _jsxs(Flex, { gap: spacing[3], align: "center", justify: "end", wrap: true, children: [_jsx(Typography.Text, { type: "secondary", "data-testid": `${testId}-range`, children: t(ALERTS_I18N_KEYS.feedRange, {
|
|
131
|
+
from,
|
|
132
|
+
to,
|
|
133
|
+
total: bag.total,
|
|
134
|
+
}) }), _jsx(SkinButton, { size: "small", disabled: !bag.hasPrevious, "data-testid": `${testId}-previous`, "data-analytics": "none", "data-analytics-reason": "paging a board \u2014 no decision was taken about a bug", onClick: bag.previousPage, children: t(ALERTS_I18N_KEYS.feedPrevious) }), _jsx(SkinButton, { size: "small", disabled: !bag.hasNext, "data-testid": `${testId}-next`, "data-analytics": "none", "data-analytics-reason": "paging a board \u2014 no decision was taken about a bug", onClick: bag.nextPage, children: t(ALERTS_I18N_KEYS.feedNext) })] })] })),
|
|
135
|
+
})] }) }));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=IssuesFeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IssuesFeed.js","sourceRoot":"","sources":["../../src/default/IssuesFeed.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,IAAI,EACJ,UAAU,EACV,SAAS,GACV,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7E,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,aAAa,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CACpC,KAAK,CAAC,cAAc,IAAI,EAAE,CAC3B,CAAC;IACF,MAAM,GAAG,GAAG,SAAS,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,GAAG,CAAC,QAAQ,YAEpB,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAClB,IACR,IACF,CACR;iBACF,CAAC,IACG,GACF,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { IssueLevel } from "../api/types.js";
|
|
3
|
+
import type { ThemeModeProp } from "./types.js";
|
|
4
|
+
/** How long a mute lasts. `forever` sends an explicit `null`. */
|
|
5
|
+
export type MuteWindow = "day" | "week" | "month" | "forever";
|
|
6
|
+
/** The instant a window means, taken from the clock at the moment of the choice. */
|
|
7
|
+
export declare function mutedUntilFor(span: MuteWindow, now?: Date): string | null;
|
|
8
|
+
export interface MuteIssueDialogProps extends ThemeModeProp {
|
|
9
|
+
readonly open: boolean;
|
|
10
|
+
readonly onClose: () => void;
|
|
11
|
+
readonly issueId: string;
|
|
12
|
+
/** The row's level — the analytics prop only; it never reaches the wire. */
|
|
13
|
+
readonly level?: IssueLevel;
|
|
14
|
+
/** Called after the store has saved the mute. */
|
|
15
|
+
readonly onMuted?: () => void;
|
|
16
|
+
readonly testId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function MuteIssueDialog(props: MuteIssueDialogProps): ReactElement;
|
|
19
|
+
//# sourceMappingURL=MuteIssueDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MuteIssueDialog.d.ts","sourceRoot":"","sources":["../../src/default/MuteIssueDialog.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAS9D,oFAAoF;AACpF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,GAAG,GAAE,IAAiB,GACrB,MAAM,GAAG,IAAI,CAGf;AAED,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CAgBzE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* `<MuteIssueDialog>` — known, accepted, and deliberately not notified about.
|
|
4
|
+
*
|
|
5
|
+
* ── Muting stops the notifications, not the recording ─────────────────────
|
|
6
|
+
*
|
|
7
|
+
* That sentence is in the body, first, because it is the one thing people get
|
|
8
|
+
* wrong about a mute: occurrences keep arriving, the count keeps rising, and
|
|
9
|
+
* the row keeps its place on the board. A person who believed otherwise would
|
|
10
|
+
* mute a rising fatal thinking they had parked it.
|
|
11
|
+
*
|
|
12
|
+
* ── "No deadline" is offered, and warned about ────────────────────────────
|
|
13
|
+
*
|
|
14
|
+
* `muted_until` is nullable upstream, so an indefinite mute is a real state
|
|
15
|
+
* and hiding it would only produce the 2099 date somebody types instead. It is
|
|
16
|
+
* the last option, not the first, and choosing it says what it costs: nothing
|
|
17
|
+
* will ever bring this back on its own.
|
|
18
|
+
*
|
|
19
|
+
* ── The patch is the deadline ─────────────────────────────────────────────
|
|
20
|
+
*
|
|
21
|
+
* `muted_until` on its own is a mute; the store infers the status from it.
|
|
22
|
+
* `useIssueStatus().mute` always sends the key — `null` for "forever" — see
|
|
23
|
+
* `model/status.ts`.
|
|
24
|
+
*/
|
|
25
|
+
import { useState } from "react";
|
|
26
|
+
import { Flex, Input, Radio, Typography } from "antd";
|
|
27
|
+
import { spacing } from "@stapel/tokens";
|
|
28
|
+
import { ErrorAlert, SkinButton, SkinDialog } from "@stapel/tokens-antd/skin";
|
|
29
|
+
import { useFormat, useT } from "@stapel/core";
|
|
30
|
+
import { useIssueStatus } from "../model/status.js";
|
|
31
|
+
import { ALERTS_I18N_KEYS } from "../i18n/keys.js";
|
|
32
|
+
import { DIALOG_ACTION_BAR_STYLE } from "./layout.js";
|
|
33
|
+
const WINDOW_SECONDS = {
|
|
34
|
+
day: 24 * 60 * 60,
|
|
35
|
+
week: 7 * 24 * 60 * 60,
|
|
36
|
+
month: 30 * 24 * 60 * 60,
|
|
37
|
+
};
|
|
38
|
+
/** The instant a window means, taken from the clock at the moment of the choice. */
|
|
39
|
+
export function mutedUntilFor(span, now = new Date()) {
|
|
40
|
+
if (span === "forever")
|
|
41
|
+
return null;
|
|
42
|
+
return new Date(now.getTime() + WINDOW_SECONDS[span] * 1000).toISOString();
|
|
43
|
+
}
|
|
44
|
+
export function MuteIssueDialog(props) {
|
|
45
|
+
const t = useT();
|
|
46
|
+
const testId = props.testId ?? "alerts-mute";
|
|
47
|
+
return (_jsx(SkinDialog, { open: props.open, onClose: props.onClose, title: t(ALERTS_I18N_KEYS.muteTitle), dismissLabel: t(ALERTS_I18N_KEYS.dismiss), "data-testid": testId, children: props.open ? _jsx(MuteIssueForm, { ...props, testId: testId }) : null }));
|
|
48
|
+
}
|
|
49
|
+
function MuteIssueForm(props) {
|
|
50
|
+
const t = useT();
|
|
51
|
+
const fmt = useFormat();
|
|
52
|
+
const { testId } = props;
|
|
53
|
+
const { mute } = useIssueStatus();
|
|
54
|
+
const [span, setSpan] = useState("week");
|
|
55
|
+
const [note, setNote] = useState("");
|
|
56
|
+
const until = mutedUntilFor(span);
|
|
57
|
+
const submit = () => {
|
|
58
|
+
mute.mutate({
|
|
59
|
+
issueId: props.issueId,
|
|
60
|
+
mutedUntil: mutedUntilFor(span),
|
|
61
|
+
...(note.trim().length > 0 ? { note: note.trim() } : {}),
|
|
62
|
+
...(props.level !== undefined ? { level: props.level } : {}),
|
|
63
|
+
}, {
|
|
64
|
+
onSuccess: () => {
|
|
65
|
+
props.onMuted?.();
|
|
66
|
+
props.onClose();
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return (_jsxs(Flex, { vertical: true, gap: spacing[3], children: [_jsx(Typography.Text, { type: "secondary", children: t(ALERTS_I18N_KEYS.muteBody) }), _jsxs(Flex, { vertical: true, gap: spacing[1], children: [_jsx(Typography.Text, { strong: true, children: t(ALERTS_I18N_KEYS.muteUntil) }), _jsxs(Radio.Group, { value: span, "data-testid": `${testId}-window`, onChange: (event) => setSpan(event.target.value), children: [_jsx(Radio, { value: "day", "data-testid": `${testId}-window-day`, children: t(ALERTS_I18N_KEYS.muteDay) }), _jsx(Radio, { value: "week", "data-testid": `${testId}-window-week`, children: t(ALERTS_I18N_KEYS.muteWeek) }), _jsx(Radio, { value: "month", "data-testid": `${testId}-window-month`, children: t(ALERTS_I18N_KEYS.muteMonth) }), _jsx(Radio, { value: "forever", "data-testid": `${testId}-window-forever`, children: t(ALERTS_I18N_KEYS.muteForever) })] }), until === null ? (_jsx(Typography.Text, { type: "warning", "data-testid": `${testId}-forever`, children: t(ALERTS_I18N_KEYS.muteForeverHint) })) : (_jsx(Typography.Text, { type: "secondary", "data-testid": `${testId}-until`, children: fmt.timestamp(until) ?? t(ALERTS_I18N_KEYS.none) }))] }), _jsxs(Flex, { vertical: true, gap: spacing[1], children: [_jsx(Typography.Text, { strong: true, children: t(ALERTS_I18N_KEYS.muteNote) }), _jsx(Input.TextArea, { value: note, rows: 2, "aria-label": t(ALERTS_I18N_KEYS.muteNote), placeholder: t(ALERTS_I18N_KEYS.muteNoteHint), "data-testid": `${testId}-note`, onChange: (event) => setNote(event.target.value) })] }), _jsx(ErrorAlert, { testId: `${testId}-failed`, thrown: mute.error, variant: "inline" }), _jsxs(Flex, { gap: spacing[2], justify: "end", style: DIALOG_ACTION_BAR_STYLE, children: [_jsx(SkinButton, { "data-testid": `${testId}-cancel`, "data-analytics": "none", "data-analytics-reason": "dismissing a dialog decides nothing about the issue", onClick: props.onClose, children: t(ALERTS_I18N_KEYS.cancel) }), _jsx(SkinButton, { type: "primary", loading: mute.isPending, "data-testid": `${testId}-submit`, "data-analytics": "none", "data-analytics-reason": "alerts.issue.muted is emitted by the model layer on success", onClick: submit, children: t(ALERTS_I18N_KEYS.muteSubmit) })] })] }));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=MuteIssueDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MuteIssueDialog.js","sourceRoot":"","sources":["../../src/default/MuteIssueDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMtD,MAAM,cAAc,GAClB;IACE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IACj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,CAAC,YAAY,CAAC,iBAChC,GAAG,MAAM,OAAO,EAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAChD,IACG,EAEP,KAAC,UAAU,IAAC,MAAM,EAAE,GAAG,MAAM,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAC,QAAQ,GAAG,EAE/E,MAAC,IAAI,IAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAC,KAAK,EAAC,KAAK,EAAE,uBAAuB,aACjE,KAAC,UAAU,mBACI,GAAG,MAAM,SAAS,oBAChB,MAAM,2BACC,qDAAqD,EAC3E,OAAO,EAAE,KAAK,CAAC,OAAO,YAErB,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAChB,EACb,KAAC,UAAU,IACT,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,IAAI,CAAC,SAAS,iBACV,GAAG,MAAM,SAAS,oBAChB,MAAM,2BACC,6DAA6D,EACnF,OAAO,EAAE,MAAM,YAEd,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,GACpB,IACR,IACF,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@stapel/alerts-react/default` — the pair's default AntD skin (§54: a pair
|
|
3
|
+
* ships a FEATURE, not only a bag). A separate entry point, so a host that
|
|
4
|
+
* brings its own visuals never pulls `antd` or the token bridge into its
|
|
5
|
+
* bundle; importing this subpath is the opt-in.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { IssuesFeed } from "@stapel/alerts-react/default";
|
|
9
|
+
* // under the pair's <AlertsProvider> + core's <I18nProvider>:
|
|
10
|
+
* <IssuesFeed issueHref={(id) => `/admin/alerts/${id}`} />
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The two screens are `IssuesFeed` and `IssueDetail` — the two the nav
|
|
14
|
+
* manifest routes to. Everything under them is exported as well, because a
|
|
15
|
+
* host that builds its own operations layout should be able to mount the
|
|
16
|
+
* filter bar or the fix dialog beside its own chrome rather than
|
|
17
|
+
* re-implementing either.
|
|
18
|
+
*/
|
|
19
|
+
export { IssuesFeed } from "./IssuesFeed.js";
|
|
20
|
+
export type { IssuesFeedProps } from "./IssuesFeed.js";
|
|
21
|
+
export { IssueDetail } from "./IssueDetail.js";
|
|
22
|
+
export type { IssueDetailProps } from "./IssueDetail.js";
|
|
23
|
+
export { IssueFilterBar, sinceFor } from "./IssueFilterBar.js";
|
|
24
|
+
export type { IssueFilterBarProps, SincePreset } from "./IssueFilterBar.js";
|
|
25
|
+
export { FixIssueDialog } from "./FixIssueDialog.js";
|
|
26
|
+
export type { FixIssueDialogProps } from "./FixIssueDialog.js";
|
|
27
|
+
export { MuteIssueDialog, mutedUntilFor } from "./MuteIssueDialog.js";
|
|
28
|
+
export type { MuteIssueDialogProps, MuteWindow } from "./MuteIssueDialog.js";
|
|
29
|
+
export { levelKey, levelFamily, kindKey, statusKey, statusFamily, } from "./labels.js";
|
|
30
|
+
export { TRACE_BLOCK_STYLE, DIALOG_ACTION_BAR_STYLE } from "./layout.js";
|
|
31
|
+
export type { ThemeModeProp, IssueNavigationProps } from "./types.js";
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@stapel/alerts-react/default` — the pair's default AntD skin (§54: a pair
|
|
3
|
+
* ships a FEATURE, not only a bag). A separate entry point, so a host that
|
|
4
|
+
* brings its own visuals never pulls `antd` or the token bridge into its
|
|
5
|
+
* bundle; importing this subpath is the opt-in.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { IssuesFeed } from "@stapel/alerts-react/default";
|
|
9
|
+
* // under the pair's <AlertsProvider> + core's <I18nProvider>:
|
|
10
|
+
* <IssuesFeed issueHref={(id) => `/admin/alerts/${id}`} />
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The two screens are `IssuesFeed` and `IssueDetail` — the two the nav
|
|
14
|
+
* manifest routes to. Everything under them is exported as well, because a
|
|
15
|
+
* host that builds its own operations layout should be able to mount the
|
|
16
|
+
* filter bar or the fix dialog beside its own chrome rather than
|
|
17
|
+
* re-implementing either.
|
|
18
|
+
*/
|
|
19
|
+
export { IssuesFeed } from "./IssuesFeed.js";
|
|
20
|
+
export { IssueDetail } from "./IssueDetail.js";
|
|
21
|
+
export { IssueFilterBar, sinceFor } from "./IssueFilterBar.js";
|
|
22
|
+
export { FixIssueDialog } from "./FixIssueDialog.js";
|
|
23
|
+
export { MuteIssueDialog, mutedUntilFor } from "./MuteIssueDialog.js";
|
|
24
|
+
export { levelKey, levelFamily, kindKey, statusKey, statusFamily, } from "./labels.js";
|
|
25
|
+
export { TRACE_BLOCK_STYLE, DIALOG_ACTION_BAR_STYLE } from "./layout.js";
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire enum → i18n key, and wire enum → status FAMILY, one table per axis.
|
|
3
|
+
*
|
|
4
|
+
* Every table has the same fallback shape, and the fallback is the point: all
|
|
5
|
+
* three enums can gain a member in a backend minor, and a `switch` with no
|
|
6
|
+
* default would render a raw wire token (`silenced`, `critical`) at an
|
|
7
|
+
* operator — or, worse, fall into the wrong colour and paint a new fatal
|
|
8
|
+
* green. An unrecognised value renders the "unknown ({x})" copy in the neutral
|
|
9
|
+
* family, which is honest and still says exactly what the server sent.
|
|
10
|
+
*
|
|
11
|
+
* The families come from `@stapel/tokens-antd`'s `StatusTag` vocabulary
|
|
12
|
+
* (§ the skin registry): five families for the whole fleet, so "this failed"
|
|
13
|
+
* is the same red here as everywhere else a host draws a failure.
|
|
14
|
+
*/
|
|
15
|
+
import type { StatusFamily } from "@stapel/tokens-antd/skin";
|
|
16
|
+
/** Copy for a severity. */
|
|
17
|
+
export declare function levelKey(level: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* The status family a severity belongs to.
|
|
20
|
+
*
|
|
21
|
+
* `fatal` and `error` are both the error family and that is deliberate: a
|
|
22
|
+
* sixth colour for "worse than red" would be a colour nobody can read faster
|
|
23
|
+
* than red. What separates them is the WORD, and the feed sorts by level so
|
|
24
|
+
* the fatals are already at the top of their service.
|
|
25
|
+
*/
|
|
26
|
+
export declare function levelFamily(level: string): StatusFamily;
|
|
27
|
+
/** Copy for where an occurrence came from. */
|
|
28
|
+
export declare function kindKey(kind: string): string;
|
|
29
|
+
/** Copy for where an issue is in its life. */
|
|
30
|
+
export declare function statusKey(status: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* The status family a tracker status belongs to.
|
|
33
|
+
*
|
|
34
|
+
* `regressed` is the ERROR family while `new` is only a warning, and that is
|
|
35
|
+
* the one judgement in this table: a bug somebody already closed and which
|
|
36
|
+
* came back anyway is worse news than a bug nobody has looked at, because it
|
|
37
|
+
* means a fix that was believed did not hold.
|
|
38
|
+
*/
|
|
39
|
+
export declare function statusFamily(status: string): StatusFamily;
|
|
40
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/default/labels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,2BAA2B;AAC3B,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAe9C;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAYvD;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe5C;AAED,8CAA8C;AAC9C,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAahD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAazD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ALERTS_I18N_KEYS } from "../i18n/keys.js";
|
|
2
|
+
/** Copy for a severity. */
|
|
3
|
+
export function levelKey(level) {
|
|
4
|
+
switch (level) {
|
|
5
|
+
case "debug":
|
|
6
|
+
return ALERTS_I18N_KEYS.levelDebug;
|
|
7
|
+
case "info":
|
|
8
|
+
return ALERTS_I18N_KEYS.levelInfo;
|
|
9
|
+
case "warning":
|
|
10
|
+
return ALERTS_I18N_KEYS.levelWarning;
|
|
11
|
+
case "error":
|
|
12
|
+
return ALERTS_I18N_KEYS.levelError;
|
|
13
|
+
case "fatal":
|
|
14
|
+
return ALERTS_I18N_KEYS.levelFatal;
|
|
15
|
+
default:
|
|
16
|
+
return ALERTS_I18N_KEYS.levelUnknown;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The status family a severity belongs to.
|
|
21
|
+
*
|
|
22
|
+
* `fatal` and `error` are both the error family and that is deliberate: a
|
|
23
|
+
* sixth colour for "worse than red" would be a colour nobody can read faster
|
|
24
|
+
* than red. What separates them is the WORD, and the feed sorts by level so
|
|
25
|
+
* the fatals are already at the top of their service.
|
|
26
|
+
*/
|
|
27
|
+
export function levelFamily(level) {
|
|
28
|
+
switch (level) {
|
|
29
|
+
case "fatal":
|
|
30
|
+
case "error":
|
|
31
|
+
return "error";
|
|
32
|
+
case "warning":
|
|
33
|
+
return "warning";
|
|
34
|
+
case "info":
|
|
35
|
+
return "info";
|
|
36
|
+
default:
|
|
37
|
+
return "neutral";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Copy for where an occurrence came from. */
|
|
41
|
+
export function kindKey(kind) {
|
|
42
|
+
switch (kind) {
|
|
43
|
+
case "exception":
|
|
44
|
+
return ALERTS_I18N_KEYS.kindException;
|
|
45
|
+
case "log":
|
|
46
|
+
return ALERTS_I18N_KEYS.kindLog;
|
|
47
|
+
case "dlq":
|
|
48
|
+
return ALERTS_I18N_KEYS.kindDlq;
|
|
49
|
+
case "monitoring":
|
|
50
|
+
return ALERTS_I18N_KEYS.kindMonitoring;
|
|
51
|
+
case "manual":
|
|
52
|
+
return ALERTS_I18N_KEYS.kindManual;
|
|
53
|
+
default:
|
|
54
|
+
return ALERTS_I18N_KEYS.kindUnknown;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Copy for where an issue is in its life. */
|
|
58
|
+
export function statusKey(status) {
|
|
59
|
+
switch (status) {
|
|
60
|
+
case "new":
|
|
61
|
+
return ALERTS_I18N_KEYS.statusNew;
|
|
62
|
+
case "fixed":
|
|
63
|
+
return ALERTS_I18N_KEYS.statusFixed;
|
|
64
|
+
case "regressed":
|
|
65
|
+
return ALERTS_I18N_KEYS.statusRegressed;
|
|
66
|
+
case "muted":
|
|
67
|
+
return ALERTS_I18N_KEYS.statusMuted;
|
|
68
|
+
default:
|
|
69
|
+
return ALERTS_I18N_KEYS.statusUnknown;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The status family a tracker status belongs to.
|
|
74
|
+
*
|
|
75
|
+
* `regressed` is the ERROR family while `new` is only a warning, and that is
|
|
76
|
+
* the one judgement in this table: a bug somebody already closed and which
|
|
77
|
+
* came back anyway is worse news than a bug nobody has looked at, because it
|
|
78
|
+
* means a fix that was believed did not hold.
|
|
79
|
+
*/
|
|
80
|
+
export function statusFamily(status) {
|
|
81
|
+
switch (status) {
|
|
82
|
+
case "fixed":
|
|
83
|
+
return "success";
|
|
84
|
+
case "regressed":
|
|
85
|
+
return "error";
|
|
86
|
+
case "new":
|
|
87
|
+
return "warning";
|
|
88
|
+
case "muted":
|
|
89
|
+
return "neutral";
|
|
90
|
+
default:
|
|
91
|
+
return "neutral";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../src/default/labels.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,2BAA2B;AAC3B,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,gBAAgB,CAAC,SAAS,CAAC;QACpC,KAAK,SAAS;YACZ,OAAO,gBAAgB,CAAC,YAAY,CAAC;QACvC,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC;YACE,OAAO,gBAAgB,CAAC,YAAY,CAAC;IACzC,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW;YACd,OAAO,gBAAgB,CAAC,aAAa,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,gBAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,KAAK;YACR,OAAO,gBAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,YAAY;YACf,OAAO,gBAAgB,CAAC,cAAc,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC;YACE,OAAO,gBAAgB,CAAC,WAAW,CAAC;IACxC,CAAC;AACH,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK;YACR,OAAO,gBAAgB,CAAC,SAAS,CAAC;QACpC,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,WAAW,CAAC;QACtC,KAAK,WAAW;YACd,OAAO,gBAAgB,CAAC,eAAe,CAAC;QAC1C,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,WAAW,CAAC;QACtC;YACE,OAAO,gBAAgB,CAAC,aAAa,CAAC;IAC1C,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK;YACR,OAAO,SAAS,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The geometries this skin owns, lifted to named constants rather than
|
|
3
|
+
* spelled inline. All of them are element-width decisions, not viewport ones:
|
|
4
|
+
* a traceback keeps its shape wherever a host mounts it, including inside a
|
|
5
|
+
* narrow drawer that is nobody's breakpoint.
|
|
6
|
+
*/
|
|
7
|
+
import type { CSSProperties } from "react";
|
|
8
|
+
/**
|
|
9
|
+
* A traceback or a context blob is arbitrary text — one long line in it must
|
|
10
|
+
* scroll INSIDE the block, never widen the page. `overflowX: auto` on the
|
|
11
|
+
* `<pre>` is what keeps a phone from horizontally scrolling the whole issue
|
|
12
|
+
* screen because one frame carried a 300-character path.
|
|
13
|
+
*
|
|
14
|
+
* `maxHeight` matters here more than in the pairs this pattern came from: a
|
|
15
|
+
* Python traceback from a Django request is routinely sixty frames, and three
|
|
16
|
+
* of them in a row would push every control on the screen below the fold.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TRACE_BLOCK_STYLE: CSSProperties;
|
|
19
|
+
/**
|
|
20
|
+
* The action row at the foot of a dialog, pinned to the bottom of the
|
|
21
|
+
* dialog's own scroll box.
|
|
22
|
+
*
|
|
23
|
+
* A bottom sheet is a fixed slice of the viewport and these bodies are long —
|
|
24
|
+
* the mute dialog is four presets, a date and a note. Left in the flow, the
|
|
25
|
+
* one control somebody opened the sheet to press sits below an invisible fold.
|
|
26
|
+
*
|
|
27
|
+
* It is NOT `SkinDialog`'s `footer` slot: antd memoises that slot, so a button
|
|
28
|
+
* whose gate opens once a field is filled keeps rendering the state it had on
|
|
29
|
+
* the dialog's first frame.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DIALOG_ACTION_BAR_STYLE: CSSProperties;
|
|
32
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/default/layout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAY/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAMrC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cssVar, fontSize, radii, spacing } from "@stapel/tokens";
|
|
2
|
+
/**
|
|
3
|
+
* A traceback or a context blob is arbitrary text — one long line in it must
|
|
4
|
+
* scroll INSIDE the block, never widen the page. `overflowX: auto` on the
|
|
5
|
+
* `<pre>` is what keeps a phone from horizontally scrolling the whole issue
|
|
6
|
+
* screen because one frame carried a 300-character path.
|
|
7
|
+
*
|
|
8
|
+
* `maxHeight` matters here more than in the pairs this pattern came from: a
|
|
9
|
+
* Python traceback from a Django request is routinely sixty frames, and three
|
|
10
|
+
* of them in a row would push every control on the screen below the fold.
|
|
11
|
+
*/
|
|
12
|
+
export const TRACE_BLOCK_STYLE = {
|
|
13
|
+
overflowX: "auto",
|
|
14
|
+
overflowY: "auto",
|
|
15
|
+
maxHeight: "24rem",
|
|
16
|
+
margin: 0,
|
|
17
|
+
padding: spacing[3],
|
|
18
|
+
borderRadius: radii.md,
|
|
19
|
+
fontSize: fontSize.sm.fontSize,
|
|
20
|
+
lineHeight: `${String(fontSize.sm.lineHeight)}px`,
|
|
21
|
+
// No background/colour: the `<pre>` inherits the surface it is dropped into,
|
|
22
|
+
// which is the skin surface `SkinTheme` painted. A colour here would fight
|
|
23
|
+
// the theme in exactly one of the two modes.
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The action row at the foot of a dialog, pinned to the bottom of the
|
|
27
|
+
* dialog's own scroll box.
|
|
28
|
+
*
|
|
29
|
+
* A bottom sheet is a fixed slice of the viewport and these bodies are long —
|
|
30
|
+
* the mute dialog is four presets, a date and a note. Left in the flow, the
|
|
31
|
+
* one control somebody opened the sheet to press sits below an invisible fold.
|
|
32
|
+
*
|
|
33
|
+
* It is NOT `SkinDialog`'s `footer` slot: antd memoises that slot, so a button
|
|
34
|
+
* whose gate opens once a field is filled keeps rendering the state it had on
|
|
35
|
+
* the dialog's first frame.
|
|
36
|
+
*/
|
|
37
|
+
export const DIALOG_ACTION_BAR_STYLE = {
|
|
38
|
+
position: "sticky",
|
|
39
|
+
bottom: 0,
|
|
40
|
+
zIndex: 1,
|
|
41
|
+
background: cssVar("surface-overlay"),
|
|
42
|
+
paddingBlock: spacing[3],
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/default/layout.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,EAAE;IACtB,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ;IAC9B,UAAU,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI;IACjD,6EAA6E;IAC7E,2EAA2E;IAC3E,6CAA6C;CAC9C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAkB;IACpD,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,MAAM,CAAC,iBAAiB,CAAC;IACrC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The props every skin component in this package shares.
|
|
3
|
+
*
|
|
4
|
+
* `mode` is OPTIONAL and has no default here on purpose: the shared
|
|
5
|
+
* `SkinTheme` (`@stapel/tokens-antd/skin`) follows the host's theme when
|
|
6
|
+
* nobody overrides it, and a `mode = "light"` default in a pair is how a dark
|
|
7
|
+
* host ends up with one white rectangle in the middle of its app.
|
|
8
|
+
*/
|
|
9
|
+
export interface ThemeModeProp {
|
|
10
|
+
readonly mode?: "light" | "dark";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* How a screen in this pair reaches one issue.
|
|
14
|
+
*
|
|
15
|
+
* This package owns no router. A host that has one passes `issueHref` and the
|
|
16
|
+
* rows become real links — middle-clickable, copyable, and the thing somebody
|
|
17
|
+
* pastes into a chat beside `alerts:<id>`. A host without one passes
|
|
18
|
+
* `onOpenIssue` and gets a button. Neither given, the row still renders and
|
|
19
|
+
* simply offers no way in, which is honest: a dead control would be worse.
|
|
20
|
+
*/
|
|
21
|
+
export interface IssueNavigationProps {
|
|
22
|
+
/** `(issueId) => href` for the host's route to the issue screen. */
|
|
23
|
+
readonly issueHref?: (issueId: string) => string;
|
|
24
|
+
/** Called with the issue id when a row is activated. */
|
|
25
|
+
readonly onOpenIssue?: (issueId: string) => void;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/default/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,wDAAwD;IACxD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/default/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FlowError } from "@stapel/core";
|
|
2
|
+
export type { FlowError } from "@stapel/core";
|
|
3
|
+
export { isErrorCode } from "@stapel/core";
|
|
4
|
+
/**
|
|
5
|
+
* Fold any thrown value into a {@link FlowError} using this pair's own
|
|
6
|
+
* module-scoped fallback key (`alerts.error.unknown`, an en string in
|
|
7
|
+
* {@link alertsI18nBundleEn}) so a non-`StapelApiError` fault still renders
|
|
8
|
+
* real copy rather than a raw key. The primitive lives in `@stapel/core`
|
|
9
|
+
* (frontend-core-architecture §4b); this wrapper only pins the fallback.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toFlowError(error: unknown): FlowError;
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/flows/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAErD"}
|