@burdenoff/microfe-planmagnet 2026.930.3 → 2026.930.4
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/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +112 -107
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/releases/ReleaseChecklistCard.d.ts +5 -0
- package/dist/planmagnet/releases/ReleaseChecklistCard.d.ts.map +1 -0
- package/dist/planmagnet/releases/ReleaseChecklistCard.js +268 -0
- package/dist/planmagnet/releases/ReleaseChecklistCard.js.map +1 -0
- package/dist/planmagnet/releases/ReleaseReadinessCard.d.ts.map +1 -1
- package/dist/planmagnet/releases/ReleaseReadinessCard.js +7 -4
- package/dist/planmagnet/releases/ReleaseReadinessCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsReleaseDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductsReleaseDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"names":[],"mappings":"AAgEA,wBAAgB,6BAA6B,4CAuM5C"}
|
|
@@ -4,16 +4,17 @@ import { ReleaseHeaderActions as n } from "../controls/ReleaseControls.js";
|
|
|
4
4
|
import { ReleaseNotesCard as r } from "../releases/ReleaseNotesCard.js";
|
|
5
5
|
import { ReleaseGatesCard as i } from "../releases/ReleaseGatesCard.js";
|
|
6
6
|
import { ReleaseReadinessCard as a } from "../releases/ReleaseReadinessCard.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
7
|
+
import { ReleaseChecklistCard as o } from "../releases/ReleaseChecklistCard.js";
|
|
8
|
+
import { ReleaseWorkItemsCard as s } from "../releases/ReleaseWorkItemsCard.js";
|
|
9
|
+
import { Calendar as c, Clock as l, GitBranch as u, Loader2 as d } from "lucide-react";
|
|
10
|
+
import { useParams as f } from "react-router";
|
|
11
|
+
import { gql as p } from "@apollo/client";
|
|
12
|
+
import { useQuery as m } from "@apollo/client/react";
|
|
13
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { Badge as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { Markdown as S } from "@burdenoff/fe-libs/shared/components";
|
|
15
16
|
//#region src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx
|
|
16
|
-
var
|
|
17
|
+
var C = p`
|
|
17
18
|
query GetRelease($id: ID!) {
|
|
18
19
|
planmagnetRelease(id: $id) {
|
|
19
20
|
id
|
|
@@ -40,7 +41,7 @@ var S = f`
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
`,
|
|
44
|
+
`, w = {
|
|
44
45
|
DRAFT: "bg-gray-100 text-gray-800",
|
|
45
46
|
PLANNING: "bg-yellow-100 text-yellow-800",
|
|
46
47
|
IN_PROGRESS: "bg-blue-100 text-blue-800",
|
|
@@ -49,105 +50,109 @@ var S = f`
|
|
|
49
50
|
CANCELLED: "bg-red-100 text-red-800",
|
|
50
51
|
ROLLED_BACK: "bg-red-100 text-red-800"
|
|
51
52
|
};
|
|
52
|
-
function
|
|
53
|
-
let { workspaceId:
|
|
54
|
-
variables: { id:
|
|
55
|
-
skip: !
|
|
53
|
+
function T() {
|
|
54
|
+
let { workspaceId: p } = e(), T = f().id ?? "", { data: E, loading: D, error: O } = m(C, {
|
|
55
|
+
variables: { id: T },
|
|
56
|
+
skip: !T
|
|
56
57
|
});
|
|
57
|
-
if (
|
|
58
|
+
if (D && !E) return /* @__PURE__ */ h("div", {
|
|
58
59
|
className: "flex items-center justify-center p-12",
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ h(d, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
60
61
|
});
|
|
61
|
-
if (
|
|
62
|
+
if (O) return /* @__PURE__ */ g("div", {
|
|
62
63
|
className: "p-6 text-destructive",
|
|
63
|
-
children: ["Failed to load release: ",
|
|
64
|
+
children: ["Failed to load release: ", O.message]
|
|
64
65
|
});
|
|
65
|
-
let
|
|
66
|
-
if (!
|
|
66
|
+
let k = E?.planmagnetRelease;
|
|
67
|
+
if (!k) return /* @__PURE__ */ h("div", {
|
|
67
68
|
className: "p-6 text-muted-foreground",
|
|
68
69
|
children: "Release not found."
|
|
69
70
|
});
|
|
70
|
-
let
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
let A = k.workItems ?? [], j = A.filter((e) => e.type === "EPIC" || e.type === "STORY"), M = A.filter((e) => e.type === "BUG"), N = A.length - j.length - M.length;
|
|
72
|
+
return /* @__PURE__ */ g("div", {
|
|
72
73
|
className: "space-y-6 p-6",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ g("div", {
|
|
74
75
|
className: "flex items-center justify-between",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
|
|
76
77
|
className: "flex items-center gap-2",
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ h(u, { className: "h-5 w-5 text-primary" }),
|
|
80
|
+
/* @__PURE__ */ h("h1", {
|
|
80
81
|
className: "text-2xl font-semibold",
|
|
81
|
-
children:
|
|
82
|
+
children: k.version
|
|
82
83
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
className: `text-xs px-2 py-0.5 rounded-full capitalize ${
|
|
85
|
-
children:
|
|
84
|
+
/* @__PURE__ */ h("span", {
|
|
85
|
+
className: `text-xs px-2 py-0.5 rounded-full capitalize ${w[k.status] ?? "bg-gray-100"}`,
|
|
86
|
+
children: k.status.toLowerCase().replace("_", " ")
|
|
86
87
|
})
|
|
87
88
|
]
|
|
88
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ h("p", {
|
|
89
90
|
className: "text-sm text-muted-foreground mt-1",
|
|
90
|
-
children:
|
|
91
|
-
})] }), /* @__PURE__ */
|
|
92
|
-
releaseId:
|
|
93
|
-
version:
|
|
94
|
-
status:
|
|
91
|
+
children: k.name
|
|
92
|
+
})] }), /* @__PURE__ */ h(n, {
|
|
93
|
+
releaseId: k.id,
|
|
94
|
+
version: k.version,
|
|
95
|
+
status: k.status
|
|
95
96
|
})]
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ g("div", {
|
|
97
98
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ g("div", {
|
|
99
100
|
className: "lg:col-span-2 space-y-6",
|
|
100
101
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
releaseId:
|
|
103
|
-
projectId:
|
|
104
|
-
releaseStatus:
|
|
105
|
-
plannedDate:
|
|
102
|
+
/* @__PURE__ */ h(a, {
|
|
103
|
+
releaseId: k.id,
|
|
104
|
+
projectId: k.projectId || null,
|
|
105
|
+
releaseStatus: k.status,
|
|
106
|
+
plannedDate: k.plannedDate ?? null
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */ h(
|
|
108
|
+
/* @__PURE__ */ h(o, {
|
|
109
|
+
releaseId: k.id,
|
|
110
|
+
projectId: k.projectId || null
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ g(v, { children: [/* @__PURE__ */ h(b, { children: /* @__PURE__ */ h(x, { children: "Overview" }) }), /* @__PURE__ */ g(y, {
|
|
108
113
|
className: "space-y-4",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ h("div", {
|
|
110
115
|
className: "text-sm prose prose-sm dark:prose-invert max-w-none",
|
|
111
|
-
children:
|
|
112
|
-
}), /* @__PURE__ */
|
|
116
|
+
children: k.description ? /* @__PURE__ */ h(S, { children: k.description }) : /* @__PURE__ */ h("p", { children: "No description provided." })
|
|
117
|
+
}), /* @__PURE__ */ g("div", {
|
|
113
118
|
className: "grid grid-cols-4 gap-4",
|
|
114
119
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ g("div", {
|
|
116
121
|
className: "text-center p-3 bg-muted rounded-md",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ h("p", {
|
|
118
123
|
className: "text-lg font-semibold mt-1",
|
|
119
|
-
children:
|
|
120
|
-
}), /* @__PURE__ */
|
|
124
|
+
children: j.length
|
|
125
|
+
}), /* @__PURE__ */ h("p", {
|
|
121
126
|
className: "text-xs text-muted-foreground",
|
|
122
127
|
children: "Features"
|
|
123
128
|
})]
|
|
124
129
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ g("div", {
|
|
126
131
|
className: "text-center p-3 bg-muted rounded-md",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ h("p", {
|
|
128
133
|
className: "text-lg font-semibold mt-1",
|
|
129
|
-
children:
|
|
130
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: M.length
|
|
135
|
+
}), /* @__PURE__ */ h("p", {
|
|
131
136
|
className: "text-xs text-muted-foreground",
|
|
132
137
|
children: "Bug Fixes"
|
|
133
138
|
})]
|
|
134
139
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ g("div", {
|
|
136
141
|
className: "text-center p-3 bg-muted rounded-md",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ h("p", {
|
|
138
143
|
className: "text-lg font-semibold mt-1",
|
|
139
|
-
children:
|
|
140
|
-
}), /* @__PURE__ */
|
|
144
|
+
children: N
|
|
145
|
+
}), /* @__PURE__ */ h("p", {
|
|
141
146
|
className: "text-xs text-muted-foreground",
|
|
142
147
|
children: "Other"
|
|
143
148
|
})]
|
|
144
149
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ g("div", {
|
|
146
151
|
className: "text-center p-3 bg-muted rounded-md",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ h("p", {
|
|
148
153
|
className: "text-lg font-semibold mt-1",
|
|
149
|
-
children:
|
|
150
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: A.length
|
|
155
|
+
}), /* @__PURE__ */ h("p", {
|
|
151
156
|
className: "text-xs text-muted-foreground",
|
|
152
157
|
children: "Total Items"
|
|
153
158
|
})]
|
|
@@ -155,104 +160,104 @@ function w() {
|
|
|
155
160
|
]
|
|
156
161
|
})]
|
|
157
162
|
})] }),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
releaseId:
|
|
160
|
-
projectId:
|
|
161
|
-
releaseStatus:
|
|
163
|
+
/* @__PURE__ */ h(i, {
|
|
164
|
+
releaseId: k.id,
|
|
165
|
+
projectId: k.projectId ?? null,
|
|
166
|
+
releaseStatus: k.status
|
|
162
167
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
releaseId:
|
|
165
|
-
notes:
|
|
168
|
+
/* @__PURE__ */ h(r, {
|
|
169
|
+
releaseId: k.id,
|
|
170
|
+
notes: k.releaseNotes ?? null
|
|
166
171
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
releaseId:
|
|
169
|
-
projectId:
|
|
170
|
-
items:
|
|
172
|
+
/* @__PURE__ */ h(s, {
|
|
173
|
+
releaseId: k.id,
|
|
174
|
+
projectId: k.projectId || null,
|
|
175
|
+
items: A
|
|
171
176
|
})
|
|
172
177
|
]
|
|
173
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ g("div", {
|
|
174
179
|
className: "space-y-6",
|
|
175
180
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ g(v, { children: [/* @__PURE__ */ h(b, { children: /* @__PURE__ */ h(x, { children: "Timeline" }) }), /* @__PURE__ */ g(y, {
|
|
177
182
|
className: "space-y-3 text-sm",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ g("div", {
|
|
179
184
|
className: "flex items-center gap-2",
|
|
180
185
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ h(c, { className: "h-4 w-4 text-muted-foreground" }),
|
|
187
|
+
/* @__PURE__ */ h("span", {
|
|
183
188
|
className: "text-muted-foreground",
|
|
184
189
|
children: "Planned:"
|
|
185
190
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ h("span", {
|
|
187
192
|
className: "font-medium",
|
|
188
|
-
children:
|
|
193
|
+
children: k.plannedDate ? new Date(k.plannedDate).toLocaleDateString() : "Not set"
|
|
189
194
|
})
|
|
190
195
|
]
|
|
191
|
-
}),
|
|
196
|
+
}), k.releasedAt && /* @__PURE__ */ g("div", {
|
|
192
197
|
className: "flex items-center gap-2",
|
|
193
198
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ h(l, { className: "h-4 w-4 text-green-500" }),
|
|
200
|
+
/* @__PURE__ */ h("span", {
|
|
196
201
|
className: "text-muted-foreground",
|
|
197
202
|
children: "Released:"
|
|
198
203
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ h("span", {
|
|
200
205
|
className: "font-medium",
|
|
201
|
-
children: new Date(
|
|
206
|
+
children: new Date(k.releasedAt).toLocaleDateString()
|
|
202
207
|
})
|
|
203
208
|
]
|
|
204
209
|
})]
|
|
205
210
|
})] }),
|
|
206
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ g(v, { children: [/* @__PURE__ */ h(b, { children: /* @__PURE__ */ h(x, { children: "Details" }) }), /* @__PURE__ */ g(y, {
|
|
207
212
|
className: "space-y-2 text-sm",
|
|
208
213
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ g("div", {
|
|
210
215
|
className: "flex justify-between",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ h("span", {
|
|
212
217
|
className: "text-muted-foreground",
|
|
213
218
|
children: "Version"
|
|
214
|
-
}), /* @__PURE__ */
|
|
219
|
+
}), /* @__PURE__ */ h("span", {
|
|
215
220
|
className: "font-medium",
|
|
216
|
-
children:
|
|
221
|
+
children: k.version
|
|
217
222
|
})]
|
|
218
223
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ g("div", {
|
|
220
225
|
className: "flex justify-between",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ h("span", {
|
|
222
227
|
className: "text-muted-foreground",
|
|
223
228
|
children: "Status"
|
|
224
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ h(_, {
|
|
225
230
|
variant: "outline",
|
|
226
231
|
className: "text-xs capitalize",
|
|
227
|
-
children:
|
|
232
|
+
children: k.status.toLowerCase().replace("_", " ")
|
|
228
233
|
})]
|
|
229
234
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ g("div", {
|
|
231
236
|
className: "flex justify-between",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ h("span", {
|
|
233
238
|
className: "text-muted-foreground",
|
|
234
239
|
children: "Owner"
|
|
235
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ h("span", { children: /* @__PURE__ */ h(t, { id: k.ownerId }) })]
|
|
236
241
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ g("div", {
|
|
238
243
|
className: "flex justify-between",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ h("span", {
|
|
240
245
|
className: "text-muted-foreground",
|
|
241
246
|
children: "Created"
|
|
242
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ h("span", { children: new Date(k.createdAt).toLocaleDateString() })]
|
|
243
248
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ g("div", {
|
|
245
250
|
className: "flex justify-between",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ h("span", {
|
|
247
252
|
className: "text-muted-foreground",
|
|
248
253
|
children: "Updated"
|
|
249
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ h("span", { children: new Date(k.updatedAt).toLocaleDateString() })]
|
|
250
255
|
})
|
|
251
256
|
]
|
|
252
257
|
})] }),
|
|
253
|
-
|
|
258
|
+
k.tags?.length > 0 && /* @__PURE__ */ g(v, { children: [/* @__PURE__ */ h(b, { children: /* @__PURE__ */ h(x, { children: "Tags" }) }), /* @__PURE__ */ h(y, {
|
|
254
259
|
className: "flex flex-wrap gap-1",
|
|
255
|
-
children:
|
|
260
|
+
children: k.tags.map((e) => /* @__PURE__ */ h(_, {
|
|
256
261
|
variant: "outline",
|
|
257
262
|
className: "text-xs",
|
|
258
263
|
children: e
|
|
@@ -264,6 +269,6 @@ function w() {
|
|
|
264
269
|
});
|
|
265
270
|
}
|
|
266
271
|
//#endregion
|
|
267
|
-
export {
|
|
272
|
+
export { T as ProductsReleaseDetailPagePage };
|
|
268
273
|
|
|
269
274
|
//# sourceMappingURL=ProductsReleaseDetailPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsReleaseDetailPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { GitBranch, Calendar, Clock, Server, Loader2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { useParams } from 'react-router';\nimport { PersonName } from '../people/People';\nimport { ReleaseNotesCard } from '../releases/ReleaseNotesCard';\nimport { ReleaseHeaderActions } from '../controls/ReleaseControls';\nimport { ReleaseGatesCard } from '../releases/ReleaseGatesCard';\nimport { ReleaseReadinessCard } from '../releases/ReleaseReadinessCard';\nimport { ReleaseWorkItemsCard } from '../releases/ReleaseWorkItemsCard';\n\nconst GET_RELEASE = gql`\n query GetRelease($id: ID!) {\n planmagnetRelease(id: $id) {\n id\n workspaceId\n projectId\n name\n description\n version\n status\n plannedDate\n releasedAt\n releaseNotes\n ownerId\n tags\n metadata\n createdAt\n updatedAt\n workItems {\n id\n title\n status\n type\n priority\n }\n }\n }\n`;\n\ninterface WorkItemSummary {\n id: string;\n title: string;\n status: string;\n type: string;\n priority: string;\n}\n\nconst statusColor: Record<string, string> = {\n DRAFT: 'bg-gray-100 text-gray-800',\n PLANNING: 'bg-yellow-100 text-yellow-800',\n IN_PROGRESS: 'bg-blue-100 text-blue-800',\n READY: 'bg-orange-100 text-orange-800',\n RELEASED: 'bg-green-100 text-green-800',\n CANCELLED: 'bg-red-100 text-red-800',\n ROLLED_BACK: 'bg-red-100 text-red-800',\n};\n\nexport function ProductsReleaseDetailPagePage() {\n const { workspaceId } = usePlanMagnet();\n const params = useParams<{ id: string }>();\n const releaseId = params.id ?? '';\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_RELEASE, {\n variables: { id: releaseId },\n skip: !releaseId,\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load release: {error.message}</div>;\n }\n\n const release = data?.planmagnetRelease;\n if (!release) return <div className=\"p-6 text-muted-foreground\">Release not found.</div>;\n\n const workItems: WorkItemSummary[] = release.workItems ?? [];\n // The release notes' classification (svc release-notes.ts): EPIC and STORY are features, BUG a fix, the rest other\n // — so these tiles agree with the notes on the same page and add up to the total (BOFF-7988).\n const featureItems = workItems.filter((w) => w.type === 'EPIC' || w.type === 'STORY');\n const bugItems = workItems.filter((w) => w.type === 'BUG');\n const otherItems = workItems.length - featureItems.length - bugItems.length;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <GitBranch className=\"h-5 w-5 text-primary\" />\n <h1 className=\"text-2xl font-semibold\">{release.version}</h1>\n <span\n className={`text-xs px-2 py-0.5 rounded-full capitalize ${statusColor[release.status] ?? 'bg-gray-100'}`}\n >\n {release.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n <p className=\"text-sm text-muted-foreground mt-1\">{release.name}</p>\n </div>\n {/* Status, Edit and Delete (BOFF-7952): nothing could release, edit or delete a release. */}\n <ReleaseHeaderActions\n releaseId={release.id}\n version={release.version}\n status={release.status}\n />\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n <div className=\"lg:col-span-2 space-y-6\">\n <ReleaseReadinessCard\n releaseId={release.id}\n projectId={release.projectId || null}\n releaseStatus={release.status}\n plannedDate={release.plannedDate ?? null}\n />\n <Card>\n <CardHeader>\n <CardTitle>Overview</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"text-sm prose prose-sm dark:prose-invert max-w-none\">\n {release.description ? (\n <Markdown>{release.description}</Markdown>\n ) : (\n <p>No description provided.</p>\n )}\n </div>\n <div className=\"grid grid-cols-4 gap-4\">\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{featureItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Features</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{bugItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Bug Fixes</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{otherItems}</p>\n <p className=\"text-xs text-muted-foreground\">Other</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{workItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Total Items</p>\n </div>\n </div>\n </CardContent>\n </Card>\n\n <ReleaseGatesCard\n releaseId={release.id}\n projectId={release.projectId ?? null}\n releaseStatus={release.status}\n />\n <ReleaseNotesCard releaseId={release.id} notes={release.releaseNotes ?? null} />\n\n <ReleaseWorkItemsCard\n releaseId={release.id}\n projectId={release.projectId || null}\n items={workItems}\n />\n </div>\n\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle>Timeline</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3 text-sm\">\n <div className=\"flex items-center gap-2\">\n <Calendar className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-muted-foreground\">Planned:</span>\n <span className=\"font-medium\">\n {release.plannedDate\n ? new Date(release.plannedDate).toLocaleDateString()\n : 'Not set'}\n </span>\n </div>\n {release.releasedAt && (\n <div className=\"flex items-center gap-2\">\n <Clock className=\"h-4 w-4 text-green-500\" />\n <span className=\"text-muted-foreground\">Released:</span>\n <span className=\"font-medium\">\n {new Date(release.releasedAt).toLocaleDateString()}\n </span>\n </div>\n )}\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Details</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Version</span>\n <span className=\"font-medium\">{release.version}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Status</span>\n <Badge variant=\"outline\" className=\"text-xs capitalize\">\n {release.status.toLowerCase().replace('_', ' ')}\n </Badge>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Owner</span>\n <span>\n <PersonName id={release.ownerId} />\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Created</span>\n <span>{new Date(release.createdAt).toLocaleDateString()}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Updated</span>\n <span>{new Date(release.updatedAt).toLocaleDateString()}</span>\n </div>\n </CardContent>\n </Card>\n\n {release.tags?.length > 0 && (\n <Card>\n <CardHeader>\n <CardTitle>Tags</CardTitle>\n </CardHeader>\n <CardContent className=\"flex flex-wrap gap-1\">\n {release.tags.map((tag: string) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </CardContent>\n </Card>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAM,IAAc,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCjB,IAAsC;CAC1C,OAAO;CACP,UAAU;CACV,aAAa;CACb,OAAO;CACP,UAAU;CACV,WAAW;CACX,aAAa;CACd;AAED,SAAgB,IAAgC;CAC9C,IAAM,EAAE,mBAAgB,GAAe,EAEjC,IADS,GAA2B,CACjB,MAAM,IAEzB,EACJ,SACA,YAC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C,EAAQ,OAAO,aAAa,CAAC,QAAQ,KAAK,IAAI;SACzC,CAAA,CACJ;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAwB;SAAY,CAAA,EACpD,kBAAC,QAAD,EAAA,UACE,kBAAC,GAAD,EAAY,IAAI,EAAQ,SAAW,CAAA,EAC9B,CAAA,CACH;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAwB;SAAc,CAAA,EACtD,kBAAC,QAAD,EAAA,UAAO,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB,EAAQ,CAAA,CAC3D;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAwB;SAAc,CAAA,EACtD,kBAAC,QAAD,EAAA,UAAO,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB,EAAQ,CAAA,CAC3D;;OACM;QACT,EAAA,CAAA;KAEN,EAAQ,MAAM,SAAS,KACtB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,QAAgB,CAAA,EAChB,CAAA,EACb,kBAAC,GAAD;MAAa,WAAU;gBACpB,EAAQ,KAAK,KAAK,MACjB,kBAAC,GAAD;OAAiB,SAAQ;OAAU,WAAU;iBAC1C;OACK,EAFI,EAEJ,CACR;MACU,CAAA,CACT,EAAA,CAAA;KAEL;MACF;KACF"}
|
|
1
|
+
{"version":3,"file":"ProductsReleaseDetailPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { GitBranch, Calendar, Clock, Server, Loader2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { useParams } from 'react-router';\nimport { PersonName } from '../people/People';\nimport { ReleaseNotesCard } from '../releases/ReleaseNotesCard';\nimport { ReleaseHeaderActions } from '../controls/ReleaseControls';\nimport { ReleaseGatesCard } from '../releases/ReleaseGatesCard';\nimport { ReleaseReadinessCard } from '../releases/ReleaseReadinessCard';\nimport { ReleaseChecklistCard } from '../releases/ReleaseChecklistCard';\nimport { ReleaseWorkItemsCard } from '../releases/ReleaseWorkItemsCard';\n\nconst GET_RELEASE = gql`\n query GetRelease($id: ID!) {\n planmagnetRelease(id: $id) {\n id\n workspaceId\n projectId\n name\n description\n version\n status\n plannedDate\n releasedAt\n releaseNotes\n ownerId\n tags\n metadata\n createdAt\n updatedAt\n workItems {\n id\n title\n status\n type\n priority\n }\n }\n }\n`;\n\ninterface WorkItemSummary {\n id: string;\n title: string;\n status: string;\n type: string;\n priority: string;\n}\n\nconst statusColor: Record<string, string> = {\n DRAFT: 'bg-gray-100 text-gray-800',\n PLANNING: 'bg-yellow-100 text-yellow-800',\n IN_PROGRESS: 'bg-blue-100 text-blue-800',\n READY: 'bg-orange-100 text-orange-800',\n RELEASED: 'bg-green-100 text-green-800',\n CANCELLED: 'bg-red-100 text-red-800',\n ROLLED_BACK: 'bg-red-100 text-red-800',\n};\n\nexport function ProductsReleaseDetailPagePage() {\n const { workspaceId } = usePlanMagnet();\n const params = useParams<{ id: string }>();\n const releaseId = params.id ?? '';\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_RELEASE, {\n variables: { id: releaseId },\n skip: !releaseId,\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load release: {error.message}</div>;\n }\n\n const release = data?.planmagnetRelease;\n if (!release) return <div className=\"p-6 text-muted-foreground\">Release not found.</div>;\n\n const workItems: WorkItemSummary[] = release.workItems ?? [];\n // The release notes' classification (svc release-notes.ts): EPIC and STORY are features, BUG a fix, the rest other\n // — so these tiles agree with the notes on the same page and add up to the total (BOFF-7988).\n const featureItems = workItems.filter((w) => w.type === 'EPIC' || w.type === 'STORY');\n const bugItems = workItems.filter((w) => w.type === 'BUG');\n const otherItems = workItems.length - featureItems.length - bugItems.length;\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <GitBranch className=\"h-5 w-5 text-primary\" />\n <h1 className=\"text-2xl font-semibold\">{release.version}</h1>\n <span\n className={`text-xs px-2 py-0.5 rounded-full capitalize ${statusColor[release.status] ?? 'bg-gray-100'}`}\n >\n {release.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n <p className=\"text-sm text-muted-foreground mt-1\">{release.name}</p>\n </div>\n {/* Status, Edit and Delete (BOFF-7952): nothing could release, edit or delete a release. */}\n <ReleaseHeaderActions\n releaseId={release.id}\n version={release.version}\n status={release.status}\n />\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n <div className=\"lg:col-span-2 space-y-6\">\n <ReleaseReadinessCard\n releaseId={release.id}\n projectId={release.projectId || null}\n releaseStatus={release.status}\n plannedDate={release.plannedDate ?? null}\n />\n {/* PRM-19: the team's readiness criteria; a required one still open blocks releasing. */}\n <ReleaseChecklistCard releaseId={release.id} projectId={release.projectId || null} />\n <Card>\n <CardHeader>\n <CardTitle>Overview</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n <div className=\"text-sm prose prose-sm dark:prose-invert max-w-none\">\n {release.description ? (\n <Markdown>{release.description}</Markdown>\n ) : (\n <p>No description provided.</p>\n )}\n </div>\n <div className=\"grid grid-cols-4 gap-4\">\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{featureItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Features</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{bugItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Bug Fixes</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{otherItems}</p>\n <p className=\"text-xs text-muted-foreground\">Other</p>\n </div>\n <div className=\"text-center p-3 bg-muted rounded-md\">\n <p className=\"text-lg font-semibold mt-1\">{workItems.length}</p>\n <p className=\"text-xs text-muted-foreground\">Total Items</p>\n </div>\n </div>\n </CardContent>\n </Card>\n\n <ReleaseGatesCard\n releaseId={release.id}\n projectId={release.projectId ?? null}\n releaseStatus={release.status}\n />\n <ReleaseNotesCard releaseId={release.id} notes={release.releaseNotes ?? null} />\n\n <ReleaseWorkItemsCard\n releaseId={release.id}\n projectId={release.projectId || null}\n items={workItems}\n />\n </div>\n\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle>Timeline</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3 text-sm\">\n <div className=\"flex items-center gap-2\">\n <Calendar className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-muted-foreground\">Planned:</span>\n <span className=\"font-medium\">\n {release.plannedDate\n ? new Date(release.plannedDate).toLocaleDateString()\n : 'Not set'}\n </span>\n </div>\n {release.releasedAt && (\n <div className=\"flex items-center gap-2\">\n <Clock className=\"h-4 w-4 text-green-500\" />\n <span className=\"text-muted-foreground\">Released:</span>\n <span className=\"font-medium\">\n {new Date(release.releasedAt).toLocaleDateString()}\n </span>\n </div>\n )}\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Details</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Version</span>\n <span className=\"font-medium\">{release.version}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Status</span>\n <Badge variant=\"outline\" className=\"text-xs capitalize\">\n {release.status.toLowerCase().replace('_', ' ')}\n </Badge>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Owner</span>\n <span>\n <PersonName id={release.ownerId} />\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Created</span>\n <span>{new Date(release.createdAt).toLocaleDateString()}</span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-muted-foreground\">Updated</span>\n <span>{new Date(release.updatedAt).toLocaleDateString()}</span>\n </div>\n </CardContent>\n </Card>\n\n {release.tags?.length > 0 && (\n <Card>\n <CardHeader>\n <CardTitle>Tags</CardTitle>\n </CardHeader>\n <CardContent className=\"flex flex-wrap gap-1\">\n {release.tags.map((tag: string) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </CardContent>\n </Card>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,IAAM,IAAc,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCjB,IAAsC;CAC1C,OAAO;CACP,UAAU;CACV,aAAa;CACb,OAAO;CACP,UAAU;CACV,WAAW;CACX,aAAa;CACd;AAED,SAAgB,IAAgC;CAC9C,IAAM,EAAE,mBAAgB,GAAe,EAEjC,IADS,GAA2B,CACjB,MAAM,IAEzB,EACJ,SACA,YACA,aAGA,EAA8B,GAAa;EACzC,WAAW,EAAE,IAAI,GAAW;EAC5B,MAAM,CAAC;EACR,CAAC;AAMJ,KAAI,KAAW,CAAC,EACd,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,8CAA+C,CAAA;EAC9D,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,QAAD;SAAM,WAAU;mBAAwB;SAAY,CAAA,EACpD,kBAAC,QAAD,EAAA,UACE,kBAAC,GAAD,EAAY,IAAI,EAAQ,SAAW,CAAA,EAC9B,CAAA,CACH;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAwB;SAAc,CAAA,EACtD,kBAAC,QAAD,EAAA,UAAO,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB,EAAQ,CAAA,CAC3D;;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAwB;SAAc,CAAA,EACtD,kBAAC,QAAD,EAAA,UAAO,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB,EAAQ,CAAA,CAC3D;;OACM;QACT,EAAA,CAAA;KAEN,EAAQ,MAAM,SAAS,KACtB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,QAAgB,CAAA,EAChB,CAAA,EACb,kBAAC,GAAD;MAAa,WAAU;gBACpB,EAAQ,KAAK,KAAK,MACjB,kBAAC,GAAD;OAAiB,SAAQ;OAAU,WAAU;iBAC1C;OACK,EAFI,EAEJ,CACR;MACU,CAAA,CACT,EAAA,CAAA;KAEL;MACF;KACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseChecklistCard.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/releases/ReleaseChecklistCard.tsx"],"names":[],"mappings":"AA4FA,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,SAAS,GACV,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,2CA0NA"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { PersonName as t } from "../people/People.js";
|
|
3
|
+
import { throwOnError as n } from "../utils/mutationResult.js";
|
|
4
|
+
import { ErrorLine as r } from "../controls/ConfirmButton.js";
|
|
5
|
+
import { useState as i } from "react";
|
|
6
|
+
import { Copy as a, Plus as ee, X as o } from "lucide-react";
|
|
7
|
+
import { gql as s } from "@apollo/client";
|
|
8
|
+
import { useMutation as c, useQuery as l } from "@apollo/client/react";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { Badge as f, Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Input as v } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
//#region src/planmagnet/releases/ReleaseChecklistCard.tsx
|
|
12
|
+
var y = s`
|
|
13
|
+
query ReleaseChecklist($id: ID!) {
|
|
14
|
+
planmagnetRelease(id: $id) {
|
|
15
|
+
id
|
|
16
|
+
checklist {
|
|
17
|
+
id
|
|
18
|
+
label
|
|
19
|
+
isRequired
|
|
20
|
+
isDone
|
|
21
|
+
doneBy
|
|
22
|
+
doneAt
|
|
23
|
+
note
|
|
24
|
+
position
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`, b = s`
|
|
29
|
+
query ReleaseChecklistSources($workspaceId: ID!, $filter: PlanmagnetReleaseFilter) {
|
|
30
|
+
planmagnetReleases(workspaceId: $workspaceId, filter: $filter, pagination: { first: 50 }) {
|
|
31
|
+
items {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
version
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`, te = s`
|
|
39
|
+
mutation ReleaseChecklistAdd($releaseId: ID!, $input: PlanmagnetAddReleaseChecklistItemInput!) {
|
|
40
|
+
planmagnetAddReleaseChecklistItem(releaseId: $releaseId, input: $input) {
|
|
41
|
+
id
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`, x = s`
|
|
45
|
+
mutation ReleaseChecklistSetDone($id: ID!, $done: Boolean!) {
|
|
46
|
+
planmagnetSetReleaseChecklistItemDone(id: $id, done: $done) {
|
|
47
|
+
id
|
|
48
|
+
isDone
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`, S = s`
|
|
52
|
+
mutation ReleaseChecklistRemove($id: ID!) {
|
|
53
|
+
planmagnetRemoveReleaseChecklistItem(id: $id)
|
|
54
|
+
}
|
|
55
|
+
`, C = s`
|
|
56
|
+
mutation ReleaseChecklistCopy($releaseId: ID!, $fromReleaseId: ID!) {
|
|
57
|
+
planmagnetCopyReleaseChecklist(releaseId: $releaseId, fromReleaseId: $fromReleaseId) {
|
|
58
|
+
id
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
function w({ releaseId: s, projectId: w }) {
|
|
63
|
+
let { workspaceId: T } = e(), { data: E, loading: D, error: O } = l(y, {
|
|
64
|
+
variables: { id: s },
|
|
65
|
+
skip: !s
|
|
66
|
+
}), [k, A] = i(!1), j = l(b, {
|
|
67
|
+
variables: {
|
|
68
|
+
workspaceId: T,
|
|
69
|
+
filter: w ? { projectId: w } : {}
|
|
70
|
+
},
|
|
71
|
+
skip: !k || !T
|
|
72
|
+
}), M = {
|
|
73
|
+
refetchQueries: [
|
|
74
|
+
"ReleaseChecklist",
|
|
75
|
+
"ReleaseReadiness",
|
|
76
|
+
"GetRelease"
|
|
77
|
+
],
|
|
78
|
+
awaitRefetchQueries: !0
|
|
79
|
+
}, [N, P] = c(te, M), [F, I] = c(x, M), [L, R] = c(S, M), [z, B] = c(C, M), [V, H] = i(""), [U, W] = i(!0), [G, K] = i(""), [q, J] = i(null), Y = P.loading || I.loading || R.loading || B.loading, X = E?.planmagnetRelease?.checklist ?? [], Z = X.filter((e) => e.isDone).length, Q = X.filter((e) => e.isRequired && !e.isDone).length, ne = (j.data?.planmagnetReleases.items ?? []).filter((e) => e.id !== s), $ = async (e, t) => {
|
|
80
|
+
J(null);
|
|
81
|
+
try {
|
|
82
|
+
return await n(e()), !0;
|
|
83
|
+
} catch (e) {
|
|
84
|
+
return J(e instanceof Error ? e.message : t), !1;
|
|
85
|
+
}
|
|
86
|
+
}, re = async () => {
|
|
87
|
+
await $(() => N({ variables: {
|
|
88
|
+
releaseId: s,
|
|
89
|
+
input: {
|
|
90
|
+
label: V.trim(),
|
|
91
|
+
isRequired: U
|
|
92
|
+
}
|
|
93
|
+
} }), "The item could not be added.") && (H(""), W(!0));
|
|
94
|
+
}, ie = async () => {
|
|
95
|
+
await $(() => z({ variables: {
|
|
96
|
+
releaseId: s,
|
|
97
|
+
fromReleaseId: G
|
|
98
|
+
} }), "The checklist could not be copied.") && (A(!1), K(""));
|
|
99
|
+
};
|
|
100
|
+
return /* @__PURE__ */ d(m, {
|
|
101
|
+
"data-testid": "release-checklist",
|
|
102
|
+
children: [/* @__PURE__ */ d(g, {
|
|
103
|
+
className: "flex flex-row items-center justify-between space-y-0",
|
|
104
|
+
children: [/* @__PURE__ */ u(_, { children: "Readiness checklist" }), X.length > 0 && /* @__PURE__ */ d("span", {
|
|
105
|
+
className: "text-xs text-muted-foreground",
|
|
106
|
+
"data-testid": "release-checklist-summary",
|
|
107
|
+
children: [
|
|
108
|
+
Z,
|
|
109
|
+
" of ",
|
|
110
|
+
X.length,
|
|
111
|
+
" done",
|
|
112
|
+
Q > 0 ? ` · ${Q} required still open` : ""
|
|
113
|
+
]
|
|
114
|
+
})]
|
|
115
|
+
}), /* @__PURE__ */ d(h, {
|
|
116
|
+
className: "space-y-2",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ u("p", {
|
|
119
|
+
className: "text-xs text-muted-foreground",
|
|
120
|
+
children: "What must be true before this release ships. A required item still open blocks releasing."
|
|
121
|
+
}),
|
|
122
|
+
q && /* @__PURE__ */ u(r, { message: q }),
|
|
123
|
+
D && !E && /* @__PURE__ */ u("p", {
|
|
124
|
+
className: "text-sm text-muted-foreground",
|
|
125
|
+
children: "Loading…"
|
|
126
|
+
}),
|
|
127
|
+
O && /* @__PURE__ */ d("p", {
|
|
128
|
+
role: "alert",
|
|
129
|
+
className: "text-sm text-destructive",
|
|
130
|
+
children: ["The checklist could not be loaded: ", O.message]
|
|
131
|
+
}),
|
|
132
|
+
E && X.length === 0 && /* @__PURE__ */ u("p", {
|
|
133
|
+
className: "text-sm text-muted-foreground",
|
|
134
|
+
children: "No criteria yet — add them, or copy another release's checklist."
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ u("ul", {
|
|
137
|
+
className: "space-y-1",
|
|
138
|
+
children: X.map((e) => /* @__PURE__ */ d("li", {
|
|
139
|
+
className: "flex items-start justify-between gap-2 rounded-md border p-2",
|
|
140
|
+
"data-testid": "release-checklist-item",
|
|
141
|
+
children: [/* @__PURE__ */ d("label", {
|
|
142
|
+
className: "flex min-w-0 items-start gap-2 text-sm cursor-pointer",
|
|
143
|
+
children: [/* @__PURE__ */ u("input", {
|
|
144
|
+
type: "checkbox",
|
|
145
|
+
className: "mt-0.5",
|
|
146
|
+
checked: e.isDone,
|
|
147
|
+
disabled: Y,
|
|
148
|
+
onChange: (t) => void $(() => F({ variables: {
|
|
149
|
+
id: e.id,
|
|
150
|
+
done: t.target.checked
|
|
151
|
+
} }), "The item could not be updated."),
|
|
152
|
+
"aria-label": `${e.label}${e.isDone ? " (done)" : ""}`
|
|
153
|
+
}), /* @__PURE__ */ d("span", {
|
|
154
|
+
className: "min-w-0",
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ u("span", {
|
|
157
|
+
className: e.isDone ? "line-through text-muted-foreground" : "",
|
|
158
|
+
children: e.label
|
|
159
|
+
}),
|
|
160
|
+
!e.isRequired && /* @__PURE__ */ u(f, {
|
|
161
|
+
variant: "outline",
|
|
162
|
+
className: "ml-2 text-xs",
|
|
163
|
+
children: "optional"
|
|
164
|
+
}),
|
|
165
|
+
e.isDone && e.doneBy && /* @__PURE__ */ d("span", {
|
|
166
|
+
className: "block text-xs text-muted-foreground",
|
|
167
|
+
children: [
|
|
168
|
+
"Ticked by ",
|
|
169
|
+
/* @__PURE__ */ u(t, { id: e.doneBy }),
|
|
170
|
+
e.doneAt ? ` on ${new Date(e.doneAt).toLocaleDateString()}` : ""
|
|
171
|
+
]
|
|
172
|
+
}),
|
|
173
|
+
e.note && /* @__PURE__ */ u("span", {
|
|
174
|
+
className: "block text-xs text-muted-foreground",
|
|
175
|
+
children: e.note
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
})]
|
|
179
|
+
}), /* @__PURE__ */ u(p, {
|
|
180
|
+
size: "icon",
|
|
181
|
+
variant: "ghost",
|
|
182
|
+
"aria-label": `Remove "${e.label}" from the checklist`,
|
|
183
|
+
disabled: Y,
|
|
184
|
+
onClick: () => void $(() => L({ variables: { id: e.id } }), "The item could not be removed."),
|
|
185
|
+
children: /* @__PURE__ */ u(o, { className: "h-4 w-4" })
|
|
186
|
+
})]
|
|
187
|
+
}, e.id))
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ d("div", {
|
|
190
|
+
className: "flex flex-wrap items-center gap-2 border-t pt-3",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ u(v, {
|
|
193
|
+
"aria-label": "New checklist item",
|
|
194
|
+
placeholder: "e.g. Docs updated",
|
|
195
|
+
value: V,
|
|
196
|
+
maxLength: 200,
|
|
197
|
+
onChange: (e) => H(e.target.value),
|
|
198
|
+
className: "min-w-[12rem] flex-1",
|
|
199
|
+
"data-testid": "release-checklist-new"
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ d("label", {
|
|
202
|
+
className: "flex items-center gap-1 text-xs",
|
|
203
|
+
children: [/* @__PURE__ */ u("input", {
|
|
204
|
+
type: "checkbox",
|
|
205
|
+
checked: U,
|
|
206
|
+
onChange: (e) => W(e.target.checked)
|
|
207
|
+
}), "Required"]
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ d(p, {
|
|
210
|
+
size: "sm",
|
|
211
|
+
disabled: !V.trim() || Y,
|
|
212
|
+
onClick: () => void re(),
|
|
213
|
+
"data-testid": "release-checklist-add",
|
|
214
|
+
children: [/* @__PURE__ */ u(ee, { className: "mr-1 h-4 w-4" }), " Add"]
|
|
215
|
+
}),
|
|
216
|
+
!k && /* @__PURE__ */ d(p, {
|
|
217
|
+
size: "sm",
|
|
218
|
+
variant: "outline",
|
|
219
|
+
onClick: () => A(!0),
|
|
220
|
+
children: [/* @__PURE__ */ u(a, { className: "mr-1 h-4 w-4" }), " Copy from another release"]
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
}),
|
|
224
|
+
k && /* @__PURE__ */ d("div", {
|
|
225
|
+
className: "flex flex-wrap items-center gap-2",
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ d("select", {
|
|
228
|
+
"aria-label": "Release to copy the checklist from",
|
|
229
|
+
className: "min-w-[12rem] flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
230
|
+
value: G,
|
|
231
|
+
onChange: (e) => K(e.target.value),
|
|
232
|
+
"data-testid": "release-checklist-copy-from",
|
|
233
|
+
children: [/* @__PURE__ */ u("option", {
|
|
234
|
+
value: "",
|
|
235
|
+
children: j.loading && !j.data ? "Loading releases…" : "Choose a release"
|
|
236
|
+
}), ne.map((e) => /* @__PURE__ */ d("option", {
|
|
237
|
+
value: e.id,
|
|
238
|
+
children: [
|
|
239
|
+
e.name,
|
|
240
|
+
" (",
|
|
241
|
+
e.version,
|
|
242
|
+
")"
|
|
243
|
+
]
|
|
244
|
+
}, e.id))]
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ u(p, {
|
|
247
|
+
size: "sm",
|
|
248
|
+
disabled: !G || Y,
|
|
249
|
+
onClick: () => void ie(),
|
|
250
|
+
"data-testid": "release-checklist-copy",
|
|
251
|
+
children: "Copy"
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ u(p, {
|
|
254
|
+
size: "sm",
|
|
255
|
+
variant: "ghost",
|
|
256
|
+
onClick: () => A(!1),
|
|
257
|
+
children: "Cancel"
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
})]
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { w as ReleaseChecklistCard };
|
|
267
|
+
|
|
268
|
+
//# sourceMappingURL=ReleaseChecklistCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseChecklistCard.js","names":[],"sources":["../../../src/planmagnet/releases/ReleaseChecklistCard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Input,\n} from '@burdenoff/fe-libs/ui';\nimport { Copy, Plus, X } from 'lucide-react';\nimport { ErrorLine } from '../controls/ConfirmButton';\nimport { PersonName } from '../people/People';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { throwOnError } from '../utils/mutationResult';\n\n/**\n * The release's readiness checklist (PRM-19): the criteria the team defines — docs updated, security sign-off — and\n * ticks off before shipping. A REQUIRED item still open blocks releasing (the server refuses RELEASED and names it,\n * as it does for an open quality gate); optional ones are shown but never block. \"Copy from\" brings another\n * release's criteria (never its ticks), so a team writes its list once.\n */\n\nconst CHECKLIST = gql`\n query ReleaseChecklist($id: ID!) {\n planmagnetRelease(id: $id) {\n id\n checklist {\n id\n label\n isRequired\n isDone\n doneBy\n doneAt\n note\n position\n }\n }\n }\n`;\nconst OTHER_RELEASES = gql`\n query ReleaseChecklistSources($workspaceId: ID!, $filter: PlanmagnetReleaseFilter) {\n planmagnetReleases(workspaceId: $workspaceId, filter: $filter, pagination: { first: 50 }) {\n items {\n id\n name\n version\n }\n }\n }\n`;\nconst ADD = gql`\n mutation ReleaseChecklistAdd($releaseId: ID!, $input: PlanmagnetAddReleaseChecklistItemInput!) {\n planmagnetAddReleaseChecklistItem(releaseId: $releaseId, input: $input) {\n id\n }\n }\n`;\nconst SET_DONE = gql`\n mutation ReleaseChecklistSetDone($id: ID!, $done: Boolean!) {\n planmagnetSetReleaseChecklistItemDone(id: $id, done: $done) {\n id\n isDone\n }\n }\n`;\nconst REMOVE = gql`\n mutation ReleaseChecklistRemove($id: ID!) {\n planmagnetRemoveReleaseChecklistItem(id: $id)\n }\n`;\nconst COPY = gql`\n mutation ReleaseChecklistCopy($releaseId: ID!, $fromReleaseId: ID!) {\n planmagnetCopyReleaseChecklist(releaseId: $releaseId, fromReleaseId: $fromReleaseId) {\n id\n }\n }\n`;\n\ninterface ChecklistItem {\n id: string;\n label: string;\n isRequired: boolean;\n isDone: boolean;\n doneBy: string | null;\n doneAt: string | null;\n note: string | null;\n position: number;\n}\n\nexport function ReleaseChecklistCard({\n releaseId,\n projectId,\n}: {\n releaseId: string;\n projectId: string | null;\n}) {\n const { workspaceId } = usePlanMagnet();\n const { data, loading, error } = useQuery<{\n planmagnetRelease: { id: string; checklist: ChecklistItem[] } | null;\n }>(CHECKLIST, { variables: { id: releaseId }, skip: !releaseId });\n const [copying, setCopying] = useState(false);\n const sources = useQuery<{\n planmagnetReleases: { items: { id: string; name: string; version: string }[] };\n }>(OTHER_RELEASES, {\n variables: { workspaceId, filter: projectId ? { projectId } : {} },\n skip: !copying || !workspaceId,\n });\n const refetch = {\n refetchQueries: ['ReleaseChecklist', 'ReleaseReadiness', 'GetRelease'],\n awaitRefetchQueries: true,\n };\n const [add, addState] = useMutation(ADD, refetch);\n const [setDone, setDoneState] = useMutation(SET_DONE, refetch);\n const [remove, removeState] = useMutation(REMOVE, refetch);\n const [copy, copyState] = useMutation(COPY, refetch);\n const [label, setLabel] = useState('');\n const [required, setRequired] = useState(true);\n const [fromReleaseId, setFromReleaseId] = useState('');\n const [problem, setProblem] = useState<string | null>(null);\n const busy = addState.loading || setDoneState.loading || removeState.loading || copyState.loading;\n\n const items = data?.planmagnetRelease?.checklist ?? [];\n const done = items.filter((i) => i.isDone).length;\n const openRequired = items.filter((i) => i.isRequired && !i.isDone).length;\n const others = (sources.data?.planmagnetReleases.items ?? []).filter((r) => r.id !== releaseId);\n\n const run = async (\n action: () => Promise<{ error?: unknown }>,\n fallback: string\n ): Promise<boolean> => {\n setProblem(null);\n try {\n await throwOnError(action());\n return true;\n } catch (e) {\n setProblem(e instanceof Error ? e.message : fallback);\n return false;\n }\n };\n\n const addItem = async () => {\n const ok = await run(\n () => add({ variables: { releaseId, input: { label: label.trim(), isRequired: required } } }),\n 'The item could not be added.'\n );\n if (ok) {\n setLabel('');\n setRequired(true);\n }\n };\n\n const copyFrom = async () => {\n const ok = await run(\n () => copy({ variables: { releaseId, fromReleaseId } }),\n 'The checklist could not be copied.'\n );\n if (ok) {\n setCopying(false);\n setFromReleaseId('');\n }\n };\n\n return (\n <Card data-testid=\"release-checklist\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0\">\n <CardTitle>Readiness checklist</CardTitle>\n {items.length > 0 && (\n <span className=\"text-xs text-muted-foreground\" data-testid=\"release-checklist-summary\">\n {done} of {items.length} done\n {openRequired > 0 ? ` · ${openRequired} required still open` : ''}\n </span>\n )}\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <p className=\"text-xs text-muted-foreground\">\n What must be true before this release ships. A required item still open blocks releasing.\n </p>\n {problem && <ErrorLine message={problem} />}\n {loading && !data && <p className=\"text-sm text-muted-foreground\">Loading…</p>}\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n The checklist could not be loaded: {error.message}\n </p>\n )}\n {data && items.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">\n No criteria yet — add them, or copy another release's checklist.\n </p>\n )}\n <ul className=\"space-y-1\">\n {items.map((item) => (\n <li\n key={item.id}\n className=\"flex items-start justify-between gap-2 rounded-md border p-2\"\n data-testid=\"release-checklist-item\"\n >\n <label className=\"flex min-w-0 items-start gap-2 text-sm cursor-pointer\">\n <input\n type=\"checkbox\"\n className=\"mt-0.5\"\n checked={item.isDone}\n disabled={busy}\n onChange={(e) =>\n void run(\n () => setDone({ variables: { id: item.id, done: e.target.checked } }),\n 'The item could not be updated.'\n )\n }\n aria-label={`${item.label}${item.isDone ? ' (done)' : ''}`}\n />\n <span className=\"min-w-0\">\n <span className={item.isDone ? 'line-through text-muted-foreground' : ''}>\n {item.label}\n </span>\n {!item.isRequired && (\n <Badge variant=\"outline\" className=\"ml-2 text-xs\">\n optional\n </Badge>\n )}\n {item.isDone && item.doneBy && (\n <span className=\"block text-xs text-muted-foreground\">\n Ticked by <PersonName id={item.doneBy} />\n {item.doneAt ? ` on ${new Date(item.doneAt).toLocaleDateString()}` : ''}\n </span>\n )}\n {item.note && (\n <span className=\"block text-xs text-muted-foreground\">{item.note}</span>\n )}\n </span>\n </label>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n aria-label={`Remove \"${item.label}\" from the checklist`}\n disabled={busy}\n onClick={() =>\n void run(\n () => remove({ variables: { id: item.id } }),\n 'The item could not be removed.'\n )\n }\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </li>\n ))}\n </ul>\n <div className=\"flex flex-wrap items-center gap-2 border-t pt-3\">\n <Input\n aria-label=\"New checklist item\"\n placeholder=\"e.g. Docs updated\"\n value={label}\n maxLength={200}\n onChange={(e) => setLabel(e.target.value)}\n className=\"min-w-[12rem] flex-1\"\n data-testid=\"release-checklist-new\"\n />\n <label className=\"flex items-center gap-1 text-xs\">\n <input\n type=\"checkbox\"\n checked={required}\n onChange={(e) => setRequired(e.target.checked)}\n />\n Required\n </label>\n <Button\n size=\"sm\"\n disabled={!label.trim() || busy}\n onClick={() => void addItem()}\n data-testid=\"release-checklist-add\"\n >\n <Plus className=\"mr-1 h-4 w-4\" /> Add\n </Button>\n {!copying && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => setCopying(true)}>\n <Copy className=\"mr-1 h-4 w-4\" /> Copy from another release\n </Button>\n )}\n </div>\n {copying && (\n <div className=\"flex flex-wrap items-center gap-2\">\n <select\n aria-label=\"Release to copy the checklist from\"\n className=\"min-w-[12rem] flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm\"\n value={fromReleaseId}\n onChange={(e) => setFromReleaseId(e.target.value)}\n data-testid=\"release-checklist-copy-from\"\n >\n <option value=\"\">\n {sources.loading && !sources.data ? 'Loading releases…' : 'Choose a release'}\n </option>\n {others.map((r) => (\n <option key={r.id} value={r.id}>\n {r.name} ({r.version})\n </option>\n ))}\n </select>\n <Button\n size=\"sm\"\n disabled={!fromReleaseId || busy}\n onClick={() => void copyFrom()}\n data-testid=\"release-checklist-copy\"\n >\n Copy\n </Button>\n <Button size=\"sm\" variant=\"ghost\" onClick={() => setCopying(false)}>\n Cancel\n </Button>\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,IAAY,CAAG;;;;;;;;;;;;;;;;GAiBf,IAAiB,CAAG;;;;;;;;;;GAWpB,KAAM,CAAG;;;;;;GAOT,IAAW,CAAG;;;;;;;GAQd,IAAS,CAAG;;;;GAKZ,IAAO,CAAG;;;;;;;AAmBhB,SAAgB,EAAqB,EACnC,cACA,gBAIC;CACD,IAAM,EAAE,mBAAgB,GAAe,EACjC,EAAE,SAAM,YAAS,aAAU,EAE9B,GAAW;EAAE,WAAW,EAAE,IAAI,GAAW;EAAE,MAAM,CAAC;EAAW,CAAC,EAC3D,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,IAAU,EAEb,GAAgB;EACjB,WAAW;GAAE;GAAa,QAAQ,IAAY,EAAE,cAAW,GAAG,EAAE;GAAE;EAClE,MAAM,CAAC,KAAW,CAAC;EACpB,CAAC,EACI,IAAU;EACd,gBAAgB;GAAC;GAAoB;GAAoB;GAAa;EACtE,qBAAqB;EACtB,EACK,CAAC,GAAK,KAAY,EAAY,IAAK,EAAQ,EAC3C,CAAC,GAAS,KAAgB,EAAY,GAAU,EAAQ,EACxD,CAAC,GAAQ,KAAe,EAAY,GAAQ,EAAQ,EACpD,CAAC,GAAM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SAAG,EAAE;SAAQ;SACd;UAFI,EAAE,GAEN,CACT,CACK;;MACT,kBAAC,GAAD;OACE,MAAK;OACL,UAAU,CAAC,KAAiB;OAC5B,eAAe,KAAK,IAAU;OAC9B,eAAY;iBACb;OAEQ,CAAA;MACT,kBAAC,GAAD;OAAQ,MAAK;OAAK,SAAQ;OAAQ,eAAe,EAAW,GAAM;iBAAE;OAE3D,CAAA;MACL;;IAEI;KACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseReadinessCard.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/releases/ReleaseReadinessCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReleaseReadinessCard.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/releases/ReleaseReadinessCard.tsx"],"names":[],"mappings":"AA0NA,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,SAAS,EACT,aAAa,EACb,WAAW,GACZ,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,2CA8RA"}
|
|
@@ -16,6 +16,7 @@ var S = p`
|
|
|
16
16
|
totalItems
|
|
17
17
|
doneItems
|
|
18
18
|
openWorkItemIds
|
|
19
|
+
openRequiredChecklist
|
|
19
20
|
blockers {
|
|
20
21
|
workItem {
|
|
21
22
|
id
|
|
@@ -131,8 +132,10 @@ function M({ releaseId: e, projectId: t, releaseStatus: p, plannedDate: k }) {
|
|
|
131
132
|
},
|
|
132
133
|
skip: !M || !t
|
|
133
134
|
}, I = m(S, { variables: { releaseId: e } }), L = m(i, { variables: { id: e } }), R = m(C, F), z = m(w, F), B = m(T, F), V = p === "RELEASED", H = I.data?.planmagnetReleaseReadiness, U = (L.data?.planmagnetRelease?.qualityGates ?? []).filter((e) => e.status !== "PASSED" && e.status !== "WAIVED"), W = R.data?.planmagnetBudgets.items ?? [], G = (z.data?.planmagnetRisks.items ?? []).filter((e) => !E.has(e.status)).sort((e, t) => t.riskScore - e.riskScore), K = new Set(H?.openWorkItemIds ?? []), q = new Set((H?.blockers ?? []).map((e) => e.workItem.id)), J = (B.data?.planmagnetFeatureRequests.items ?? []).filter((e) => e.workItemId && K.has(e.workItemId) && !D.has(e.status)), Y = k && !V ? Math.floor((N - new Date(k).getTime()) / O) : null, X = [];
|
|
134
|
-
Y !== null && Y > 0 && X.push(`${Y} day${Y === 1 ? "" : "s"} past its planned date`), H && H.blockers.length > 0 && X.push(`${H.blockers.length} blocked item${H.blockers.length === 1 ? "" : "s"}`), H && H.openWorkItemIds.length > 0 && X.push(`${H.openWorkItemIds.length} unfinished item${H.openWorkItemIds.length === 1 ? "" : "s"}`), U.length > 0 && X.push(`${U.length} gate${U.length === 1 ? "" : "s"} not passed`)
|
|
135
|
-
let Z =
|
|
135
|
+
Y !== null && Y > 0 && X.push(`${Y} day${Y === 1 ? "" : "s"} past its planned date`), H && H.blockers.length > 0 && X.push(`${H.blockers.length} blocked item${H.blockers.length === 1 ? "" : "s"}`), H && H.openWorkItemIds.length > 0 && X.push(`${H.openWorkItemIds.length} unfinished item${H.openWorkItemIds.length === 1 ? "" : "s"}`), U.length > 0 && X.push(`${U.length} gate${U.length === 1 ? "" : "s"} not passed`);
|
|
136
|
+
let Z = H?.openRequiredChecklist ?? [];
|
|
137
|
+
Z.length > 0 && X.push(`${Z.length} required checklist item${Z.length === 1 ? "" : "s"} open (${Z.join(", ")})`), W.filter((e) => e.remainingAmount < 0 || e.status === "EXCEEDED").length > 0 && X.push("over budget");
|
|
138
|
+
let Q = !I.loading && !L.loading;
|
|
136
139
|
return /* @__PURE__ */ _(v, {
|
|
137
140
|
"data-testid": "release-readiness",
|
|
138
141
|
children: [/* @__PURE__ */ g(b, { children: /* @__PURE__ */ g(x, { children: "What stands between this release and shipping" }) }), /* @__PURE__ */ _(y, {
|
|
@@ -141,11 +144,11 @@ function M({ releaseId: e, projectId: t, releaseStatus: p, plannedDate: k }) {
|
|
|
141
144
|
V ? /* @__PURE__ */ _("p", {
|
|
142
145
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
143
146
|
children: [/* @__PURE__ */ g(s, { className: "h-4 w-4" }), " Released."]
|
|
144
|
-
}) :
|
|
147
|
+
}) : Q && X.length === 0 && H && H.scope !== "NONE" ? /* @__PURE__ */ _("p", {
|
|
145
148
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
146
149
|
"data-testid": "readiness-headline",
|
|
147
150
|
children: [/* @__PURE__ */ g(s, { className: "h-4 w-4" }), " Nothing is holding this release."]
|
|
148
|
-
}) :
|
|
151
|
+
}) : Q && X.length > 0 ? /* @__PURE__ */ _("p", {
|
|
149
152
|
className: "flex items-center gap-2 text-sm text-status-warning-text",
|
|
150
153
|
"data-testid": "readiness-headline",
|
|
151
154
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseReadinessCard.js","names":[],"sources":["../../../src/planmagnet/releases/ReleaseReadinessCard.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { CombinedGraphQLErrors, ServerError } from '@apollo/client/errors';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport {\n AlertTriangle,\n CheckCircle2,\n Link2,\n Wallet,\n Users,\n ShieldAlert,\n Clock,\n} from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { RELEASE_GATES } from './ReleaseGatesCard';\n\n/**\n * Release overview (P1.4): what stands between this release and shipping, in\n * one place: unfinished and dependency-blocked work, gates not yet passed,\n * the budget position of its project, its open risks, and the customer\n * requests that ride on its unfinished work.\n *\n * Each part is read through its OWN gated query. Budgets, risks and feature\n * requests are separate RBAC resources (a product manager can read releases\n * but not budgets), so a part the viewer may not see says so, instead of the\n * release leaking it or the whole card failing.\n */\n\nconst READINESS = gql`\n query ReleaseReadiness($releaseId: ID!) {\n planmagnetReleaseReadiness(releaseId: $releaseId) {\n scope\n totalItems\n doneItems\n openWorkItemIds\n blockers {\n workItem {\n id\n key\n title\n status\n }\n waitingOn {\n id\n key\n title\n status\n projectId\n }\n }\n }\n }\n`;\nconst BUDGETS = gql`\n query ReleaseBudgets($workspaceId: ID!, $projectId: String!) {\n planmagnetBudgets(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 50 }\n ) {\n items {\n id\n name\n status\n currency\n plannedAmount\n spentAmount\n remainingAmount\n approvedAt\n }\n }\n }\n`;\nconst RISKS = gql`\n query ReleaseRisks($workspaceId: ID!, $projectId: String!) {\n planmagnetRisks(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n title\n severity\n status\n riskScore\n }\n }\n }\n`;\nconst REQUESTS = gql`\n query ReleaseCustomerRequests($workspaceId: ID!, $projectId: String!) {\n planmagnetFeatureRequests(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n title\n status\n voteCount\n workItemId\n }\n }\n }\n`;\n\ninterface ItemRef {\n id: string;\n key: string;\n title: string;\n status: string;\n projectId?: string;\n}\ninterface Readiness {\n scope: 'WORK_ITEMS' | 'PROJECTS' | 'NONE';\n totalItems: number;\n doneItems: number;\n openWorkItemIds: string[];\n blockers: { workItem: ItemRef; waitingOn: ItemRef[] }[];\n}\ninterface Budget {\n id: string;\n name: string;\n status: string;\n currency: string;\n plannedAmount: number;\n spentAmount: number;\n remainingAmount: number;\n approvedAt: string | null;\n}\ninterface Risk {\n id: string;\n title: string;\n severity: string;\n status: string;\n riskScore: number;\n}\ninterface Request {\n id: string;\n title: string;\n status: string;\n voteCount: number;\n workItemId: string | null;\n}\n\nconst CLOSED_RISK = new Set(['RESOLVED', 'ACCEPTED', 'CLOSED']);\nconst CLOSED_REQUEST = new Set(['COMPLETED', 'DECLINED', 'DUPLICATE']);\nconst DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Is this the gateway refusing the viewer's role? The gateway answers an RBAC\n * denial with HTTP 403 (400 inside a batch) and `extensions.code: FORBIDDEN`.\n * Depending on the fetch path Apollo surfaces that as GraphQL errors or as a\n * ServerError carrying the body, so both are read.\n */\nfunction denied(error: unknown): boolean {\n if (CombinedGraphQLErrors.is(error)) {\n return error.errors.some((e) => e.extensions?.code === 'FORBIDDEN');\n }\n if (ServerError.is(error)) {\n return error.statusCode === 403 || /\"code\"\\s*:\\s*\"FORBIDDEN\"/.test(error.bodyText);\n }\n return false;\n}\n\n/** One part of the overview: its own title, and its own loading/denied/error state. */\nfunction Part({\n icon,\n title,\n testId,\n loading,\n error,\n children,\n}: {\n icon: ReactNode;\n title: string;\n testId: string;\n loading: boolean;\n error: unknown;\n children: ReactNode;\n}) {\n let body = children;\n if (error) {\n body = (\n <p className=\"text-sm text-muted-foreground\">\n {denied(error)\n ? 'Your role cannot see this.'\n : `Could not be loaded: ${error instanceof Error ? error.message : 'unknown error'}`}\n </p>\n );\n } else if (loading) {\n body = <p className=\"text-sm text-muted-foreground\">Loading…</p>;\n }\n return (\n <section className=\"space-y-1.5\" data-testid={testId}>\n <h3 className=\"flex items-center gap-2 text-sm font-medium\">\n {icon}\n {title}\n </h3>\n {body}\n </section>\n );\n}\n\nconst money = (amount: number, currency: string) => {\n try {\n return new Intl.NumberFormat(undefined, { style: 'currency', currency }).format(amount);\n } catch {\n return `${amount.toFixed(2)} ${currency}`;\n }\n};\n\nexport function ReleaseReadinessCard({\n releaseId,\n projectId,\n releaseStatus,\n plannedDate,\n}: {\n releaseId: string;\n projectId: string | null;\n releaseStatus: string;\n plannedDate: string | null;\n}) {\n const { workspaceId } = usePlanMagnet();\n // Read once: lateness is a property of the page view, not of each render.\n const [now] = useState(() => Date.now());\n const navigate = usePlanMagnetNavigate();\n const byProject = { variables: { workspaceId, projectId }, skip: !workspaceId || !projectId };\n\n const readiness = useQuery<{ planmagnetReleaseReadiness: Readiness }>(READINESS, {\n variables: { releaseId },\n });\n const gates = useQuery<{\n planmagnetRelease: { qualityGates: { id: string; name: string; status: string }[] } | null;\n }>(RELEASE_GATES, { variables: { id: releaseId } });\n const budgets = useQuery<{ planmagnetBudgets: { items: Budget[] } }>(BUDGETS, byProject);\n const risks = useQuery<{ planmagnetRisks: { items: Risk[] } }>(RISKS, byProject);\n const requests = useQuery<{ planmagnetFeatureRequests: { items: Request[] } }>(\n REQUESTS,\n byProject\n );\n\n const shipped = releaseStatus === 'RELEASED';\n const r = readiness.data?.planmagnetReleaseReadiness;\n const openGates = (gates.data?.planmagnetRelease?.qualityGates ?? []).filter(\n (g) => g.status !== 'PASSED' && g.status !== 'WAIVED'\n );\n const budgetRows = budgets.data?.planmagnetBudgets.items ?? [];\n const openRisks = (risks.data?.planmagnetRisks.items ?? [])\n .filter((risk) => !CLOSED_RISK.has(risk.status))\n .sort((a, b) => b.riskScore - a.riskScore);\n const openIds = new Set(r?.openWorkItemIds ?? []);\n const blockedIds = new Set((r?.blockers ?? []).map((b) => b.workItem.id));\n const riding = (requests.data?.planmagnetFeatureRequests.items ?? []).filter(\n (req) => req.workItemId && openIds.has(req.workItemId) && !CLOSED_REQUEST.has(req.status)\n );\n\n const daysLate =\n plannedDate && !shipped ? Math.floor((now - new Date(plannedDate).getTime()) / DAY) : null;\n\n // The headline lists every reason, not just the first one found.\n const reasons: string[] = [];\n if (daysLate !== null && daysLate > 0)\n reasons.push(`${daysLate} day${daysLate === 1 ? '' : 's'} past its planned date`);\n if (r && r.blockers.length > 0)\n reasons.push(`${r.blockers.length} blocked item${r.blockers.length === 1 ? '' : 's'}`);\n if (r && r.openWorkItemIds.length > 0)\n reasons.push(\n `${r.openWorkItemIds.length} unfinished item${r.openWorkItemIds.length === 1 ? '' : 's'}`\n );\n if (openGates.length > 0)\n reasons.push(`${openGates.length} gate${openGates.length === 1 ? '' : 's'} not passed`);\n const overBudget = budgetRows.filter((b) => b.remainingAmount < 0 || b.status === 'EXCEEDED');\n if (overBudget.length > 0) reasons.push('over budget');\n const settled = !readiness.loading && !gates.loading;\n\n return (\n <Card data-testid=\"release-readiness\">\n <CardHeader>\n <CardTitle>What stands between this release and shipping</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-5\">\n {shipped ? (\n <p className=\"flex items-center gap-2 text-sm text-status-success-text\">\n <CheckCircle2 className=\"h-4 w-4\" /> Released.\n </p>\n ) : settled && reasons.length === 0 && r && r.scope !== 'NONE' ? (\n <p\n className=\"flex items-center gap-2 text-sm text-status-success-text\"\n data-testid=\"readiness-headline\"\n >\n <CheckCircle2 className=\"h-4 w-4\" /> Nothing is holding this release.\n </p>\n ) : settled && reasons.length > 0 ? (\n <p\n className=\"flex items-center gap-2 text-sm text-status-warning-text\"\n data-testid=\"readiness-headline\"\n >\n <AlertTriangle className=\"h-4 w-4 shrink-0\" /> Held by: {reasons.join(', ')}.\n </p>\n ) : null}\n\n <Part\n icon={<Link2 className=\"h-4 w-4\" />}\n title=\"Work and blockers\"\n testId=\"readiness-work\"\n loading={readiness.loading && !readiness.data}\n error={readiness.error}\n >\n {r && (\n <div className=\"space-y-2\">\n <p className=\"text-sm text-muted-foreground\">\n {r.scope === 'NONE'\n ? 'This release has no work items and no project, so there is nothing to track.'\n : r.scope === 'PROJECTS'\n ? `No work items are assigned to this release, so everything open in its project counts: ${r.totalItems} open.`\n : `${r.doneItems} of ${r.totalItems} work items done.`}\n </p>\n {r.blockers.length === 0 && r.scope !== 'NONE' && (\n <p className=\"text-sm text-muted-foreground\">\n No item is waiting on unfinished work.\n </p>\n )}\n <ul className=\"space-y-1.5\">\n {r.blockers.map((b) => (\n <li\n key={b.workItem.id}\n className=\"rounded-md border p-2 text-sm\"\n data-testid=\"readiness-blocker\"\n >\n <button\n type=\"button\"\n className=\"font-medium hover:underline text-left\"\n onClick={() =>\n navigate(\n `/tasks/task-detail-page?taskId=${encodeURIComponent(b.workItem.id)}`\n )\n }\n >\n {b.workItem.key} {b.workItem.title}\n </button>\n <span className=\"text-muted-foreground\"> waits on </span>\n {b.waitingOn.map((w, i) => (\n <span key={w.id}>\n {i > 0 && ', '}\n <button\n type=\"button\"\n className=\"hover:underline\"\n onClick={() =>\n navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(w.id)}`)\n }\n >\n {w.key} {w.title}\n </button>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({w.status.toLowerCase().replace('_', ' ')}\n {projectId && w.projectId && w.projectId !== projectId\n ? ', another project'\n : ''}\n )\n </span>\n </span>\n ))}\n </li>\n ))}\n </ul>\n </div>\n )}\n </Part>\n\n <Part\n icon={<ShieldAlert className=\"h-4 w-4\" />}\n title=\"Approvals\"\n testId=\"readiness-approvals\"\n loading={gates.loading && !gates.data}\n error={gates.error}\n >\n <p className=\"text-sm text-muted-foreground\">\n {openGates.length === 0\n ? 'No quality gate is waiting for a decision.'\n : `Waiting on: ${openGates.map((g) => `${g.name} (${g.status.toLowerCase().replace('_', ' ')})`).join(', ')}.`}\n </p>\n </Part>\n\n {projectId ? (\n <>\n <Part\n icon={<Wallet className=\"h-4 w-4\" />}\n title=\"Budget\"\n testId=\"readiness-budget\"\n loading={budgets.loading && !budgets.data}\n error={budgets.error}\n >\n {budgetRows.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n This release's project has no budget.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {budgetRows.map((b) => {\n const over = b.remainingAmount < 0;\n return (\n <li key={b.id} className=\"text-sm\" data-testid=\"readiness-budget-row\">\n <span className=\"font-medium\">{b.name}</span>:{' '}\n {money(b.spentAmount, b.currency)} of {money(b.plannedAmount, b.currency)}{' '}\n spent\n {over ? (\n <span className=\"text-status-error-text\">\n {' '}\n — over by {money(-b.remainingAmount, b.currency)}\n </span>\n ) : (\n <span className=\"text-muted-foreground\">\n {' '}\n — {money(b.remainingAmount, b.currency)} left\n </span>\n )}\n {!b.approvedAt && (\n <span className=\"text-status-warning-text\"> · not approved</span>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </Part>\n\n <Part\n icon={<AlertTriangle className=\"h-4 w-4\" />}\n title=\"Open risks\"\n testId=\"readiness-risks\"\n loading={risks.loading && !risks.data}\n error={risks.error}\n >\n {openRisks.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n No open risks on this release's project.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {openRisks.slice(0, 5).map((risk) => (\n <li key={risk.id} className=\"text-sm\">\n <span className=\"font-medium\">{risk.title}</span>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({risk.severity.toLowerCase()}, score {risk.riskScore},{' '}\n {risk.status.toLowerCase()})\n </span>\n </li>\n ))}\n {openRisks.length > 5 && (\n <li className=\"text-xs text-muted-foreground\">\n and {openRisks.length - 5} more\n </li>\n )}\n </ul>\n )}\n </Part>\n\n <Part\n icon={<Users className=\"h-4 w-4\" />}\n title=\"Customer requests riding on unfinished work\"\n testId=\"readiness-requests\"\n loading={requests.loading && !requests.data}\n error={requests.error}\n >\n {riding.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n No open customer request is tied to unfinished work in this release.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {riding.map((req) => (\n <li key={req.id} className=\"text-sm\" data-testid=\"readiness-request\">\n <span className=\"font-medium\">{req.title}</span>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({req.voteCount} vote{req.voteCount === 1 ? '' : 's'})\n </span>\n {req.workItemId && blockedIds.has(req.workItemId) && (\n <span className=\"text-status-error-text\"> — its work is blocked</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </Part>\n </>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n This release has no project, so budget, risks and customer requests cannot be shown.\n </p>\n )}\n\n {plannedDate && daysLate !== null && (\n <p className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n <Clock className=\"h-3.5 w-3.5\" />\n Planned for {new Date(plannedDate).to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e,MAAa,QAC3B,kBAAC,KAAD;KAAG,WAAU;eAAb;MACE,kBAAC,GAAD,EAAO,WAAU,eAAgB,CAAA;;MACpB,IAAI,KAAK,EAAY,CAAC,oBAAoB;MACtD,IAAW,IAAI,KAAK,EAAS,MAAM,MAAa,IAAI,KAAK,IAAI,SAAS;MAAG;MACxE;;IAEM;KACT"}
|
|
1
|
+
{"version":3,"file":"ReleaseReadinessCard.js","names":[],"sources":["../../../src/planmagnet/releases/ReleaseReadinessCard.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { CombinedGraphQLErrors, ServerError } from '@apollo/client/errors';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport {\n AlertTriangle,\n CheckCircle2,\n Link2,\n Wallet,\n Users,\n ShieldAlert,\n Clock,\n} from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { RELEASE_GATES } from './ReleaseGatesCard';\n\n/**\n * Release overview (P1.4): what stands between this release and shipping, in\n * one place: unfinished and dependency-blocked work, gates not yet passed,\n * the budget position of its project, its open risks, and the customer\n * requests that ride on its unfinished work.\n *\n * Each part is read through its OWN gated query. Budgets, risks and feature\n * requests are separate RBAC resources (a product manager can read releases\n * but not budgets), so a part the viewer may not see says so, instead of the\n * release leaking it or the whole card failing.\n */\n\nconst READINESS = gql`\n query ReleaseReadiness($releaseId: ID!) {\n planmagnetReleaseReadiness(releaseId: $releaseId) {\n scope\n totalItems\n doneItems\n openWorkItemIds\n openRequiredChecklist\n blockers {\n workItem {\n id\n key\n title\n status\n }\n waitingOn {\n id\n key\n title\n status\n projectId\n }\n }\n }\n }\n`;\nconst BUDGETS = gql`\n query ReleaseBudgets($workspaceId: ID!, $projectId: String!) {\n planmagnetBudgets(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 50 }\n ) {\n items {\n id\n name\n status\n currency\n plannedAmount\n spentAmount\n remainingAmount\n approvedAt\n }\n }\n }\n`;\nconst RISKS = gql`\n query ReleaseRisks($workspaceId: ID!, $projectId: String!) {\n planmagnetRisks(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n title\n severity\n status\n riskScore\n }\n }\n }\n`;\nconst REQUESTS = gql`\n query ReleaseCustomerRequests($workspaceId: ID!, $projectId: String!) {\n planmagnetFeatureRequests(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n title\n status\n voteCount\n workItemId\n }\n }\n }\n`;\n\ninterface ItemRef {\n id: string;\n key: string;\n title: string;\n status: string;\n projectId?: string;\n}\ninterface Readiness {\n scope: 'WORK_ITEMS' | 'PROJECTS' | 'NONE';\n totalItems: number;\n doneItems: number;\n openWorkItemIds: string[];\n /** PRM-19: required checklist items still open — they block RELEASED like an open gate. */\n openRequiredChecklist: string[];\n blockers: { workItem: ItemRef; waitingOn: ItemRef[] }[];\n}\ninterface Budget {\n id: string;\n name: string;\n status: string;\n currency: string;\n plannedAmount: number;\n spentAmount: number;\n remainingAmount: number;\n approvedAt: string | null;\n}\ninterface Risk {\n id: string;\n title: string;\n severity: string;\n status: string;\n riskScore: number;\n}\ninterface Request {\n id: string;\n title: string;\n status: string;\n voteCount: number;\n workItemId: string | null;\n}\n\nconst CLOSED_RISK = new Set(['RESOLVED', 'ACCEPTED', 'CLOSED']);\nconst CLOSED_REQUEST = new Set(['COMPLETED', 'DECLINED', 'DUPLICATE']);\nconst DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Is this the gateway refusing the viewer's role? The gateway answers an RBAC\n * denial with HTTP 403 (400 inside a batch) and `extensions.code: FORBIDDEN`.\n * Depending on the fetch path Apollo surfaces that as GraphQL errors or as a\n * ServerError carrying the body, so both are read.\n */\nfunction denied(error: unknown): boolean {\n if (CombinedGraphQLErrors.is(error)) {\n return error.errors.some((e) => e.extensions?.code === 'FORBIDDEN');\n }\n if (ServerError.is(error)) {\n return error.statusCode === 403 || /\"code\"\\s*:\\s*\"FORBIDDEN\"/.test(error.bodyText);\n }\n return false;\n}\n\n/** One part of the overview: its own title, and its own loading/denied/error state. */\nfunction Part({\n icon,\n title,\n testId,\n loading,\n error,\n children,\n}: {\n icon: ReactNode;\n title: string;\n testId: string;\n loading: boolean;\n error: unknown;\n children: ReactNode;\n}) {\n let body = children;\n if (error) {\n body = (\n <p className=\"text-sm text-muted-foreground\">\n {denied(error)\n ? 'Your role cannot see this.'\n : `Could not be loaded: ${error instanceof Error ? error.message : 'unknown error'}`}\n </p>\n );\n } else if (loading) {\n body = <p className=\"text-sm text-muted-foreground\">Loading…</p>;\n }\n return (\n <section className=\"space-y-1.5\" data-testid={testId}>\n <h3 className=\"flex items-center gap-2 text-sm font-medium\">\n {icon}\n {title}\n </h3>\n {body}\n </section>\n );\n}\n\nconst money = (amount: number, currency: string) => {\n try {\n return new Intl.NumberFormat(undefined, { style: 'currency', currency }).format(amount);\n } catch {\n return `${amount.toFixed(2)} ${currency}`;\n }\n};\n\nexport function ReleaseReadinessCard({\n releaseId,\n projectId,\n releaseStatus,\n plannedDate,\n}: {\n releaseId: string;\n projectId: string | null;\n releaseStatus: string;\n plannedDate: string | null;\n}) {\n const { workspaceId } = usePlanMagnet();\n // Read once: lateness is a property of the page view, not of each render.\n const [now] = useState(() => Date.now());\n const navigate = usePlanMagnetNavigate();\n const byProject = { variables: { workspaceId, projectId }, skip: !workspaceId || !projectId };\n\n const readiness = useQuery<{ planmagnetReleaseReadiness: Readiness }>(READINESS, {\n variables: { releaseId },\n });\n const gates = useQuery<{\n planmagnetRelease: { qualityGates: { id: string; name: string; status: string }[] } | null;\n }>(RELEASE_GATES, { variables: { id: releaseId } });\n const budgets = useQuery<{ planmagnetBudgets: { items: Budget[] } }>(BUDGETS, byProject);\n const risks = useQuery<{ planmagnetRisks: { items: Risk[] } }>(RISKS, byProject);\n const requests = useQuery<{ planmagnetFeatureRequests: { items: Request[] } }>(\n REQUESTS,\n byProject\n );\n\n const shipped = releaseStatus === 'RELEASED';\n const r = readiness.data?.planmagnetReleaseReadiness;\n const openGates = (gates.data?.planmagnetRelease?.qualityGates ?? []).filter(\n (g) => g.status !== 'PASSED' && g.status !== 'WAIVED'\n );\n const budgetRows = budgets.data?.planmagnetBudgets.items ?? [];\n const openRisks = (risks.data?.planmagnetRisks.items ?? [])\n .filter((risk) => !CLOSED_RISK.has(risk.status))\n .sort((a, b) => b.riskScore - a.riskScore);\n const openIds = new Set(r?.openWorkItemIds ?? []);\n const blockedIds = new Set((r?.blockers ?? []).map((b) => b.workItem.id));\n const riding = (requests.data?.planmagnetFeatureRequests.items ?? []).filter(\n (req) => req.workItemId && openIds.has(req.workItemId) && !CLOSED_REQUEST.has(req.status)\n );\n\n const daysLate =\n plannedDate && !shipped ? Math.floor((now - new Date(plannedDate).getTime()) / DAY) : null;\n\n // The headline lists every reason, not just the first one found.\n const reasons: string[] = [];\n if (daysLate !== null && daysLate > 0)\n reasons.push(`${daysLate} day${daysLate === 1 ? '' : 's'} past its planned date`);\n if (r && r.blockers.length > 0)\n reasons.push(`${r.blockers.length} blocked item${r.blockers.length === 1 ? '' : 's'}`);\n if (r && r.openWorkItemIds.length > 0)\n reasons.push(\n `${r.openWorkItemIds.length} unfinished item${r.openWorkItemIds.length === 1 ? '' : 's'}`\n );\n if (openGates.length > 0)\n reasons.push(`${openGates.length} gate${openGates.length === 1 ? '' : 's'} not passed`);\n // PRM-19: a required checklist item still open is a reason too — the server refuses RELEASED over it.\n const openChecklist = r?.openRequiredChecklist ?? [];\n if (openChecklist.length > 0)\n reasons.push(\n `${openChecklist.length} required checklist item${openChecklist.length === 1 ? '' : 's'} open (${openChecklist.join(', ')})`\n );\n const overBudget = budgetRows.filter((b) => b.remainingAmount < 0 || b.status === 'EXCEEDED');\n if (overBudget.length > 0) reasons.push('over budget');\n const settled = !readiness.loading && !gates.loading;\n\n return (\n <Card data-testid=\"release-readiness\">\n <CardHeader>\n <CardTitle>What stands between this release and shipping</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-5\">\n {shipped ? (\n <p className=\"flex items-center gap-2 text-sm text-status-success-text\">\n <CheckCircle2 className=\"h-4 w-4\" /> Released.\n </p>\n ) : settled && reasons.length === 0 && r && r.scope !== 'NONE' ? (\n <p\n className=\"flex items-center gap-2 text-sm text-status-success-text\"\n data-testid=\"readiness-headline\"\n >\n <CheckCircle2 className=\"h-4 w-4\" /> Nothing is holding this release.\n </p>\n ) : settled && reasons.length > 0 ? (\n <p\n className=\"flex items-center gap-2 text-sm text-status-warning-text\"\n data-testid=\"readiness-headline\"\n >\n <AlertTriangle className=\"h-4 w-4 shrink-0\" /> Held by: {reasons.join(', ')}.\n </p>\n ) : null}\n\n <Part\n icon={<Link2 className=\"h-4 w-4\" />}\n title=\"Work and blockers\"\n testId=\"readiness-work\"\n loading={readiness.loading && !readiness.data}\n error={readiness.error}\n >\n {r && (\n <div className=\"space-y-2\">\n <p className=\"text-sm text-muted-foreground\">\n {r.scope === 'NONE'\n ? 'This release has no work items and no project, so there is nothing to track.'\n : r.scope === 'PROJECTS'\n ? `No work items are assigned to this release, so everything open in its project counts: ${r.totalItems} open.`\n : `${r.doneItems} of ${r.totalItems} work items done.`}\n </p>\n {r.blockers.length === 0 && r.scope !== 'NONE' && (\n <p className=\"text-sm text-muted-foreground\">\n No item is waiting on unfinished work.\n </p>\n )}\n <ul className=\"space-y-1.5\">\n {r.blockers.map((b) => (\n <li\n key={b.workItem.id}\n className=\"rounded-md border p-2 text-sm\"\n data-testid=\"readiness-blocker\"\n >\n <button\n type=\"button\"\n className=\"font-medium hover:underline text-left\"\n onClick={() =>\n navigate(\n `/tasks/task-detail-page?taskId=${encodeURIComponent(b.workItem.id)}`\n )\n }\n >\n {b.workItem.key} {b.workItem.title}\n </button>\n <span className=\"text-muted-foreground\"> waits on </span>\n {b.waitingOn.map((w, i) => (\n <span key={w.id}>\n {i > 0 && ', '}\n <button\n type=\"button\"\n className=\"hover:underline\"\n onClick={() =>\n navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(w.id)}`)\n }\n >\n {w.key} {w.title}\n </button>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({w.status.toLowerCase().replace('_', ' ')}\n {projectId && w.projectId && w.projectId !== projectId\n ? ', another project'\n : ''}\n )\n </span>\n </span>\n ))}\n </li>\n ))}\n </ul>\n </div>\n )}\n </Part>\n\n <Part\n icon={<ShieldAlert className=\"h-4 w-4\" />}\n title=\"Approvals\"\n testId=\"readiness-approvals\"\n loading={gates.loading && !gates.data}\n error={gates.error}\n >\n <p className=\"text-sm text-muted-foreground\">\n {openGates.length === 0\n ? 'No quality gate is waiting for a decision.'\n : `Waiting on: ${openGates.map((g) => `${g.name} (${g.status.toLowerCase().replace('_', ' ')})`).join(', ')}.`}\n </p>\n </Part>\n\n {projectId ? (\n <>\n <Part\n icon={<Wallet className=\"h-4 w-4\" />}\n title=\"Budget\"\n testId=\"readiness-budget\"\n loading={budgets.loading && !budgets.data}\n error={budgets.error}\n >\n {budgetRows.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n This release's project has no budget.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {budgetRows.map((b) => {\n const over = b.remainingAmount < 0;\n return (\n <li key={b.id} className=\"text-sm\" data-testid=\"readiness-budget-row\">\n <span className=\"font-medium\">{b.name}</span>:{' '}\n {money(b.spentAmount, b.currency)} of {money(b.plannedAmount, b.currency)}{' '}\n spent\n {over ? (\n <span className=\"text-status-error-text\">\n {' '}\n — over by {money(-b.remainingAmount, b.currency)}\n </span>\n ) : (\n <span className=\"text-muted-foreground\">\n {' '}\n — {money(b.remainingAmount, b.currency)} left\n </span>\n )}\n {!b.approvedAt && (\n <span className=\"text-status-warning-text\"> · not approved</span>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </Part>\n\n <Part\n icon={<AlertTriangle className=\"h-4 w-4\" />}\n title=\"Open risks\"\n testId=\"readiness-risks\"\n loading={risks.loading && !risks.data}\n error={risks.error}\n >\n {openRisks.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n No open risks on this release's project.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {openRisks.slice(0, 5).map((risk) => (\n <li key={risk.id} className=\"text-sm\">\n <span className=\"font-medium\">{risk.title}</span>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({risk.severity.toLowerCase()}, score {risk.riskScore},{' '}\n {risk.status.toLowerCase()})\n </span>\n </li>\n ))}\n {openRisks.length > 5 && (\n <li className=\"text-xs text-muted-foreground\">\n and {openRisks.length - 5} more\n </li>\n )}\n </ul>\n )}\n </Part>\n\n <Part\n icon={<Users className=\"h-4 w-4\" />}\n title=\"Customer requests riding on unfinished work\"\n testId=\"readiness-requests\"\n loading={requests.loading && !requests.data}\n error={requests.error}\n >\n {riding.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n No open customer request is tied to unfinished work in this release.\n </p>\n ) : (\n <ul className=\"space-y-1\">\n {riding.map((req) => (\n <li key={req.id} className=\"text-sm\" data-testid=\"readiness-request\">\n <span className=\"font-medium\">{req.title}</span>{' '}\n <span className=\"text-xs text-muted-foreground\">\n ({req.voteCount} vote{req.voteCount === 1 ? '' : 's'})\n </span>\n {req.workItemId && blockedIds.has(req.workItemId) && (\n <span className=\"text-status-error-text\"> — its work is blocked</span>\n )}\n </li>\n ))}\n </ul>\n )}\n </Part>\n </>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n This release has no project, so budget, risks and customer requests cannot be shown.\n </p>\n )}\n\n {plannedDate && daysLate !== null && (\n <p className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n <Clock className=\"h-3.5 w-3.5\" />\n Planned for {new Date(plannedDate).toLocaleDateString()}\n {daysLate > 0 ? ` (${daysLate} day${daysLate === 1 ? '' : 's'} ago)` : ''}.\n </p>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;AA6BA,IAA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