@checkstack/maintenance-frontend 0.6.1 → 0.7.0
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 +111 -0
- package/package.json +14 -13
- package/src/components/MaintenanceEditor.tsx +43 -0
- package/src/index.tsx +1 -0
- package/src/pages/MaintenanceConfigPage.tsx +38 -10
- package/src/pages/MaintenanceDetailPage.tsx +23 -0
- package/src/pages/SystemMaintenanceHistoryPage.tsx +14 -3
- package/tsconfig.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,116 @@
|
|
|
1
1
|
# @checkstack/maintenance-frontend
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1ef2e79: feat: hotlinks on incidents/maintenances and additional links on systems
|
|
8
|
+
|
|
9
|
+
Users with `manage` access on an incident, maintenance, or system can now
|
|
10
|
+
attach free-form URL "hotlinks" — Jira tickets, runbooks, dashboards, ticket
|
|
11
|
+
tools, etc. — alongside the existing fields.
|
|
12
|
+
|
|
13
|
+
- **Incidents** & **maintenances**: links live on the entity itself and are
|
|
14
|
+
surfaced both in the editor dialog and on the public detail page. Two new
|
|
15
|
+
RPC procedures per plugin (`addLink`, `removeLink`) gated behind the
|
|
16
|
+
existing `manage` access rule. Links are returned as part of
|
|
17
|
+
`getIncident` / `getMaintenance` and cache-invalidated on every link
|
|
18
|
+
mutation.
|
|
19
|
+
- **Systems**: a parallel `system_links` table with `getSystemLinks`,
|
|
20
|
+
`addSystemLink`, `removeSystemLink` procedures. Surfaced inside the
|
|
21
|
+
system editor (next to contacts) and on the read-only system detail
|
|
22
|
+
sidebar. Cache-scoped per-system so list endpoints remain hot.
|
|
23
|
+
- **Shared UI**: a `LinksEditor` component in `@checkstack/ui` does the
|
|
24
|
+
presentation; the three plugins each own their own RPC wiring.
|
|
25
|
+
|
|
26
|
+
Database changes ship as additive migrations (new `incident_links`,
|
|
27
|
+
`maintenance_links`, `system_links` tables, all FK-cascaded on parent
|
|
28
|
+
delete). No existing columns or rows are touched.
|
|
29
|
+
|
|
30
|
+
The system incident and maintenance history pages now sort by relevance:
|
|
31
|
+
active entries (non-`resolved` incidents, `scheduled` or `in_progress`
|
|
32
|
+
maintenances) appear at the top, with creation date descending as the
|
|
33
|
+
tiebreaker.
|
|
34
|
+
|
|
35
|
+
- 3547670: Wire the new tips infrastructure across the frontends:
|
|
36
|
+
|
|
37
|
+
**Empty-state coaching.** Replace generic "no items" copy with onboarding
|
|
38
|
+
guidance — short description, three numbered steps and a primary CTA — on
|
|
39
|
+
every EmptyState that has a meaningful next action. Affects: catalog
|
|
40
|
+
(systems + groups), dashboard, health-check page, integrations (subscriptions
|
|
41
|
+
|
|
42
|
+
- provider connections), GitOps providers + secrets, GitOps provenance,
|
|
43
|
+
SLO config + overview, maintenance config, satellites, plugin manager,
|
|
44
|
+
incident config, announcements. Read-only EmptyStates (incident history,
|
|
45
|
+
maintenance history, plugin events) get clearer descriptions explaining
|
|
46
|
+
what would populate them.
|
|
47
|
+
|
|
48
|
+
**First-run anchored tips.** Add `<Tip>` popovers to the most important
|
|
49
|
+
"Create" affordances so first-time users see a one-line explanation of
|
|
50
|
+
what they're about to make and why it matters: catalog “Add System” /
|
|
51
|
+
“Add Group”, healthcheck “Create Check”, integrations “New Subscription”,
|
|
52
|
+
GitOps “Add Provider”, SLO “Create SLO”, maintenance “Create Maintenance”,
|
|
53
|
+
satellite “Create Satellite”, plugin-manager “Install plugin”, incident
|
|
54
|
+
“Report Incident”, announcement “New Announcement”. Each tip is dismissed
|
|
55
|
+
per user (server-backed when signed in, localStorage otherwise) and
|
|
56
|
+
namespaced through `qualifyTipId(plugin, …)` so it cannot escape the
|
|
57
|
+
plugin's own namespace.
|
|
58
|
+
|
|
59
|
+
**Welcome banner on the dashboard.** A `<TipBanner>` at the top of the
|
|
60
|
+
dashboard introduces Checkstack's main flow ("add a system, then a health
|
|
61
|
+
check") with a one-click jump into the catalog.
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 950d6ec: Fix mobile UserMenu items rendering at zero height, group menu items by
|
|
66
|
+
section, and unstack cramped card headers on small viewports.
|
|
67
|
+
|
|
68
|
+
- **UserMenu mobile bug**: On mobile, the user-menu Sheet rendered every
|
|
69
|
+
menu item as a grid row, which combined with `flex-shrink: 1` on each
|
|
70
|
+
item collapsed the buttons whose internal layout uses `display: flex`
|
|
71
|
+
(the items registered with `useNavigate` rather than `<Link>`) to zero
|
|
72
|
+
content height. Switched the mobile container to a flex column with
|
|
73
|
+
`[&>*]:shrink-0` and added `min-h-0` so the sheet scrolls correctly
|
|
74
|
+
when the list overflows.
|
|
75
|
+
|
|
76
|
+
- **UserMenu grouping**: Slot extensions now accept an optional `group`
|
|
77
|
+
field. The user menu buckets `UserMenuItemsSlot` extensions by `group`
|
|
78
|
+
and renders each group under a labeled header (`Workspace`,
|
|
79
|
+
`Reliability`, `Configuration`, `Documentation`, `Account`). Existing
|
|
80
|
+
core plugins are tagged with the appropriate group; third-party plugins
|
|
81
|
+
can pick any of these or supply their own label. Untagged extensions
|
|
82
|
+
render last with no header. `UserMenuItemsBottomSlot` is unaffected.
|
|
83
|
+
|
|
84
|
+
- **Card header responsiveness**: `CardHeaderRow` (the primitive shared by
|
|
85
|
+
Incident, Maintenance, Auth, Catalog, GitOps and other config cards) now
|
|
86
|
+
stacks vertically on narrow viewports and only switches to a single row
|
|
87
|
+
at the `sm` breakpoint, so titles and adjacent filter controls (e.g.
|
|
88
|
+
status `Select`, "Show resolved" checkbox) no longer cram together on
|
|
89
|
+
mobile. Refactored the Incident and Maintenance config pages to use the
|
|
90
|
+
primitive instead of a hand-rolled `flex items-center justify-between`
|
|
91
|
+
row, and made their `Select` triggers full-width on mobile.
|
|
92
|
+
|
|
93
|
+
- Updated dependencies [42abfff]
|
|
94
|
+
- Updated dependencies [3547670]
|
|
95
|
+
- Updated dependencies [1ef2e79]
|
|
96
|
+
- Updated dependencies [aa89bc5]
|
|
97
|
+
- Updated dependencies [3547670]
|
|
98
|
+
- Updated dependencies [3547670]
|
|
99
|
+
- Updated dependencies [950d6ec]
|
|
100
|
+
- Updated dependencies [3547670]
|
|
101
|
+
- Updated dependencies [3547670]
|
|
102
|
+
- @checkstack/common@0.9.0
|
|
103
|
+
- @checkstack/ui@1.8.0
|
|
104
|
+
- @checkstack/maintenance-common@1.1.0
|
|
105
|
+
- @checkstack/catalog-common@2.1.0
|
|
106
|
+
- @checkstack/frontend-api@0.5.0
|
|
107
|
+
- @checkstack/notification-frontend@0.4.0
|
|
108
|
+
- @checkstack/tips-frontend@0.2.0
|
|
109
|
+
- @checkstack/auth-frontend@0.6.0
|
|
110
|
+
- @checkstack/dashboard-frontend@0.7.0
|
|
111
|
+
- @checkstack/notification-common@1.0.2
|
|
112
|
+
- @checkstack/signal-frontend@0.1.2
|
|
113
|
+
|
|
3
114
|
## 0.6.1
|
|
4
115
|
|
|
5
116
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/maintenance-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.tsx",
|
|
@@ -13,16 +13,17 @@
|
|
|
13
13
|
"lint:code": "eslint . --max-warnings 0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@checkstack/auth-frontend": "0.5.
|
|
17
|
-
"@checkstack/catalog-common": "2.0.
|
|
18
|
-
"@checkstack/common": "0.
|
|
19
|
-
"@checkstack/dashboard-frontend": "0.6.
|
|
20
|
-
"@checkstack/frontend-api": "0.4.
|
|
21
|
-
"@checkstack/maintenance-common": "1.0.
|
|
22
|
-
"@checkstack/notification-common": "1.0.
|
|
23
|
-
"@checkstack/notification-frontend": "0.3.
|
|
24
|
-
"@checkstack/signal-frontend": "0.1.
|
|
25
|
-
"@checkstack/
|
|
16
|
+
"@checkstack/auth-frontend": "0.5.33",
|
|
17
|
+
"@checkstack/catalog-common": "2.0.1",
|
|
18
|
+
"@checkstack/common": "0.8.0",
|
|
19
|
+
"@checkstack/dashboard-frontend": "0.6.1",
|
|
20
|
+
"@checkstack/frontend-api": "0.4.2",
|
|
21
|
+
"@checkstack/maintenance-common": "1.0.1",
|
|
22
|
+
"@checkstack/notification-common": "1.0.1",
|
|
23
|
+
"@checkstack/notification-frontend": "0.3.1",
|
|
24
|
+
"@checkstack/signal-frontend": "0.1.1",
|
|
25
|
+
"@checkstack/tips-frontend": "0.1.0",
|
|
26
|
+
"@checkstack/ui": "1.7.1",
|
|
26
27
|
"date-fns": "^4.1.0",
|
|
27
28
|
"lucide-react": "^0.344.0",
|
|
28
29
|
"react": "^18.2.0",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"typescript": "^5.0.0",
|
|
33
34
|
"@types/react": "^18.2.0",
|
|
34
|
-
"@checkstack/tsconfig": "0.0.
|
|
35
|
-
"@checkstack/scripts": "0.
|
|
35
|
+
"@checkstack/tsconfig": "0.0.7",
|
|
36
|
+
"@checkstack/scripts": "0.3.0"
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
useToast,
|
|
22
22
|
DateTimePicker,
|
|
23
23
|
StatusUpdateTimeline,
|
|
24
|
+
LinksEditor,
|
|
24
25
|
} from "@checkstack/ui";
|
|
25
26
|
import { Plus, MessageSquare, Loader2, AlertCircle } from "lucide-react";
|
|
26
27
|
import { MaintenanceUpdateForm } from "./MaintenanceUpdateForm";
|
|
@@ -88,6 +89,24 @@ export const MaintenanceEditor: React.FC<Props> = ({
|
|
|
88
89
|
},
|
|
89
90
|
});
|
|
90
91
|
|
|
92
|
+
const addLinkMutation = maintenanceClient.addLink.useMutation({
|
|
93
|
+
onSuccess: () => {
|
|
94
|
+
void refetchDetail();
|
|
95
|
+
},
|
|
96
|
+
onError: (error) => {
|
|
97
|
+
toast.error(extractErrorMessage(error, "Failed to add link"));
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const removeLinkMutation = maintenanceClient.removeLink.useMutation({
|
|
102
|
+
onSuccess: () => {
|
|
103
|
+
void refetchDetail();
|
|
104
|
+
},
|
|
105
|
+
onError: (error) => {
|
|
106
|
+
toast.error(extractErrorMessage(error, "Failed to remove link"));
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
91
110
|
// Sync updates from query
|
|
92
111
|
useEffect(() => {
|
|
93
112
|
if (maintenanceDetail) {
|
|
@@ -351,6 +370,30 @@ export const MaintenanceEditor: React.FC<Props> = ({
|
|
|
351
370
|
</div>
|
|
352
371
|
)}
|
|
353
372
|
|
|
373
|
+
{/* Hotlinks (change tickets, runbooks, ...) — editing only */}
|
|
374
|
+
{maintenance && (
|
|
375
|
+
<div className="border-t pt-4">
|
|
376
|
+
<LinksEditor
|
|
377
|
+
title="Hotlinks"
|
|
378
|
+
description="Attach change tickets, runbooks, dashboards, or any URL relevant to this maintenance."
|
|
379
|
+
links={maintenanceDetail?.links ?? []}
|
|
380
|
+
busy={
|
|
381
|
+
addLinkMutation.isPending || removeLinkMutation.isPending
|
|
382
|
+
}
|
|
383
|
+
onAdd={async ({ label, url }) => {
|
|
384
|
+
await addLinkMutation.mutateAsync({
|
|
385
|
+
maintenanceId: maintenance.id,
|
|
386
|
+
label,
|
|
387
|
+
url,
|
|
388
|
+
});
|
|
389
|
+
}}
|
|
390
|
+
onRemove={async (link) => {
|
|
391
|
+
await removeLinkMutation.mutateAsync({ id: link.id });
|
|
392
|
+
}}
|
|
393
|
+
/>
|
|
394
|
+
</div>
|
|
395
|
+
)}
|
|
396
|
+
|
|
354
397
|
{/* Team Access Editor - only shown when editing existing maintenance */}
|
|
355
398
|
{maintenance?.id && (
|
|
356
399
|
<TeamAccessEditor
|
package/src/index.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export default createFrontendPlugin({
|
|
|
45
45
|
createSlotExtension(UserMenuItemsSlot, {
|
|
46
46
|
id: "maintenance.user-menu.items",
|
|
47
47
|
component: MaintenanceMenuItems,
|
|
48
|
+
metadata: { group: "Reliability" },
|
|
48
49
|
}),
|
|
49
50
|
createSlotExtension(SystemStateBadgesSlot, {
|
|
50
51
|
id: "maintenance.system-maintenance-badge",
|
|
@@ -11,11 +11,16 @@ import type {
|
|
|
11
11
|
MaintenanceWithSystems,
|
|
12
12
|
MaintenanceStatus,
|
|
13
13
|
} from "@checkstack/maintenance-common";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
maintenanceAccess,
|
|
16
|
+
pluginMetadata as maintenancePluginMetadata,
|
|
17
|
+
} from "@checkstack/maintenance-common";
|
|
18
|
+
import { Tip } from "@checkstack/tips-frontend";
|
|
15
19
|
import { CatalogApi } from "@checkstack/catalog-common";
|
|
16
20
|
import {
|
|
17
21
|
Card,
|
|
18
22
|
CardHeader,
|
|
23
|
+
CardHeaderRow,
|
|
19
24
|
CardTitle,
|
|
20
25
|
CardContent,
|
|
21
26
|
Button,
|
|
@@ -176,15 +181,24 @@ const MaintenanceConfigPageContent: React.FC = () => {
|
|
|
176
181
|
loading={accessLoading}
|
|
177
182
|
allowed={canManage}
|
|
178
183
|
actions={
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
<Tip
|
|
185
|
+
plugin={maintenancePluginMetadata}
|
|
186
|
+
id="windows.create"
|
|
187
|
+
title="Tell Checkstack about expected downtime"
|
|
188
|
+
description="Maintenance windows mark a period where you expect a system to be partially or fully unavailable. Checkstack uses them to suppress incidents, mark systems as “under maintenance” on the public status page, and (optionally) exclude the window from SLO error budgets."
|
|
189
|
+
side="bottom"
|
|
190
|
+
align="end"
|
|
191
|
+
>
|
|
192
|
+
<Button onClick={handleCreate}>
|
|
193
|
+
<Plus className="h-4 w-4 mr-2" />
|
|
194
|
+
Create Maintenance
|
|
195
|
+
</Button>
|
|
196
|
+
</Tip>
|
|
183
197
|
}
|
|
184
198
|
>
|
|
185
199
|
<Card>
|
|
186
200
|
<CardHeader className="border-b border-border">
|
|
187
|
-
<
|
|
201
|
+
<CardHeaderRow>
|
|
188
202
|
<div className="flex items-center gap-2">
|
|
189
203
|
<Wrench className="h-5 w-5 text-muted-foreground" />
|
|
190
204
|
<CardTitle>Maintenances</CardTitle>
|
|
@@ -195,7 +209,7 @@ const MaintenanceConfigPageContent: React.FC = () => {
|
|
|
195
209
|
setStatusFilter(v as MaintenanceStatus | "all")
|
|
196
210
|
}
|
|
197
211
|
>
|
|
198
|
-
<SelectTrigger className="w-40">
|
|
212
|
+
<SelectTrigger className="w-full sm:w-40">
|
|
199
213
|
<SelectValue placeholder="Filter by status" />
|
|
200
214
|
</SelectTrigger>
|
|
201
215
|
<SelectContent>
|
|
@@ -206,7 +220,7 @@ const MaintenanceConfigPageContent: React.FC = () => {
|
|
|
206
220
|
<SelectItem value="cancelled">Cancelled</SelectItem>
|
|
207
221
|
</SelectContent>
|
|
208
222
|
</Select>
|
|
209
|
-
</
|
|
223
|
+
</CardHeaderRow>
|
|
210
224
|
</CardHeader>
|
|
211
225
|
<CardContent className="p-0">
|
|
212
226
|
{loading ? (
|
|
@@ -215,8 +229,22 @@ const MaintenanceConfigPageContent: React.FC = () => {
|
|
|
215
229
|
</div>
|
|
216
230
|
) : maintenances.length === 0 ? (
|
|
217
231
|
<EmptyState
|
|
218
|
-
|
|
219
|
-
|
|
232
|
+
icon={<Wrench className="size-10" />}
|
|
233
|
+
title="No planned maintenances"
|
|
234
|
+
description="A maintenance window tells Checkstack “this system is expected to be down or degraded” for a defined period. Failed health checks during the window are still recorded but are treated as expected — the system is flagged as “in maintenance” on the public status page, and notifications about it are suppressed."
|
|
235
|
+
steps={[
|
|
236
|
+
"Click “Create Maintenance” and pick the systems that will be affected.",
|
|
237
|
+
"Set a start time, end time, and a short summary your users will see.",
|
|
238
|
+
"Subscribers (groups, status page subscribers, integrations) are notified automatically when the window starts and ends.",
|
|
239
|
+
]}
|
|
240
|
+
actions={
|
|
241
|
+
canManage ? (
|
|
242
|
+
<Button onClick={handleCreate}>
|
|
243
|
+
<Plus className="h-4 w-4 mr-2" />
|
|
244
|
+
Schedule maintenance
|
|
245
|
+
</Button>
|
|
246
|
+
) : undefined
|
|
247
|
+
}
|
|
220
248
|
/>
|
|
221
249
|
) : (
|
|
222
250
|
<Table>
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
Plus,
|
|
42
42
|
MessageSquare,
|
|
43
43
|
CheckCircle2,
|
|
44
|
+
ExternalLink,
|
|
44
45
|
} from "lucide-react";
|
|
45
46
|
import { format } from "date-fns";
|
|
46
47
|
import { MaintenanceUpdateForm } from "../components/MaintenanceUpdateForm";
|
|
@@ -240,6 +241,28 @@ const MaintenanceDetailPageContent: React.FC = () => {
|
|
|
240
241
|
))}
|
|
241
242
|
</div>
|
|
242
243
|
</div>
|
|
244
|
+
|
|
245
|
+
{maintenance.links.length > 0 && (
|
|
246
|
+
<div>
|
|
247
|
+
<h4 className="text-sm font-medium text-muted-foreground mb-2">
|
|
248
|
+
Hotlinks
|
|
249
|
+
</h4>
|
|
250
|
+
<div className="flex flex-wrap gap-2">
|
|
251
|
+
{maintenance.links.map((link) => (
|
|
252
|
+
<a
|
|
253
|
+
key={link.id}
|
|
254
|
+
href={link.url}
|
|
255
|
+
target="_blank"
|
|
256
|
+
rel="noopener noreferrer"
|
|
257
|
+
className="inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs text-primary hover:bg-muted"
|
|
258
|
+
>
|
|
259
|
+
<ExternalLink className="h-3 w-3" />
|
|
260
|
+
<span>{link.label ?? link.url}</span>
|
|
261
|
+
</a>
|
|
262
|
+
))}
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
)}
|
|
243
266
|
</CardContent>
|
|
244
267
|
</Card>
|
|
245
268
|
|
|
@@ -43,7 +43,18 @@ const SystemMaintenanceHistoryPageContent: React.FC = () => {
|
|
|
43
43
|
const { data: systemsData, isLoading: systemsLoading } =
|
|
44
44
|
catalogClient.getSystems.useQuery({});
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
// Sort: active maintenances (scheduled / in_progress) first, then by
|
|
47
|
+
// creation date desc.
|
|
48
|
+
const maintenances = (maintenancesData?.maintenances ?? []).toSorted(
|
|
49
|
+
(a, b) => {
|
|
50
|
+
const aActive =
|
|
51
|
+
a.status === "scheduled" || a.status === "in_progress" ? 0 : 1;
|
|
52
|
+
const bActive =
|
|
53
|
+
b.status === "scheduled" || b.status === "in_progress" ? 0 : 1;
|
|
54
|
+
if (aActive !== bActive) return aActive - bActive;
|
|
55
|
+
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
56
|
+
},
|
|
57
|
+
);
|
|
47
58
|
const systems = systemsData?.systems ?? [];
|
|
48
59
|
const system = systems.find((s) => s.id === systemId);
|
|
49
60
|
const systemName = system?.name ?? "Unknown System";
|
|
@@ -111,8 +122,8 @@ const SystemMaintenanceHistoryPageContent: React.FC = () => {
|
|
|
111
122
|
</div>
|
|
112
123
|
) : maintenances.length === 0 ? (
|
|
113
124
|
<EmptyState
|
|
114
|
-
title="No
|
|
115
|
-
description="
|
|
125
|
+
title="No maintenance history"
|
|
126
|
+
description="This system has never had a planned maintenance window. When one is scheduled (or completes), it will appear here so you can see how often this system is taken offline and for how long."
|
|
116
127
|
/>
|
|
117
128
|
) : (
|
|
118
129
|
<Table>
|