@checkstack/maintenance-frontend 0.0.4 → 0.1.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
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @checkstack/maintenance-frontend
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8e43507: # Teams and Resource-Level Access Control
|
|
8
|
+
|
|
9
|
+
This release introduces a comprehensive Teams system for organizing users and controlling access to resources at a granular level.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
### Team Management
|
|
14
|
+
|
|
15
|
+
- Create, update, and delete teams with name and description
|
|
16
|
+
- Add/remove users from teams
|
|
17
|
+
- Designate team managers with elevated privileges
|
|
18
|
+
- View team membership and manager status
|
|
19
|
+
|
|
20
|
+
### Resource-Level Access Control
|
|
21
|
+
|
|
22
|
+
- Grant teams access to specific resources (systems, health checks, incidents, maintenances)
|
|
23
|
+
- Configure read-only or manage permissions per team
|
|
24
|
+
- Resource-level "Team Only" mode that restricts access exclusively to team members
|
|
25
|
+
- Separate `resourceAccessSettings` table for resource-level settings (not per-grant)
|
|
26
|
+
- Automatic cleanup of grants when teams are deleted (database cascade)
|
|
27
|
+
|
|
28
|
+
### Middleware Integration
|
|
29
|
+
|
|
30
|
+
- Extended `autoAuthMiddleware` to support resource access checks
|
|
31
|
+
- Single-resource pre-handler validation for detail endpoints
|
|
32
|
+
- Automatic list filtering for collection endpoints
|
|
33
|
+
- S2S endpoints for access verification
|
|
34
|
+
|
|
35
|
+
### Frontend Components
|
|
36
|
+
|
|
37
|
+
- `TeamsTab` component for managing teams in Auth Settings
|
|
38
|
+
- `TeamAccessEditor` component for assigning team access to resources
|
|
39
|
+
- Resource-level "Team Only" toggle in `TeamAccessEditor`
|
|
40
|
+
- Integration into System, Health Check, Incident, and Maintenance editors
|
|
41
|
+
|
|
42
|
+
## Breaking Changes
|
|
43
|
+
|
|
44
|
+
### API Response Format Changes
|
|
45
|
+
|
|
46
|
+
List endpoints now return objects with named keys instead of arrays directly:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// Before
|
|
50
|
+
const systems = await catalogApi.getSystems();
|
|
51
|
+
|
|
52
|
+
// After
|
|
53
|
+
const { systems } = await catalogApi.getSystems();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Affected endpoints:
|
|
57
|
+
|
|
58
|
+
- `catalog.getSystems` → `{ systems: [...] }`
|
|
59
|
+
- `healthcheck.getConfigurations` → `{ configurations: [...] }`
|
|
60
|
+
- `incident.listIncidents` → `{ incidents: [...] }`
|
|
61
|
+
- `maintenance.listMaintenances` → `{ maintenances: [...] }`
|
|
62
|
+
|
|
63
|
+
### User Identity Enrichment
|
|
64
|
+
|
|
65
|
+
`RealUser` and `ApplicationUser` types now include `teamIds: string[]` field with team memberships.
|
|
66
|
+
|
|
67
|
+
## Documentation
|
|
68
|
+
|
|
69
|
+
See `docs/backend/teams.md` for complete API reference and integration guide.
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- 97c5a6b: Fix Radix UI accessibility warning in dialog components by adding visually hidden DialogDescription components
|
|
74
|
+
- Updated dependencies [8e43507]
|
|
75
|
+
- Updated dependencies [97c5a6b]
|
|
76
|
+
- Updated dependencies [97c5a6b]
|
|
77
|
+
- Updated dependencies [8e43507]
|
|
78
|
+
- Updated dependencies [8e43507]
|
|
79
|
+
- @checkstack/ui@0.1.0
|
|
80
|
+
- @checkstack/auth-frontend@0.1.0
|
|
81
|
+
- @checkstack/catalog-common@1.0.0
|
|
82
|
+
- @checkstack/common@0.1.0
|
|
83
|
+
- @checkstack/maintenance-common@0.1.0
|
|
84
|
+
- @checkstack/frontend-api@0.0.4
|
|
85
|
+
- @checkstack/signal-frontend@0.0.5
|
|
86
|
+
|
|
3
87
|
## 0.0.4
|
|
4
88
|
|
|
5
89
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/maintenance-frontend",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"scripts": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"lint:code": "eslint . --max-warnings 0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@checkstack/auth-frontend": "workspace:*",
|
|
12
13
|
"@checkstack/catalog-common": "workspace:*",
|
|
13
14
|
"@checkstack/common": "workspace:*",
|
|
14
15
|
"@checkstack/frontend-api": "workspace:*",
|
|
@@ -9,6 +9,7 @@ import type { System } from "@checkstack/catalog-common";
|
|
|
9
9
|
import {
|
|
10
10
|
Dialog,
|
|
11
11
|
DialogContent,
|
|
12
|
+
DialogDescription,
|
|
12
13
|
DialogHeader,
|
|
13
14
|
DialogTitle,
|
|
14
15
|
DialogFooter,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
import { Plus, MessageSquare, Loader2, AlertCircle } from "lucide-react";
|
|
25
26
|
import { MaintenanceUpdateForm } from "./MaintenanceUpdateForm";
|
|
26
27
|
import { getMaintenanceStatusBadge } from "../utils/badges";
|
|
28
|
+
import { TeamAccessEditor } from "@checkstack/auth-frontend";
|
|
27
29
|
|
|
28
30
|
interface Props {
|
|
29
31
|
open: boolean;
|
|
@@ -173,6 +175,11 @@ export const MaintenanceEditor: React.FC<Props> = ({
|
|
|
173
175
|
<DialogTitle>
|
|
174
176
|
{maintenance ? "Edit Maintenance" : "Create Maintenance"}
|
|
175
177
|
</DialogTitle>
|
|
178
|
+
<DialogDescription className="sr-only">
|
|
179
|
+
{maintenance
|
|
180
|
+
? "Modify the settings for this scheduled maintenance"
|
|
181
|
+
: "Schedule a new maintenance window for your systems"}
|
|
182
|
+
</DialogDescription>
|
|
176
183
|
</DialogHeader>
|
|
177
184
|
|
|
178
185
|
<div className="grid gap-6 py-4 max-h-[70vh] overflow-y-auto">
|
|
@@ -301,6 +308,16 @@ export const MaintenanceEditor: React.FC<Props> = ({
|
|
|
301
308
|
)}
|
|
302
309
|
</div>
|
|
303
310
|
)}
|
|
311
|
+
|
|
312
|
+
{/* Team Access Editor - only shown when editing existing maintenance */}
|
|
313
|
+
{maintenance?.id && (
|
|
314
|
+
<TeamAccessEditor
|
|
315
|
+
resourceType="maintenance.maintenance"
|
|
316
|
+
resourceId={maintenance.id}
|
|
317
|
+
compact
|
|
318
|
+
expanded
|
|
319
|
+
/>
|
|
320
|
+
)}
|
|
304
321
|
</div>
|
|
305
322
|
|
|
306
323
|
<DialogFooter>
|
|
@@ -86,12 +86,13 @@ const MaintenanceConfigPageContent: React.FC = () => {
|
|
|
86
86
|
const loadData = async () => {
|
|
87
87
|
setLoading(true);
|
|
88
88
|
try {
|
|
89
|
-
const [maintenanceList, systemList] =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
const [{ maintenances: maintenanceList }, { systems: systemList }] =
|
|
90
|
+
await Promise.all([
|
|
91
|
+
api.listMaintenances(
|
|
92
|
+
statusFilter === "all" ? undefined : { status: statusFilter }
|
|
93
|
+
),
|
|
94
|
+
catalogApi.getSystems(),
|
|
95
|
+
]);
|
|
95
96
|
setMaintenances(maintenanceList);
|
|
96
97
|
setSystems(systemList);
|
|
97
98
|
} catch (error) {
|
|
@@ -73,7 +73,7 @@ const MaintenanceDetailPageContent: React.FC = () => {
|
|
|
73
73
|
|
|
74
74
|
setLoading(true);
|
|
75
75
|
try {
|
|
76
|
-
const [maintenanceData, systemList] = await Promise.all([
|
|
76
|
+
const [maintenanceData, { systems: systemList }] = await Promise.all([
|
|
77
77
|
api.getMaintenance({ id: maintenanceId }),
|
|
78
78
|
catalogApi.getSystems(),
|
|
79
79
|
]);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo } from "react";
|
|
2
2
|
import { useParams, useNavigate } from "react-router-dom";
|
|
3
|
-
import {
|
|
4
|
-
useApi,
|
|
5
|
-
rpcApiRef,
|
|
6
|
-
wrapInSuspense,
|
|
7
|
-
} from "@checkstack/frontend-api";
|
|
3
|
+
import { useApi, rpcApiRef, wrapInSuspense } from "@checkstack/frontend-api";
|
|
8
4
|
import { resolveRoute } from "@checkstack/common";
|
|
9
5
|
import { maintenanceApiRef } from "../api";
|
|
10
6
|
import { maintenanceRoutes } from "@checkstack/maintenance-common";
|
|
@@ -53,10 +49,11 @@ const SystemMaintenanceHistoryPageContent: React.FC = () => {
|
|
|
53
49
|
const loadData = async () => {
|
|
54
50
|
setLoading(true);
|
|
55
51
|
try {
|
|
56
|
-
const [maintenanceList, systemList] =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
const [{ maintenances: maintenanceList }, { systems: systemList }] =
|
|
53
|
+
await Promise.all([
|
|
54
|
+
api.listMaintenances({ systemId }),
|
|
55
|
+
catalogApi.getSystems(),
|
|
56
|
+
]);
|
|
60
57
|
setMaintenances(maintenanceList);
|
|
61
58
|
const system = systemList.find((s) => s.id === systemId);
|
|
62
59
|
setSystemName(system?.name ?? "Unknown System");
|