@burdenoff/microfe-planmagnet 2026.925.16 → 2026.925.18
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/generated/wspace-types.d.ts +58 -0
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/node_modules/@apollo/client/errors/ServerError.js +17 -0
- package/dist/node_modules/@apollo/client/errors/ServerError.js.map +1 -0
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +67 -62
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +104 -117
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/releases/ReleaseGatesCard.d.ts +7 -0
- package/dist/planmagnet/releases/ReleaseGatesCard.d.ts.map +1 -1
- package/dist/planmagnet/releases/ReleaseGatesCard.js +1 -1
- package/dist/planmagnet/releases/ReleaseGatesCard.js.map +1 -1
- package/dist/planmagnet/releases/ReleaseReadinessCard.d.ts +7 -0
- package/dist/planmagnet/releases/ReleaseReadinessCard.d.ts.map +1 -0
- package/dist/planmagnet/releases/ReleaseReadinessCard.js +391 -0
- package/dist/planmagnet/releases/ReleaseReadinessCard.js.map +1 -0
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.d.ts +13 -0
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.d.ts.map +1 -0
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.js +189 -0
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { brand as e, isBranded as t } from "./utils.js";
|
|
2
|
+
//#region node_modules/@apollo/client/errors/ServerError.js
|
|
3
|
+
var n = class n extends Error {
|
|
4
|
+
static is(e) {
|
|
5
|
+
return t(e, "ServerError");
|
|
6
|
+
}
|
|
7
|
+
response;
|
|
8
|
+
statusCode;
|
|
9
|
+
bodyText;
|
|
10
|
+
constructor(t, r) {
|
|
11
|
+
super(t), this.name = "ServerError", this.response = r.response, this.statusCode = r.response.status, this.bodyText = r.bodyText, e(this), Object.setPrototypeOf(this, n.prototype);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as ServerError };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=ServerError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerError.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/ServerError.js"],"sourcesContent":["import { brand, isBranded } from \"./utils.js\";\n/**\n * Represents an error when a non-200 HTTP status code is returned from the\n * server according to the [GraphQL Over HTTP specification](https://graphql.github.io/graphql-over-http/draft/). This error\n * contains the full server response, including status code and body text.\n *\n * @remarks\n *\n * This error occurs when your GraphQL server responds with an HTTP status code\n * other than 200 (such as 4xx or 5xx status codes) with any media type other\n * than [`application/graphql-response+json`](https://graphql.github.io/graphql-over-http/draft/#sec-application-graphql-response-json).\n *\n * Servers that return non-200 status codes with other media types are not\n * guaranteed to contain a well-formed GraphQL response and may indicate issues\n * at the HTTP level, such as authentication failures, server unavailability,\n * or other HTTP-level problems.\n *\n * @example\n *\n * ```ts\n * import { ServerError } from \"@apollo/client/errors\";\n *\n * // Check if an error is a ServerError instance\n * if (ServerError.is(error)) {\n * console.log(`Server returned status: ${error.statusCode}`);\n * console.log(`Response body: ${error.bodyText}`);\n *\n * // Handle specific status codes\n * if (error.statusCode === 401) {\n * // Handle unauthorized access\n * }\n * }\n * ```\n */\nexport class ServerError extends Error {\n /**\n * A method that determines whether an error is a `ServerError` object. This\n * method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if (ServerError.is(error)) {\n * // TypeScript now knows `error` is a ServerError object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error) {\n return isBranded(error, \"ServerError\");\n }\n /**\n * The raw [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object provided by the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n */\n response;\n /**\n * The status code returned by the server in the response. This is provided as\n * a shortcut for `response.status`.\n */\n statusCode;\n /**\n * The raw response body text.\n */\n bodyText;\n constructor(message, options) {\n super(message);\n this.name = \"ServerError\";\n this.response = options.response;\n this.statusCode = options.response.status;\n this.bodyText = options.bodyText;\n brand(this);\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n//# sourceMappingURL=ServerError.js.map\n"],"x_google_ignoreList":[0],"mappings":";;AAkCA,IAAa,IAAb,MAAa,UAAoB,MAAM;CAcnC,OAAO,GAAG,GAAO;AACb,SAAO,EAAU,GAAO,cAAc;;CAK1C;CAKA;CAIA;CACA,YAAY,GAAS,GAAS;AAO1B,EANA,MAAM,EAAQ,EACd,KAAK,OAAO,eACZ,KAAK,WAAW,EAAQ,UACxB,KAAK,aAAa,EAAQ,SAAS,QACnC,KAAK,WAAW,EAAQ,UACxB,EAAM,KAAK,EACX,OAAO,eAAe,MAAM,EAAY,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsDocDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocsDocDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"names":[],"mappings":"AA4HA,wBAAgB,qBAAqB,4CAwZpC"}
|
|
@@ -7,12 +7,13 @@ import { useState as r } from "react";
|
|
|
7
7
|
import { ArrowLeft as re, History as ie, Link2 as ae, X as oe } from "lucide-react";
|
|
8
8
|
import { useSearchParams as se } from "react-router";
|
|
9
9
|
import { gql as i } from "@apollo/client";
|
|
10
|
-
import { useMutation as a, useQuery as
|
|
10
|
+
import { useApolloClient as ce, useMutation as a, useQuery as le } from "@apollo/client/react";
|
|
11
11
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
12
12
|
import { AlertDialog as c, AlertDialogAction as l, AlertDialogCancel as u, AlertDialogContent as d, AlertDialogDescription as f, AlertDialogFooter as p, AlertDialogHeader as m, AlertDialogTitle as h, AlertDialogTrigger as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
import { Markdown as C } from "@burdenoff/fe-libs/shared/components";
|
|
14
|
+
import { clearGraphqlFetchResponseCache as ue } from "@burdenoff/fe-libs/shared/graphql";
|
|
14
15
|
//#region src/planmagnet/pages/DocsDocDetailPagePage.tsx
|
|
15
|
-
var
|
|
16
|
+
var w = i`
|
|
16
17
|
query DocDetail($id: ID!) {
|
|
17
18
|
planmagnetDoc(id: $id) {
|
|
18
19
|
id
|
|
@@ -40,7 +41,7 @@ var le = i`
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
|
-
`,
|
|
44
|
+
`, T = i`
|
|
44
45
|
mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {
|
|
45
46
|
planmagnetUpdateDoc(id: $id, input: $input) {
|
|
46
47
|
id
|
|
@@ -48,50 +49,54 @@ var le = i`
|
|
|
48
49
|
status
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
`,
|
|
52
|
+
`, E = i`
|
|
52
53
|
mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {
|
|
53
54
|
planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {
|
|
54
55
|
id
|
|
55
56
|
version
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
`,
|
|
59
|
+
`, D = i`
|
|
59
60
|
mutation DocDelete($id: ID!) {
|
|
60
61
|
planmagnetDeleteDoc(id: $id)
|
|
61
62
|
}
|
|
62
|
-
`,
|
|
63
|
+
`, de = i`
|
|
63
64
|
mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {
|
|
64
65
|
planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)
|
|
65
66
|
}
|
|
66
|
-
`,
|
|
67
|
-
function
|
|
68
|
-
let [i] = se(),
|
|
69
|
-
variables: { id:
|
|
70
|
-
skip: !
|
|
67
|
+
`, O = (e, t) => e instanceof Error ? e.message : t, k = (e) => new Date(e).toLocaleString();
|
|
68
|
+
function A() {
|
|
69
|
+
let [i] = se(), A = i.get("docId") ?? "", j = e(), [M, N] = r(!1), [P, F] = r(""), [I, L] = r(""), [R, z] = r(""), [B, V] = r(null), [H, fe] = r(null), [U, pe] = r(null), { data: W, loading: me, error: G } = le(w, {
|
|
70
|
+
variables: { id: A },
|
|
71
|
+
skip: !A,
|
|
71
72
|
fetchPolicy: "cache-and-network"
|
|
72
|
-
}),
|
|
73
|
+
}), he = ce(), K = {
|
|
73
74
|
refetchQueries: ["DocDetail"],
|
|
74
75
|
awaitRefetchQueries: !0
|
|
75
|
-
}, [
|
|
76
|
-
|
|
76
|
+
}, [q, J] = a(T, K), [ge, _e] = a(E, K), [ve, ye] = a(D, { refetchQueries: ["DocsList"] }), [be, xe] = a(de, K), Y = W?.planmagnetDoc, X = J.loading || _e.loading || ye.loading, Z = async (e, t) => {
|
|
77
|
+
V(null);
|
|
77
78
|
try {
|
|
78
79
|
return await ee(e()), !0;
|
|
79
80
|
} catch (e) {
|
|
80
|
-
return
|
|
81
|
+
return V(O(e, t)), ue(), await he.query({
|
|
82
|
+
query: w,
|
|
83
|
+
variables: { id: A },
|
|
84
|
+
fetchPolicy: "network-only"
|
|
85
|
+
}).catch(() => void 0), !1;
|
|
81
86
|
}
|
|
82
87
|
};
|
|
83
|
-
if (!
|
|
88
|
+
if (!A) return /* @__PURE__ */ o("div", {
|
|
84
89
|
className: "p-6 text-sm text-muted-foreground",
|
|
85
90
|
children: "No doc selected."
|
|
86
91
|
});
|
|
87
|
-
if (
|
|
92
|
+
if (me && !W) return /* @__PURE__ */ o("div", {
|
|
88
93
|
className: "p-6 text-sm text-muted-foreground",
|
|
89
94
|
children: "Loading doc…"
|
|
90
95
|
});
|
|
91
|
-
if (
|
|
96
|
+
if (G && !Y) return /* @__PURE__ */ s("p", {
|
|
92
97
|
role: "alert",
|
|
93
98
|
className: "p-6 text-sm text-destructive",
|
|
94
|
-
children: ["The doc could not be loaded: ",
|
|
99
|
+
children: ["The doc could not be loaded: ", G.message]
|
|
95
100
|
});
|
|
96
101
|
if (!Y) return /* @__PURE__ */ s("div", {
|
|
97
102
|
className: "space-y-3 p-6",
|
|
@@ -101,23 +106,23 @@ function O() {
|
|
|
101
106
|
}), /* @__PURE__ */ o(_, {
|
|
102
107
|
size: "sm",
|
|
103
108
|
variant: "outline",
|
|
104
|
-
onClick: () =>
|
|
109
|
+
onClick: () => j("/docs/docs-page"),
|
|
105
110
|
children: "Back to docs"
|
|
106
111
|
})]
|
|
107
112
|
});
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
await Z(() =>
|
|
113
|
+
let Se = () => {
|
|
114
|
+
F(Y.title), L(Y.content), z(""), V(null), pe(Y.version), N(!0);
|
|
115
|
+
}, Ce = async () => {
|
|
116
|
+
await Z(() => q({ variables: {
|
|
112
117
|
id: Y.id,
|
|
113
118
|
input: {
|
|
114
|
-
title:
|
|
115
|
-
content:
|
|
116
|
-
...
|
|
117
|
-
expectedVersion:
|
|
119
|
+
title: P.trim(),
|
|
120
|
+
content: I,
|
|
121
|
+
...R.trim() ? { changeNote: R.trim() } : {},
|
|
122
|
+
expectedVersion: U
|
|
118
123
|
}
|
|
119
|
-
} }), "The doc could not be saved.") &&
|
|
120
|
-
}, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ =
|
|
124
|
+
} }), "The doc could not be saved.") && N(!1);
|
|
125
|
+
}, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ = H === null ? null : Q.find((e) => e.version === H);
|
|
121
126
|
return /* @__PURE__ */ s("div", {
|
|
122
127
|
className: "space-y-6 p-6",
|
|
123
128
|
"data-testid": "doc-detail",
|
|
@@ -125,7 +130,7 @@ function O() {
|
|
|
125
130
|
/* @__PURE__ */ s(_, {
|
|
126
131
|
size: "sm",
|
|
127
132
|
variant: "ghost",
|
|
128
|
-
onClick: () =>
|
|
133
|
+
onClick: () => j("/docs/docs-page"),
|
|
129
134
|
children: [/* @__PURE__ */ o(re, { className: "mr-1 h-4 w-4" }), "All docs"]
|
|
130
135
|
}),
|
|
131
136
|
/* @__PURE__ */ s("div", {
|
|
@@ -144,19 +149,19 @@ function O() {
|
|
|
144
149
|
Y.version,
|
|
145
150
|
" · updated",
|
|
146
151
|
" ",
|
|
147
|
-
|
|
152
|
+
k(Y.updatedAt),
|
|
148
153
|
" by ",
|
|
149
154
|
/* @__PURE__ */ o(t, { id: Y.updatedBy ?? Y.createdBy })
|
|
150
155
|
]
|
|
151
156
|
})]
|
|
152
|
-
}), !
|
|
157
|
+
}), !M && /* @__PURE__ */ s("div", {
|
|
153
158
|
className: "flex flex-wrap gap-2",
|
|
154
159
|
children: [
|
|
155
160
|
te.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ o(_, {
|
|
156
161
|
size: "sm",
|
|
157
162
|
variant: "outline",
|
|
158
163
|
disabled: X,
|
|
159
|
-
onClick: () => Z(() =>
|
|
164
|
+
onClick: () => Z(() => q({ variables: {
|
|
160
165
|
id: Y.id,
|
|
161
166
|
input: {
|
|
162
167
|
status: e,
|
|
@@ -167,7 +172,7 @@ function O() {
|
|
|
167
172
|
}, e)),
|
|
168
173
|
/* @__PURE__ */ o(_, {
|
|
169
174
|
size: "sm",
|
|
170
|
-
onClick:
|
|
175
|
+
onClick: Se,
|
|
171
176
|
"data-testid": "doc-edit",
|
|
172
177
|
children: "Edit"
|
|
173
178
|
}),
|
|
@@ -193,48 +198,48 @@ function O() {
|
|
|
193
198
|
] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Keep it" }), /* @__PURE__ */ o(l, {
|
|
194
199
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
195
200
|
onClick: async () => {
|
|
196
|
-
await Z(() =>
|
|
201
|
+
await Z(() => ve({ variables: { id: Y.id } }), "The doc could not be deleted.") && j("/docs/docs-page");
|
|
197
202
|
},
|
|
198
203
|
children: "Delete"
|
|
199
204
|
})] })] })] })
|
|
200
205
|
]
|
|
201
206
|
})]
|
|
202
207
|
}),
|
|
203
|
-
|
|
208
|
+
B && /* @__PURE__ */ o("p", {
|
|
204
209
|
role: "alert",
|
|
205
210
|
className: "text-sm text-destructive",
|
|
206
211
|
"data-testid": "doc-error",
|
|
207
|
-
children:
|
|
212
|
+
children: B
|
|
208
213
|
}),
|
|
209
|
-
|
|
214
|
+
M && U !== Y.version && /* @__PURE__ */ s("p", {
|
|
210
215
|
className: "text-sm text-status-warning-text",
|
|
211
216
|
"data-testid": "doc-moved-on",
|
|
212
217
|
children: [
|
|
213
218
|
"Someone saved version ",
|
|
214
219
|
Y.version,
|
|
215
220
|
" after you started editing version ",
|
|
216
|
-
|
|
221
|
+
U,
|
|
217
222
|
". Your text is kept below; copy what you need, then discard and edit the latest."
|
|
218
223
|
]
|
|
219
224
|
}),
|
|
220
|
-
|
|
225
|
+
M ? /* @__PURE__ */ o(v, { children: /* @__PURE__ */ s(y, {
|
|
221
226
|
className: "space-y-3 pt-6",
|
|
222
227
|
children: [
|
|
223
228
|
/* @__PURE__ */ o(S, {
|
|
224
229
|
"aria-label": "Doc title",
|
|
225
|
-
value:
|
|
226
|
-
onChange: (e) =>
|
|
230
|
+
value: P,
|
|
231
|
+
onChange: (e) => F(e.target.value)
|
|
227
232
|
}),
|
|
228
233
|
/* @__PURE__ */ o(n, {
|
|
229
|
-
value:
|
|
230
|
-
onChange:
|
|
234
|
+
value: I,
|
|
235
|
+
onChange: L,
|
|
231
236
|
minHeight: 240
|
|
232
237
|
}),
|
|
233
238
|
/* @__PURE__ */ o(S, {
|
|
234
239
|
"aria-label": "Change note",
|
|
235
240
|
placeholder: "What changed? (optional, shown in the history)",
|
|
236
|
-
value:
|
|
237
|
-
onChange: (e) =>
|
|
241
|
+
value: R,
|
|
242
|
+
onChange: (e) => z(e.target.value)
|
|
238
243
|
}),
|
|
239
244
|
/* @__PURE__ */ s("div", {
|
|
240
245
|
className: "flex justify-end gap-2",
|
|
@@ -242,15 +247,15 @@ function O() {
|
|
|
242
247
|
size: "sm",
|
|
243
248
|
variant: "ghost",
|
|
244
249
|
onClick: () => {
|
|
245
|
-
|
|
250
|
+
N(!1), V(null);
|
|
246
251
|
},
|
|
247
|
-
children:
|
|
252
|
+
children: U === Y.version ? "Cancel" : "Discard my edits"
|
|
248
253
|
}), /* @__PURE__ */ o(_, {
|
|
249
254
|
size: "sm",
|
|
250
|
-
onClick:
|
|
251
|
-
disabled:
|
|
255
|
+
onClick: Ce,
|
|
256
|
+
disabled: J.loading || U !== Y.version,
|
|
252
257
|
"data-testid": "doc-save",
|
|
253
|
-
children:
|
|
258
|
+
children: J.loading ? "Saving…" : "Save new version"
|
|
254
259
|
})]
|
|
255
260
|
})
|
|
256
261
|
]
|
|
@@ -297,10 +302,10 @@ function O() {
|
|
|
297
302
|
size: "sm",
|
|
298
303
|
variant: "ghost",
|
|
299
304
|
className: "h-7 text-xs",
|
|
300
|
-
"aria-expanded":
|
|
301
|
-
onClick: () =>
|
|
302
|
-
children:
|
|
303
|
-
}), !n && !
|
|
305
|
+
"aria-expanded": H === e.version,
|
|
306
|
+
onClick: () => fe(H === e.version ? null : e.version),
|
|
307
|
+
children: H === e.version ? "Hide" : "View"
|
|
308
|
+
}), !n && !M && /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(g, {
|
|
304
309
|
asChild: !0,
|
|
305
310
|
children: /* @__PURE__ */ o(_, {
|
|
306
311
|
size: "sm",
|
|
@@ -321,7 +326,7 @@ function O() {
|
|
|
321
326
|
Y.version,
|
|
322
327
|
" stays in the history."
|
|
323
328
|
] })] }), /* @__PURE__ */ s(p, { children: [/* @__PURE__ */ o(u, { children: "Cancel" }), /* @__PURE__ */ o(l, {
|
|
324
|
-
onClick: () => Z(() =>
|
|
329
|
+
onClick: () => Z(() => ge({ variables: {
|
|
325
330
|
id: Y.id,
|
|
326
331
|
toVersion: e.version,
|
|
327
332
|
expectedVersion: Y.version
|
|
@@ -332,7 +337,7 @@ function O() {
|
|
|
332
337
|
}), /* @__PURE__ */ s("p", {
|
|
333
338
|
className: "text-xs text-muted-foreground",
|
|
334
339
|
children: [
|
|
335
|
-
|
|
340
|
+
k(e.createdAt),
|
|
336
341
|
" · ",
|
|
337
342
|
/* @__PURE__ */ o(t, { id: e.createdBy }),
|
|
338
343
|
e.changeNote ? ` · ${e.changeNote}` : ""
|
|
@@ -377,7 +382,7 @@ function O() {
|
|
|
377
382
|
children: [/* @__PURE__ */ s("button", {
|
|
378
383
|
type: "button",
|
|
379
384
|
className: "min-w-0 truncate text-left text-sm hover:underline",
|
|
380
|
-
onClick: () =>
|
|
385
|
+
onClick: () => j(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
|
|
381
386
|
children: [
|
|
382
387
|
/* @__PURE__ */ o("span", {
|
|
383
388
|
className: "text-muted-foreground",
|
|
@@ -389,9 +394,9 @@ function O() {
|
|
|
389
394
|
}), /* @__PURE__ */ o(_, {
|
|
390
395
|
size: "icon",
|
|
391
396
|
variant: "ghost",
|
|
392
|
-
disabled:
|
|
397
|
+
disabled: xe.loading,
|
|
393
398
|
"aria-label": `Unlink ${e.title}`,
|
|
394
|
-
onClick: () => Z(() =>
|
|
399
|
+
onClick: () => Z(() => be({ variables: {
|
|
395
400
|
docId: Y.id,
|
|
396
401
|
workItemId: e.id
|
|
397
402
|
} }), "The work item could not be unlinked."),
|
|
@@ -405,6 +410,6 @@ function O() {
|
|
|
405
410
|
});
|
|
406
411
|
}
|
|
407
412
|
//#endregion
|
|
408
|
-
export {
|
|
413
|
+
export { A as DocsDocDetailPagePage };
|
|
409
414
|
|
|
410
415
|
//# sourceMappingURL=DocsDocDetailPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsDocDetailPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Input,\n} from '@burdenoff/fe-libs/ui';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { ArrowLeft, History, Link2, X } from 'lucide-react';\nimport { MarkdownEditor } from '#src/components/MarkdownEditor';\nimport { usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\nimport { throwOnError } from '../utils/mutationResult';\nimport { DOC_STATUSES, DocStatusBadge, type DocStatus } from '../docs/DocStatusBadge';\n\n/**\n * One doc (P1.4): read it, edit it with a change note, publish or archive it,\n * browse its history and restore an older version, see and unlink the work\n * items it is attached to, and delete it.\n *\n * Every write carries `expectedVersion` — the version on screen — so a save\n * over someone else's newer edit is refused with the reason, and the editor\n * keeps the unsaved text rather than overwriting theirs.\n */\n\nconst DOC = gql`\n query DocDetail($id: ID!) {\n planmagnetDoc(id: $id) {\n id\n title\n content\n status\n version\n createdBy\n createdAt\n updatedBy\n updatedAt\n revisions {\n id\n version\n title\n content\n changeNote\n createdBy\n createdAt\n }\n linkedWorkItems {\n id\n key\n title\n }\n }\n }\n`;\nconst UPDATE = gql`\n mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {\n planmagnetUpdateDoc(id: $id, input: $input) {\n id\n version\n status\n }\n }\n`;\nconst REVERT = gql`\n mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {\n planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {\n id\n version\n }\n }\n`;\nconst DELETE = gql`\n mutation DocDelete($id: ID!) {\n planmagnetDeleteDoc(id: $id)\n }\n`;\nconst UNLINK = gql`\n mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {\n planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)\n }\n`;\n\ninterface Revision {\n id: string;\n version: number;\n title: string;\n content: string;\n changeNote: string | null;\n createdBy: string;\n createdAt: string;\n}\n\ninterface Doc {\n id: string;\n title: string;\n content: string;\n status: string;\n version: number;\n createdBy: string;\n createdAt: string;\n updatedBy: string | null;\n updatedAt: string;\n revisions: Revision[];\n linkedWorkItems: { id: string; key: string; title: string }[];\n}\n\nconst messageOf = (e: unknown, fallback: string) => (e instanceof Error ? e.message : fallback);\nconst when = (iso: string) => new Date(iso).toLocaleString();\n\nexport function DocsDocDetailPagePage() {\n const [params] = useSearchParams();\n const docId = params.get('docId') ?? '';\n const navigate = usePlanMagnetNavigate();\n const [editing, setEditing] = useState(false);\n const [title, setTitle] = useState('');\n const [content, setContent] = useState('');\n const [changeNote, setChangeNote] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [viewing, setViewing] = useState<number | null>(null);\n // The version the editor started from — not the one on screen now, which a\n // refetch after someone else's save may already have moved past.\n const [editBase, setEditBase] = useState<number | null>(null);\n\n const {\n data,\n loading,\n error: loadError,\n refetch,\n } = useQuery<{ planmagnetDoc: Doc | null }>(DOC, {\n variables: { id: docId },\n skip: !docId,\n // Cached copies go stale here: a deleted doc, or someone else's newer version.\n fetchPolicy: 'cache-and-network',\n });\n const after = { refetchQueries: ['DocDetail'], awaitRefetchQueries: true };\n const [update, updateState] = useMutation(UPDATE, after);\n const [revert, revertState] = useMutation(REVERT, after);\n const [remove, removeState] = useMutation(DELETE, { refetchQueries: ['DocsList'] });\n const [unlink, unlinkState] = useMutation(UNLINK, after);\n\n const doc = data?.planmagnetDoc;\n const busy = updateState.loading || revertState.loading || removeState.loading;\n\n // Refusals are panel-level: a refused write refetches, and anything the\n // refetch re-renders must not take the reason with it.\n const run = async (action: () => Promise<{ error?: unknown }>, fallback: string) => {\n setError(null);\n try {\n await throwOnError(action());\n return true;\n } catch (e) {\n setError(messageOf(e, fallback));\n // A refusal because the doc moved on: show the current version, but\n // leave the editor's text alone so nothing typed is lost.\n await refetch();\n return false;\n }\n };\n\n if (!docId) {\n return <div className=\"p-6 text-sm text-muted-foreground\">No doc selected.</div>;\n }\n if (loading && !data) {\n return <div className=\"p-6 text-sm text-muted-foreground\">Loading doc…</div>;\n }\n if (loadError && !doc) {\n return (\n <p role=\"alert\" className=\"p-6 text-sm text-destructive\">\n The doc could not be loaded: {loadError.message}\n </p>\n );\n }\n if (!doc) {\n return (\n <div className=\"space-y-3 p-6\">\n <p className=\"text-sm text-muted-foreground\">\n This doc does not exist in this workspace, or it was deleted.\n </p>\n <Button size=\"sm\" variant=\"outline\" onClick={() => navigate('/docs/docs-page')}>\n Back to docs\n </Button>\n </div>\n );\n }\n\n const startEditing = () => {\n setTitle(doc.title);\n setContent(doc.content);\n setChangeNote('');\n setError(null);\n setEditBase(doc.version);\n setEditing(true);\n };\n const save = async () => {\n const saved = await run(\n () =>\n update({\n variables: {\n id: doc.id,\n input: {\n title: title.trim(),\n content,\n ...(changeNote.trim() ? { changeNote: changeNote.trim() } : {}),\n expectedVersion: editBase,\n },\n },\n }),\n 'The doc could not be saved.'\n );\n if (saved) setEditing(false);\n };\n\n const revisions = [...doc.revisions].sort((a, b) => b.version - a.version);\n const shown = viewing === null ? null : revisions.find((r) => r.version === viewing);\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"doc-detail\">\n <Button size=\"sm\" variant=\"ghost\" onClick={() => navigate('/docs/docs-page')}>\n <ArrowLeft className=\"mr-1 h-4 w-4\" />\n All docs\n </Button>\n\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0 space-y-1\">\n <h1 className=\"text-2xl font-semibold break-words\" data-testid=\"doc-title\">\n {doc.title}\n </h1>\n <p className=\"text-xs text-muted-foreground\">\n <DocStatusBadge status={doc.status} /> · version {doc.version} · updated{' '}\n {when(doc.updatedAt)} by <PersonName id={doc.updatedBy ?? doc.createdBy} />\n </p>\n </div>\n {!editing && (\n <div className=\"flex flex-wrap gap-2\">\n {DOC_STATUSES.filter((s) => s !== doc.status).map((s: DocStatus) => (\n <Button\n key={s}\n size=\"sm\"\n variant=\"outline\"\n disabled={busy}\n onClick={() =>\n run(\n () =>\n update({\n variables: {\n id: doc.id,\n input: { status: s, expectedVersion: doc.version },\n },\n }),\n 'The status could not be changed.'\n )\n }\n >\n {s === 'PUBLISHED' ? 'Publish' : s === 'ARCHIVED' ? 'Archive' : 'Back to draft'}\n </Button>\n ))}\n <Button size=\"sm\" onClick={startEditing} data-testid=\"doc-edit\">\n Edit\n </Button>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button size=\"sm\" variant=\"outline\" disabled={busy}>\n Delete\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Delete “{doc.title}”?</AlertDialogTitle>\n <AlertDialogDescription>\n The doc and its history are removed for everyone, and it is unlinked from{' '}\n {doc.linkedWorkItems.length} work item\n {doc.linkedWorkItems.length === 1 ? '' : 's'}.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Keep it</AlertDialogCancel>\n <AlertDialogAction\n className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n onClick={async () => {\n const deleted = await run(\n () => remove({ variables: { id: doc.id } }),\n 'The doc could not be deleted.'\n );\n if (deleted) navigate('/docs/docs-page');\n }}\n >\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n )}\n </div>\n\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\" data-testid=\"doc-error\">\n {error}\n </p>\n )}\n {editing && editBase !== doc.version && (\n <p className=\"text-sm text-status-warning-text\" data-testid=\"doc-moved-on\">\n Someone saved version {doc.version} after you started editing version {editBase}. Your\n text is kept below; copy what you need, then discard and edit the latest.\n </p>\n )}\n\n {editing ? (\n <Card>\n <CardContent className=\"space-y-3 pt-6\">\n <Input\n aria-label=\"Doc title\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n />\n <MarkdownEditor value={content} onChange={setContent} minHeight={240} />\n <Input\n aria-label=\"Change note\"\n placeholder=\"What changed? (optional, shown in the history)\"\n value={changeNote}\n onChange={(e) => setChangeNote(e.target.value)}\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => {\n setEditing(false);\n setError(null);\n }}\n >\n {editBase !== doc.version ? 'Discard my edits' : 'Cancel'}\n </Button>\n <Button\n size=\"sm\"\n onClick={save}\n disabled={updateState.loading || editBase !== doc.version}\n data-testid=\"doc-save\"\n >\n {updateState.loading ? 'Saving…' : 'Save new version'}\n </Button>\n </div>\n </CardContent>\n </Card>\n ) : (\n <Card>\n <CardContent className=\"prose prose-sm max-w-none pt-6 dark:prose-invert\">\n {doc.content.trim() ? (\n <Markdown>{doc.content}</Markdown>\n ) : (\n <p className=\"text-sm text-muted-foreground\">This doc is empty.</p>\n )}\n </CardContent>\n </Card>\n )}\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <Card data-testid=\"doc-history\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <History className=\"h-4 w-4\" /> History ({revisions.length})\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <ol className=\"space-y-2\">\n {revisions.map((rev) => {\n const current = rev.version === doc.version;\n return (\n <li\n key={rev.id}\n className=\"space-y-1 rounded-md border p-2\"\n data-testid=\"doc-revision\"\n >\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <span className=\"text-sm font-medium\">\n Version {rev.version}\n {current ? ' (current)' : ''}\n </span>\n <span className=\"flex gap-1\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-7 text-xs\"\n aria-expanded={viewing === rev.version}\n onClick={() => setViewing(viewing === rev.version ? null : rev.version)}\n >\n {viewing === rev.version ? 'Hide' : 'View'}\n </Button>\n {!current && !editing && (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"h-7 text-xs\"\n disabled={busy}\n data-testid=\"doc-restore\"\n >\n Restore\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Restore version {rev.version}?</AlertDialogTitle>\n <AlertDialogDescription>\n Its title and text become version {doc.version + 1}. Nothing is\n deleted: version {doc.version} stays in the history.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n run(\n () =>\n revert({\n variables: {\n id: doc.id,\n toVersion: rev.version,\n expectedVersion: doc.version,\n },\n }),\n 'The version could not be restored.'\n )\n }\n >\n Restore\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )}\n </span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {when(rev.createdAt)} · <PersonName id={rev.createdBy} />\n {rev.changeNote ? ` · ${rev.changeNote}` : ''}\n </p>\n </li>\n );\n })}\n </ol>\n {shown && (\n <div\n className=\"space-y-1 rounded-md border bg-muted/40 p-3\"\n data-testid=\"doc-revision-view\"\n >\n <p className=\"text-sm font-medium\">\n Version {shown.version}: {shown.title}\n </p>\n <div className=\"prose prose-sm max-w-none dark:prose-invert\">\n <Markdown>{shown.content}</Markdown>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n\n <Card data-testid=\"doc-linked-items\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Link2 className=\"h-4 w-4\" /> Linked work items ({doc.linkedWorkItems.length})\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n {doc.linkedWorkItems.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">\n Not linked to any work item. Link docs from a task's “Linked Docs” panel.\n </p>\n )}\n {doc.linkedWorkItems.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center justify-between gap-2 rounded-md border p-2\"\n >\n <button\n type=\"button\"\n className=\"min-w-0 truncate text-left text-sm hover:underline\"\n onClick={() =>\n navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(item.id)}`)\n }\n >\n <span className=\"text-muted-foreground\">{item.key}</span> {item.title}\n </button>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n disabled={unlinkState.loading}\n aria-label={`Unlink ${item.title}`}\n onClick={() =>\n run(\n () => unlink({ variables: { docId: doc.id, workItemId: item.id } }),\n 'The work item could not be unlinked.'\n )\n }\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAuCA,IAAM,KAAM,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BT,KAAS,CAAG;;;;;;;;GASZ,IAAS,CAAG;;;;;;;GAQZ,IAAS,CAAG;;;;GAKZ,IAAS,CAAG;;;;GA8BZ,MAAa,GAAY,MAAsB,aAAa,QAAQ,EAAE,UAAU,GAChF,KAAQ,MAAgB,IAAI,KAAK,EAAI,CAAC,gBAAgB;AAE5D,SAAgB,IAAwB;CACtC,IAAM,CAAC,KAAU,IAAiB,EAC5B,IAAQ,EAAO,IAAI,QAAQ,IAAI,IAC/B,IAAW,GAAuB,EAClC,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAS,KAAc,EAAS,GAAG,EACpC,CAAC,GAAY,KAAi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+
{"version":3,"file":"DocsDocDetailPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/DocsDocDetailPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useSearchParams } from 'react-router';\nimport { gql } from '@apollo/client';\nimport { useApolloClient, useMutation, useQuery } from '@apollo/client/react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n Input,\n} from '@burdenoff/fe-libs/ui';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql';\nimport { ArrowLeft, History, Link2, X } from 'lucide-react';\nimport { MarkdownEditor } from '#src/components/MarkdownEditor';\nimport { usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\nimport { throwOnError } from '../utils/mutationResult';\nimport { DOC_STATUSES, DocStatusBadge, type DocStatus } from '../docs/DocStatusBadge';\n\n/**\n * One doc (P1.4): read it, edit it with a change note, publish or archive it,\n * browse its history and restore an older version, see and unlink the work\n * items it is attached to, and delete it.\n *\n * Every write carries `expectedVersion` — the version on screen — so a save\n * over someone else's newer edit is refused with the reason, and the editor\n * keeps the unsaved text rather than overwriting theirs.\n */\n\nconst DOC = gql`\n query DocDetail($id: ID!) {\n planmagnetDoc(id: $id) {\n id\n title\n content\n status\n version\n createdBy\n createdAt\n updatedBy\n updatedAt\n revisions {\n id\n version\n title\n content\n changeNote\n createdBy\n createdAt\n }\n linkedWorkItems {\n id\n key\n title\n }\n }\n }\n`;\nconst UPDATE = gql`\n mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {\n planmagnetUpdateDoc(id: $id, input: $input) {\n id\n version\n status\n }\n }\n`;\nconst REVERT = gql`\n mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {\n planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {\n id\n version\n }\n }\n`;\nconst DELETE = gql`\n mutation DocDelete($id: ID!) {\n planmagnetDeleteDoc(id: $id)\n }\n`;\nconst UNLINK = gql`\n mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {\n planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)\n }\n`;\n\ninterface Revision {\n id: string;\n version: number;\n title: string;\n content: string;\n changeNote: string | null;\n createdBy: string;\n createdAt: string;\n}\n\ninterface Doc {\n id: string;\n title: string;\n content: string;\n status: string;\n version: number;\n createdBy: string;\n createdAt: string;\n updatedBy: string | null;\n updatedAt: string;\n revisions: Revision[];\n linkedWorkItems: { id: string; key: string; title: string }[];\n}\n\nconst messageOf = (e: unknown, fallback: string) => (e instanceof Error ? e.message : fallback);\nconst when = (iso: string) => new Date(iso).toLocaleString();\n\nexport function DocsDocDetailPagePage() {\n const [params] = useSearchParams();\n const docId = params.get('docId') ?? '';\n const navigate = usePlanMagnetNavigate();\n const [editing, setEditing] = useState(false);\n const [title, setTitle] = useState('');\n const [content, setContent] = useState('');\n const [changeNote, setChangeNote] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [viewing, setViewing] = useState<number | null>(null);\n // The version the editor started from — not the one on screen now, which a\n // refetch after someone else's save may already have moved past.\n const [editBase, setEditBase] = useState<number | null>(null);\n\n const {\n data,\n loading,\n error: loadError,\n } = useQuery<{ planmagnetDoc: Doc | null }>(DOC, {\n variables: { id: docId },\n skip: !docId,\n // Cached copies go stale here: a deleted doc, or someone else's newer version.\n fetchPolicy: 'cache-and-network',\n });\n const client = useApolloClient();\n const after = { refetchQueries: ['DocDetail'], awaitRefetchQueries: true };\n const [update, updateState] = useMutation(UPDATE, after);\n const [revert, revertState] = useMutation(REVERT, after);\n const [remove, removeState] = useMutation(DELETE, { refetchQueries: ['DocsList'] });\n const [unlink, unlinkState] = useMutation(UNLINK, after);\n\n const doc = data?.planmagnetDoc;\n const busy = updateState.loading || revertState.loading || removeState.loading;\n\n // Refusals are panel-level: a refused write refetches, and anything the\n // refetch re-renders must not take the reason with it.\n const run = async (action: () => Promise<{ error?: unknown }>, fallback: string) => {\n setError(null);\n try {\n await throwOnError(action());\n return true;\n } catch (e) {\n setError(messageOf(e, fallback));\n // A refusal because the doc moved on: show the current version, but\n // leave the editor's text alone so nothing typed is lost.\n //\n // fe-libs replays any identical query answered in the last 15 s\n // (fetch.ts RECENT_QUERY_CACHE_TTL_MS) underneath Apollo's fetch\n // policies, and only a SUCCESSFUL mutation clears that cache. Measured in\n // prod 2026-09-25: after a refused save, even a network-only read was\n // served the pre-refusal response, so the page kept the old version and\n // never said the doc had moved on. A refused write is still a write\n // attempt: clear the cache (the public API fe-libs documents for this),\n // then read the doc; it lands in the normalized cache the page renders.\n clearGraphqlFetchResponseCache();\n await client\n .query({ query: DOC, variables: { id: docId }, fetchPolicy: 'network-only' })\n .catch(() => undefined);\n return false;\n }\n };\n\n if (!docId) {\n return <div className=\"p-6 text-sm text-muted-foreground\">No doc selected.</div>;\n }\n if (loading && !data) {\n return <div className=\"p-6 text-sm text-muted-foreground\">Loading doc…</div>;\n }\n if (loadError && !doc) {\n return (\n <p role=\"alert\" className=\"p-6 text-sm text-destructive\">\n The doc could not be loaded: {loadError.message}\n </p>\n );\n }\n if (!doc) {\n return (\n <div className=\"space-y-3 p-6\">\n <p className=\"text-sm text-muted-foreground\">\n This doc does not exist in this workspace, or it was deleted.\n </p>\n <Button size=\"sm\" variant=\"outline\" onClick={() => navigate('/docs/docs-page')}>\n Back to docs\n </Button>\n </div>\n );\n }\n\n const startEditing = () => {\n setTitle(doc.title);\n setContent(doc.content);\n setChangeNote('');\n setError(null);\n setEditBase(doc.version);\n setEditing(true);\n };\n const save = async () => {\n const saved = await run(\n () =>\n update({\n variables: {\n id: doc.id,\n input: {\n title: title.trim(),\n content,\n ...(changeNote.trim() ? { changeNote: changeNote.trim() } : {}),\n expectedVersion: editBase,\n },\n },\n }),\n 'The doc could not be saved.'\n );\n if (saved) setEditing(false);\n };\n\n const revisions = [...doc.revisions].sort((a, b) => b.version - a.version);\n const shown = viewing === null ? null : revisions.find((r) => r.version === viewing);\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"doc-detail\">\n <Button size=\"sm\" variant=\"ghost\" onClick={() => navigate('/docs/docs-page')}>\n <ArrowLeft className=\"mr-1 h-4 w-4\" />\n All docs\n </Button>\n\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0 space-y-1\">\n <h1 className=\"text-2xl font-semibold break-words\" data-testid=\"doc-title\">\n {doc.title}\n </h1>\n <p className=\"text-xs text-muted-foreground\">\n <DocStatusBadge status={doc.status} /> · version {doc.version} · updated{' '}\n {when(doc.updatedAt)} by <PersonName id={doc.updatedBy ?? doc.createdBy} />\n </p>\n </div>\n {!editing && (\n <div className=\"flex flex-wrap gap-2\">\n {DOC_STATUSES.filter((s) => s !== doc.status).map((s: DocStatus) => (\n <Button\n key={s}\n size=\"sm\"\n variant=\"outline\"\n disabled={busy}\n onClick={() =>\n run(\n () =>\n update({\n variables: {\n id: doc.id,\n input: { status: s, expectedVersion: doc.version },\n },\n }),\n 'The status could not be changed.'\n )\n }\n >\n {s === 'PUBLISHED' ? 'Publish' : s === 'ARCHIVED' ? 'Archive' : 'Back to draft'}\n </Button>\n ))}\n <Button size=\"sm\" onClick={startEditing} data-testid=\"doc-edit\">\n Edit\n </Button>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button size=\"sm\" variant=\"outline\" disabled={busy}>\n Delete\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Delete “{doc.title}”?</AlertDialogTitle>\n <AlertDialogDescription>\n The doc and its history are removed for everyone, and it is unlinked from{' '}\n {doc.linkedWorkItems.length} work item\n {doc.linkedWorkItems.length === 1 ? '' : 's'}.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Keep it</AlertDialogCancel>\n <AlertDialogAction\n className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n onClick={async () => {\n const deleted = await run(\n () => remove({ variables: { id: doc.id } }),\n 'The doc could not be deleted.'\n );\n if (deleted) navigate('/docs/docs-page');\n }}\n >\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n )}\n </div>\n\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\" data-testid=\"doc-error\">\n {error}\n </p>\n )}\n {editing && editBase !== doc.version && (\n <p className=\"text-sm text-status-warning-text\" data-testid=\"doc-moved-on\">\n Someone saved version {doc.version} after you started editing version {editBase}. Your\n text is kept below; copy what you need, then discard and edit the latest.\n </p>\n )}\n\n {editing ? (\n <Card>\n <CardContent className=\"space-y-3 pt-6\">\n <Input\n aria-label=\"Doc title\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n />\n <MarkdownEditor value={content} onChange={setContent} minHeight={240} />\n <Input\n aria-label=\"Change note\"\n placeholder=\"What changed? (optional, shown in the history)\"\n value={changeNote}\n onChange={(e) => setChangeNote(e.target.value)}\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => {\n setEditing(false);\n setError(null);\n }}\n >\n {editBase !== doc.version ? 'Discard my edits' : 'Cancel'}\n </Button>\n <Button\n size=\"sm\"\n onClick={save}\n disabled={updateState.loading || editBase !== doc.version}\n data-testid=\"doc-save\"\n >\n {updateState.loading ? 'Saving…' : 'Save new version'}\n </Button>\n </div>\n </CardContent>\n </Card>\n ) : (\n <Card>\n <CardContent className=\"prose prose-sm max-w-none pt-6 dark:prose-invert\">\n {doc.content.trim() ? (\n <Markdown>{doc.content}</Markdown>\n ) : (\n <p className=\"text-sm text-muted-foreground\">This doc is empty.</p>\n )}\n </CardContent>\n </Card>\n )}\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <Card data-testid=\"doc-history\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <History className=\"h-4 w-4\" /> History ({revisions.length})\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n <ol className=\"space-y-2\">\n {revisions.map((rev) => {\n const current = rev.version === doc.version;\n return (\n <li\n key={rev.id}\n className=\"space-y-1 rounded-md border p-2\"\n data-testid=\"doc-revision\"\n >\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <span className=\"text-sm font-medium\">\n Version {rev.version}\n {current ? ' (current)' : ''}\n </span>\n <span className=\"flex gap-1\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-7 text-xs\"\n aria-expanded={viewing === rev.version}\n onClick={() => setViewing(viewing === rev.version ? null : rev.version)}\n >\n {viewing === rev.version ? 'Hide' : 'View'}\n </Button>\n {!current && !editing && (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"h-7 text-xs\"\n disabled={busy}\n data-testid=\"doc-restore\"\n >\n Restore\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Restore version {rev.version}?</AlertDialogTitle>\n <AlertDialogDescription>\n Its title and text become version {doc.version + 1}. Nothing is\n deleted: version {doc.version} stays in the history.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n run(\n () =>\n revert({\n variables: {\n id: doc.id,\n toVersion: rev.version,\n expectedVersion: doc.version,\n },\n }),\n 'The version could not be restored.'\n )\n }\n >\n Restore\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )}\n </span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {when(rev.createdAt)} · <PersonName id={rev.createdBy} />\n {rev.changeNote ? ` · ${rev.changeNote}` : ''}\n </p>\n </li>\n );\n })}\n </ol>\n {shown && (\n <div\n className=\"space-y-1 rounded-md border bg-muted/40 p-3\"\n data-testid=\"doc-revision-view\"\n >\n <p className=\"text-sm font-medium\">\n Version {shown.version}: {shown.title}\n </p>\n <div className=\"prose prose-sm max-w-none dark:prose-invert\">\n <Markdown>{shown.content}</Markdown>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n\n <Card data-testid=\"doc-linked-items\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Link2 className=\"h-4 w-4\" /> Linked work items ({doc.linkedWorkItems.length})\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-2\">\n {doc.linkedWorkItems.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">\n Not linked to any work item. Link docs from a task's “Linked Docs” panel.\n </p>\n )}\n {doc.linkedWorkItems.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center justify-between gap-2 rounded-md border p-2\"\n >\n <button\n type=\"button\"\n className=\"min-w-0 truncate text-left text-sm hover:underline\"\n onClick={() =>\n navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(item.id)}`)\n }\n >\n <span className=\"text-muted-foreground\">{item.key}</span> {item.title}\n </button>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n disabled={unlinkState.loading}\n aria-label={`Unlink ${item.title}`}\n onClick={() =>\n run(\n () => unlink({ variables: { docId: doc.id, workItemId: item.id } }),\n 'The work item could not be unlinked.'\n )\n }\n >\n <X className=\"h-4 w-4\" />\n </Button>\n </div>\n ))}\n </CardContent>\n </Card>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwCA,IAAM,IAAM,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BT,IAAS,CAAG;;;;;;;;GASZ,IAAS,CAAG;;;;;;;GAQZ,IAAS,CAAG;;;;GAKZ,KAAS,CAAG;;;;GA8BZ,KAAa,GAAY,MAAsB,aAAa,QAAQ,EAAE,UAAU,GAChF,KAAQ,M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mB,EAAK,GAAG,GAAG;kBAJ7E;SAOE,kBAAC,QAAD;UAAM,WAAU;oBAAyB,EAAK;UAAW,CAAA;;SAAE,EAAK;SACzD;WACT,kBAAC,GAAD;QACE,MAAK;QACL,SAAQ;QACR,UAAU,GAAY;QACtB,cAAY,UAAU,EAAK;QAC3B,eACE,QACQ,GAAO,EAAE,WAAW;SAAE,OAAO,EAAI;SAAI,YAAY,EAAK;SAAI,EAAE,CAAC,EACnE,uCACD;kBAGH,kBAAC,IAAD,EAAG,WAAU,WAAY,CAAA;QAClB,CAAA,CACL;SA1BC,EAAK,GA0BN,CACN,CACU;QACT;OACH;;GACF"}
|
|
@@ -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":"AA8DA,wBAAgB,6BAA6B,4CA2L5C"}
|