@checkstack/incident-frontend 0.7.0 → 0.8.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 +223 -0
- package/package.json +16 -14
- package/src/components/IncidentEditor.tsx +43 -0
- package/src/index.tsx +1 -0
- package/src/pages/IncidentConfigPage.tsx +39 -11
- package/src/pages/IncidentDetailPage.tsx +23 -0
- package/src/pages/SystemIncidentHistoryPage.tsx +9 -3
- package/tsconfig.json +36 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,228 @@
|
|
|
1
1
|
# @checkstack/incident-frontend
|
|
2
2
|
|
|
3
|
+
## 0.8.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/incident-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
|
+
|
|
114
|
+
## 0.7.1
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- 50e5f5f: Runtime plugin system: install + uninstall plugins from npm, GitHub releases
|
|
119
|
+
(including private GitHub Enterprise instances), or tarball uploads at
|
|
120
|
+
runtime, with multi-package bundles, dependency-derived compatibility checks,
|
|
121
|
+
multi-instance coordination via a Postgres artifact store, and
|
|
122
|
+
single-coordinator destructive cleanup.
|
|
123
|
+
|
|
124
|
+
Highlights:
|
|
125
|
+
|
|
126
|
+
- New `PluginSource` discriminated union and `PluginInstaller` /
|
|
127
|
+
`PluginInstallerRegistry` interfaces in `@checkstack/backend-api`. The
|
|
128
|
+
GitHub variant accepts an optional `apiBaseUrl` so deployments backed by
|
|
129
|
+
GitHub Enterprise can install from `https://ghe.example.com/api/v3`
|
|
130
|
+
instead of `api.github.com`.
|
|
131
|
+
- New `installPackageMetadataSchema` (Zod) in `@checkstack/common` validates
|
|
132
|
+
every plugin's `package.json` at install time. Required fields: `name`,
|
|
133
|
+
`version`, `description`, `author`, `license`, `checkstack.type`,
|
|
134
|
+
`checkstack.pluginId`. Optional: `checkstack.bundle`,
|
|
135
|
+
`checkstack.usageInstructions`, `checkstack.allowInstallScripts`.
|
|
136
|
+
- New `pluginManagerContract` in `@checkstack/pluginmanager-common` with
|
|
137
|
+
`list`, `previewInstall`, `install`, `previewUninstall`, `uninstall`, and
|
|
138
|
+
`events` procedures.
|
|
139
|
+
- New `@checkstack/pluginmanager-frontend` admin UI: installed-plugins list
|
|
140
|
+
with per-row uninstall (typed-confirmation modal, schema/configs/cascade
|
|
141
|
+
toggles), install page with NPM / Tarball Upload / GitHub Release tabs
|
|
142
|
+
(Catalog tab disabled — coming soon), and an events page surfacing the
|
|
143
|
+
install/uninstall audit log.
|
|
144
|
+
- New `bunx @checkstack/scripts plugin-pack` CLI for plugin authors —
|
|
145
|
+
per-package mode produces an npm-shaped tarball; `--bundle` mode produces
|
|
146
|
+
an outer tarball containing every sibling declared in
|
|
147
|
+
`package.json#checkstack.bundle`. Published to npm so external authors
|
|
148
|
+
can `bunx` it directly without a workspace checkout.
|
|
149
|
+
- Compatibility derived from `package.json#dependencies` ranges
|
|
150
|
+
(`semver.satisfies` against the platform's loaded `@checkstack/*`
|
|
151
|
+
versions) — no separate `compatibility` field.
|
|
152
|
+
- Multi-instance: originator persists artifacts + `plugins` rows + broadcasts
|
|
153
|
+
install/uninstall; receiving instances do in-process register/unregister
|
|
154
|
+
only. Destructive ops (drop schema, delete plugin_configs, delete
|
|
155
|
+
artifacts, delete `plugins` rows) run exactly once on the originator.
|
|
156
|
+
- Fresh-instance bootstrap: `loadPlugins()` hydrates any
|
|
157
|
+
`is_uninstallable=true` plugin missing from `node_modules` from the
|
|
158
|
+
artifact store before normal Phase 1 register.
|
|
159
|
+
- New schema: `plugin_artifacts` (tarball storage), `plugin_install_events`
|
|
160
|
+
(audit/error log). `plugins` extended with `version`, `metadata`,
|
|
161
|
+
`source`, `bundle_id`, `is_primary`. Local plugin sync now writes
|
|
162
|
+
`version` from each plugin's `package.json` so the admin UI shows real
|
|
163
|
+
versions instead of `—`.
|
|
164
|
+
- Tarball-upload endpoint (`POST /api/pluginmanager/upload-tarball`) for
|
|
165
|
+
the install UI; access-gated by `pluginmanager.plugin.manage`.
|
|
166
|
+
- Plugin Manager menu link added to the user menu (main grid, alongside
|
|
167
|
+
Profile / Notification Settings / etc.).
|
|
168
|
+
|
|
169
|
+
Cross-cutting changes:
|
|
170
|
+
|
|
171
|
+
- Backend request/response logging now flows through `rootLogger` (winston)
|
|
172
|
+
instead of `hono/logger`. 5xx responses include the response body inline
|
|
173
|
+
so swallowed early-return errors are visible in the log.
|
|
174
|
+
- The `/api/:pluginId/*` dispatcher now logs which core service is missing
|
|
175
|
+
or which `pluginId` had no metadata when it 500s.
|
|
176
|
+
- New `registerCorePluginMetadata` on `PluginManager` for core routers
|
|
177
|
+
(like the plugin manager itself) that need their metadata visible to the
|
|
178
|
+
RPC dispatcher without going through the full plugin lifecycle.
|
|
179
|
+
- ESLint: `unicorn/no-null` is now disabled globally. Drizzle distinguishes
|
|
180
|
+
between `null` (writes a real SQL NULL) and `undefined` (skip the column
|
|
181
|
+
on insert), so treating them as interchangeable produced latent bugs at
|
|
182
|
+
the persistence boundary. The bulk of the patch-bumped packages above
|
|
183
|
+
reflect lint-fix touches that landed when this rule was relaxed.
|
|
184
|
+
- Workspace-wide license normalization to `Elastic-2.0` (matches
|
|
185
|
+
`LICENSE.md`). Every `package.json` in the workspace now declares the
|
|
186
|
+
same SPDX identifier; the patch bumps capture this.
|
|
187
|
+
|
|
188
|
+
Plugin packages (every `plugins/*`): added a `pack` npm script
|
|
189
|
+
(`bunx @checkstack/scripts plugin-pack`), mirrored each plugin's
|
|
190
|
+
`pluginId` from `plugin-metadata.ts` into `package.json#checkstack.pluginId`
|
|
191
|
+
so install-time validation passes, stubbed any missing required metadata
|
|
192
|
+
fields (`description`, `author`, `license`), and added
|
|
193
|
+
`checkstack.bundle` to multi-package plugin primaries (telegram, rcon, ssh,
|
|
194
|
+
jira, queue-bullmq, queue-memory, cache-memory).
|
|
195
|
+
|
|
196
|
+
Breaking changes:
|
|
197
|
+
|
|
198
|
+
- The legacy single-method `PluginInstaller` interface (`install(packageName)`)
|
|
199
|
+
is removed. Callers must use `coreServices.pluginInstallerRegistry`.
|
|
200
|
+
- The old `pluginAdminContract` and `createPluginAdminRouter` are removed.
|
|
201
|
+
Replaced by `pluginManagerContract` in `@checkstack/pluginmanager-common`
|
|
202
|
+
and `createPluginManagerRouter` in `core/backend`.
|
|
203
|
+
- `@checkstack/test-utils-backend` no longer exports
|
|
204
|
+
`createMockPluginInstaller` / `MockPluginInstaller` (the legacy interface
|
|
205
|
+
it shimmed is gone).
|
|
206
|
+
|
|
207
|
+
Note: bumps are limited to `minor` (for packages with new public API
|
|
208
|
+
surface) and `patch` (for downstream consumers, license normalization,
|
|
209
|
+
and lint fixes). No `major` bumps despite the `PluginInstaller` removal —
|
|
210
|
+
the legacy interface had no third-party consumers in the wild before this
|
|
211
|
+
runtime plugin system landed, and the contract surface is the same shape
|
|
212
|
+
modulo the rename.
|
|
213
|
+
|
|
214
|
+
- Updated dependencies [50e5f5f]
|
|
215
|
+
- @checkstack/catalog-common@2.0.1
|
|
216
|
+
- @checkstack/common@0.8.0
|
|
217
|
+
- @checkstack/dashboard-frontend@0.6.1
|
|
218
|
+
- @checkstack/notification-frontend@0.3.1
|
|
219
|
+
- @checkstack/signal-frontend@0.1.1
|
|
220
|
+
- @checkstack/ui@1.7.1
|
|
221
|
+
- @checkstack/auth-frontend@0.5.33
|
|
222
|
+
- @checkstack/frontend-api@0.4.2
|
|
223
|
+
- @checkstack/incident-common@1.0.1
|
|
224
|
+
- @checkstack/notification-common@1.0.1
|
|
225
|
+
|
|
3
226
|
## 0.7.0
|
|
4
227
|
|
|
5
228
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/incident-frontend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"license": "Elastic-2.0",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "src/index.tsx",
|
|
6
7
|
"checkstack": {
|
|
7
8
|
"type": "frontend"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"typecheck": "
|
|
11
|
+
"typecheck": "tsgo -b",
|
|
11
12
|
"lint": "bun run lint:code",
|
|
12
13
|
"lint:code": "eslint . --max-warnings 0"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@checkstack/auth-frontend": "0.5.
|
|
16
|
-
"@checkstack/catalog-common": "
|
|
17
|
-
"@checkstack/common": "0.
|
|
18
|
-
"@checkstack/dashboard-frontend": "0.
|
|
19
|
-
"@checkstack/frontend-api": "0.4.
|
|
20
|
-
"@checkstack/incident-common": "0.
|
|
21
|
-
"@checkstack/notification-common": "0.
|
|
22
|
-
"@checkstack/notification-frontend": "0.
|
|
23
|
-
"@checkstack/signal-frontend": "0.1.
|
|
24
|
-
"@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/incident-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",
|
|
25
27
|
"date-fns": "^4.1.0",
|
|
26
28
|
"lucide-react": "^0.344.0",
|
|
27
29
|
"react": "^18.2.0",
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"devDependencies": {
|
|
31
33
|
"typescript": "^5.0.0",
|
|
32
34
|
"@types/react": "^18.2.0",
|
|
33
|
-
"@checkstack/tsconfig": "0.0.
|
|
34
|
-
"@checkstack/scripts": "0.
|
|
35
|
+
"@checkstack/tsconfig": "0.0.7",
|
|
36
|
+
"@checkstack/scripts": "0.3.0"
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
SelectContent,
|
|
27
27
|
SelectItem,
|
|
28
28
|
StatusUpdateTimeline,
|
|
29
|
+
LinksEditor,
|
|
29
30
|
} from "@checkstack/ui";
|
|
30
31
|
import { Plus, MessageSquare, Loader2, AlertCircle } from "lucide-react";
|
|
31
32
|
import { IncidentUpdateForm } from "./IncidentUpdateForm";
|
|
@@ -86,6 +87,24 @@ export const IncidentEditor: React.FC<Props> = ({
|
|
|
86
87
|
},
|
|
87
88
|
});
|
|
88
89
|
|
|
90
|
+
const addLinkMutation = incidentClient.addLink.useMutation({
|
|
91
|
+
onSuccess: () => {
|
|
92
|
+
void refetchDetail();
|
|
93
|
+
},
|
|
94
|
+
onError: (error) => {
|
|
95
|
+
toast.error(extractErrorMessage(error, "Failed to add link"));
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const removeLinkMutation = incidentClient.removeLink.useMutation({
|
|
100
|
+
onSuccess: () => {
|
|
101
|
+
void refetchDetail();
|
|
102
|
+
},
|
|
103
|
+
onError: (error) => {
|
|
104
|
+
toast.error(extractErrorMessage(error, "Failed to remove link"));
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
89
108
|
// Query for incident details (only when editing)
|
|
90
109
|
const { data: incidentDetail, refetch: refetchDetail } =
|
|
91
110
|
incidentClient.getIncident.useQuery(
|
|
@@ -341,6 +360,30 @@ export const IncidentEditor: React.FC<Props> = ({
|
|
|
341
360
|
</div>
|
|
342
361
|
)}
|
|
343
362
|
|
|
363
|
+
{/* Hotlinks (Jira tickets, runbooks, ...) — editing only */}
|
|
364
|
+
{incident && (
|
|
365
|
+
<div className="border-t pt-4">
|
|
366
|
+
<LinksEditor
|
|
367
|
+
title="Hotlinks"
|
|
368
|
+
description="Attach Jira tickets, runbooks, dashboards, or any URL relevant to this incident."
|
|
369
|
+
links={incidentDetail?.links ?? []}
|
|
370
|
+
busy={
|
|
371
|
+
addLinkMutation.isPending || removeLinkMutation.isPending
|
|
372
|
+
}
|
|
373
|
+
onAdd={async ({ label, url }) => {
|
|
374
|
+
await addLinkMutation.mutateAsync({
|
|
375
|
+
incidentId: incident.id,
|
|
376
|
+
label,
|
|
377
|
+
url,
|
|
378
|
+
});
|
|
379
|
+
}}
|
|
380
|
+
onRemove={async (link) => {
|
|
381
|
+
await removeLinkMutation.mutateAsync({ id: link.id });
|
|
382
|
+
}}
|
|
383
|
+
/>
|
|
384
|
+
</div>
|
|
385
|
+
)}
|
|
386
|
+
|
|
344
387
|
{/* Team Access Editor - only shown when editing existing incident */}
|
|
345
388
|
{incident?.id && (
|
|
346
389
|
<TeamAccessEditor
|
package/src/index.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export default createFrontendPlugin({
|
|
|
45
45
|
createSlotExtension(UserMenuItemsSlot, {
|
|
46
46
|
id: "incident.user-menu.items",
|
|
47
47
|
component: IncidentMenuItems,
|
|
48
|
+
metadata: { group: "Reliability" },
|
|
48
49
|
}),
|
|
49
50
|
createSlotExtension(SystemStateBadgesSlot, {
|
|
50
51
|
id: "incident.system-incident-badge",
|
|
@@ -11,11 +11,16 @@ import type {
|
|
|
11
11
|
IncidentWithSystems,
|
|
12
12
|
IncidentStatus,
|
|
13
13
|
} from "@checkstack/incident-common";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
incidentAccess,
|
|
16
|
+
pluginMetadata as incidentPluginMetadata,
|
|
17
|
+
} from "@checkstack/incident-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,
|
|
@@ -210,21 +215,30 @@ const IncidentConfigPageContent: React.FC = () => {
|
|
|
210
215
|
loading={accessLoading}
|
|
211
216
|
allowed={canManage}
|
|
212
217
|
actions={
|
|
213
|
-
<
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
<Tip
|
|
219
|
+
plugin={incidentPluginMetadata}
|
|
220
|
+
id="report"
|
|
221
|
+
title="Incidents are deliberate, not automatic"
|
|
222
|
+
description="Incidents in Checkstack are events you open by hand for real, user-visible problems — they're not auto-created from failing health checks. Use “Report Incident” to record an outage you've detected (your own monitoring, a customer ticket, a security event) so it shows up on the dashboard and the public status page, and so subscribers get notified."
|
|
223
|
+
side="bottom"
|
|
224
|
+
align="end"
|
|
225
|
+
>
|
|
226
|
+
<Button onClick={handleCreate}>
|
|
227
|
+
<Plus className="h-4 w-4 mr-2" />
|
|
228
|
+
Report Incident
|
|
229
|
+
</Button>
|
|
230
|
+
</Tip>
|
|
217
231
|
}
|
|
218
232
|
>
|
|
219
233
|
<Card>
|
|
220
234
|
<CardHeader className="border-b border-border">
|
|
221
|
-
<
|
|
235
|
+
<CardHeaderRow>
|
|
222
236
|
<div className="flex items-center gap-2">
|
|
223
237
|
<AlertTriangle className="h-5 w-5 text-muted-foreground" />
|
|
224
238
|
<CardTitle>Incidents</CardTitle>
|
|
225
239
|
</div>
|
|
226
|
-
<div className="flex items-center gap-4">
|
|
227
|
-
<label className="flex items-center gap-2 text-sm">
|
|
240
|
+
<div className="flex flex-wrap items-center gap-3 sm:gap-4">
|
|
241
|
+
<label className="flex items-center gap-2 text-sm whitespace-nowrap">
|
|
228
242
|
<input
|
|
229
243
|
type="checkbox"
|
|
230
244
|
checked={showResolved}
|
|
@@ -239,7 +253,7 @@ const IncidentConfigPageContent: React.FC = () => {
|
|
|
239
253
|
setStatusFilter(v as IncidentStatus | "all")
|
|
240
254
|
}
|
|
241
255
|
>
|
|
242
|
-
<SelectTrigger className="w-40">
|
|
256
|
+
<SelectTrigger className="w-full sm:w-40">
|
|
243
257
|
<SelectValue placeholder="Filter by status" />
|
|
244
258
|
</SelectTrigger>
|
|
245
259
|
<SelectContent>
|
|
@@ -252,7 +266,7 @@ const IncidentConfigPageContent: React.FC = () => {
|
|
|
252
266
|
</SelectContent>
|
|
253
267
|
</Select>
|
|
254
268
|
</div>
|
|
255
|
-
</
|
|
269
|
+
</CardHeaderRow>
|
|
256
270
|
</CardHeader>
|
|
257
271
|
<CardContent className="p-0">
|
|
258
272
|
{loading ? (
|
|
@@ -261,8 +275,22 @@ const IncidentConfigPageContent: React.FC = () => {
|
|
|
261
275
|
</div>
|
|
262
276
|
) : incidents.length === 0 ? (
|
|
263
277
|
<EmptyState
|
|
278
|
+
icon={<AlertTriangle className="size-10" />}
|
|
264
279
|
title="No incidents found"
|
|
265
|
-
description="
|
|
280
|
+
description="Incidents capture real, user-visible problems with the systems you monitor. They're created intentionally — Checkstack does not auto-open them from failed health checks, because not every failed check is a real outage. Open one by hand whenever something's actually broken so it shows up on the dashboard, on the status page, and reaches subscribers."
|
|
281
|
+
steps={[
|
|
282
|
+
"Adjust the filters above if you're looking for resolved or older incidents.",
|
|
283
|
+
"Click “Report Incident” to record an outage you've detected.",
|
|
284
|
+
"Linked systems and severity drive who gets notified — set them deliberately.",
|
|
285
|
+
]}
|
|
286
|
+
actions={
|
|
287
|
+
canManage ? (
|
|
288
|
+
<Button onClick={handleCreate}>
|
|
289
|
+
<Plus className="h-4 w-4 mr-2" />
|
|
290
|
+
Report incident manually
|
|
291
|
+
</Button>
|
|
292
|
+
) : undefined
|
|
293
|
+
}
|
|
266
294
|
/>
|
|
267
295
|
) : (
|
|
268
296
|
<Table>
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
CheckCircle2,
|
|
33
33
|
Server,
|
|
34
34
|
Plus,
|
|
35
|
+
ExternalLink,
|
|
35
36
|
} from "lucide-react";
|
|
36
37
|
import { format, formatDistanceToNow } from "date-fns";
|
|
37
38
|
import { IncidentUpdateForm } from "../components/IncidentUpdateForm";
|
|
@@ -220,6 +221,28 @@ const IncidentDetailPageContent: React.FC = () => {
|
|
|
220
221
|
))}
|
|
221
222
|
</div>
|
|
222
223
|
</div>
|
|
224
|
+
|
|
225
|
+
{incident.links.length > 0 && (
|
|
226
|
+
<div>
|
|
227
|
+
<h4 className="text-sm font-medium text-muted-foreground mb-2">
|
|
228
|
+
Hotlinks
|
|
229
|
+
</h4>
|
|
230
|
+
<div className="flex flex-wrap gap-2">
|
|
231
|
+
{incident.links.map((link) => (
|
|
232
|
+
<a
|
|
233
|
+
key={link.id}
|
|
234
|
+
href={link.url}
|
|
235
|
+
target="_blank"
|
|
236
|
+
rel="noopener noreferrer"
|
|
237
|
+
className="inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs text-primary hover:bg-muted"
|
|
238
|
+
>
|
|
239
|
+
<ExternalLink className="h-3 w-3" />
|
|
240
|
+
<span>{link.label ?? link.url}</span>
|
|
241
|
+
</a>
|
|
242
|
+
))}
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
)}
|
|
223
246
|
</CardContent>
|
|
224
247
|
</Card>
|
|
225
248
|
|
|
@@ -36,7 +36,13 @@ const SystemIncidentHistoryPageContent: React.FC = () => {
|
|
|
36
36
|
const { data: systemsData, isLoading: systemsLoading } =
|
|
37
37
|
catalogClient.getSystems.useQuery({});
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// Sort: active incidents (non-resolved) first, then by creation date desc.
|
|
40
|
+
const incidents = (incidentsData?.incidents ?? []).toSorted((a, b) => {
|
|
41
|
+
const aActive = a.status === "resolved" ? 1 : 0;
|
|
42
|
+
const bActive = b.status === "resolved" ? 1 : 0;
|
|
43
|
+
if (aActive !== bActive) return aActive - bActive;
|
|
44
|
+
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
45
|
+
});
|
|
40
46
|
const systems = systemsData?.systems ?? [];
|
|
41
47
|
const system = systems.find((s) => s.id === systemId);
|
|
42
48
|
const loading = incidentsLoading || systemsLoading;
|
|
@@ -104,8 +110,8 @@ const SystemIncidentHistoryPageContent: React.FC = () => {
|
|
|
104
110
|
<CardContent className="p-0">
|
|
105
111
|
{incidents.length === 0 ? (
|
|
106
112
|
<EmptyState
|
|
107
|
-
title="
|
|
108
|
-
description="
|
|
113
|
+
title="Clean record"
|
|
114
|
+
description="No incidents have been reported for this system. Incidents in Checkstack are created by hand when a real outage or user-visible issue happens — they aren't auto-generated from failing health checks. Anything reported against this system in the future will show up here."
|
|
109
115
|
/>
|
|
110
116
|
) : (
|
|
111
117
|
<div className="divide-y divide-border">
|
package/tsconfig.json
CHANGED
|
@@ -2,5 +2,40 @@
|
|
|
2
2
|
"extends": "@checkstack/tsconfig/frontend.json",
|
|
3
3
|
"include": [
|
|
4
4
|
"src"
|
|
5
|
+
],
|
|
6
|
+
"references": [
|
|
7
|
+
{
|
|
8
|
+
"path": "../auth-frontend"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"path": "../catalog-common"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "../common"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"path": "../dashboard-frontend"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "../frontend-api"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "../incident-common"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "../notification-common"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"path": "../notification-frontend"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "../signal-frontend"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"path": "../tips-frontend"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"path": "../ui"
|
|
39
|
+
}
|
|
5
40
|
]
|
|
6
|
-
}
|
|
41
|
+
}
|