@burdenoff/microfe-planmagnet 2026.927.2 → 2026.927.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/admin/PlanMagnetAdminRoot.d.ts.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +128 -124
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js.map +1 -1
- package/dist/planmagnet/controls/ConfirmButton.d.ts +25 -0
- package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -0
- package/dist/planmagnet/controls/ConfirmButton.js +30 -0
- package/dist/planmagnet/controls/ConfirmButton.js.map +1 -0
- package/dist/planmagnet/controls/FeatureControls.d.ts +26 -0
- package/dist/planmagnet/controls/FeatureControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/FeatureControls.js +318 -0
- package/dist/planmagnet/controls/FeatureControls.js.map +1 -0
- package/dist/planmagnet/controls/MilestoneControls.d.ts +17 -0
- package/dist/planmagnet/controls/MilestoneControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/MilestoneControls.js +200 -0
- package/dist/planmagnet/controls/MilestoneControls.js.map +1 -0
- package/dist/planmagnet/controls/ObjectiveControls.d.ts +31 -0
- package/dist/planmagnet/controls/ObjectiveControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/ObjectiveControls.js +296 -0
- package/dist/planmagnet/controls/ObjectiveControls.js.map +1 -0
- package/dist/planmagnet/controls/Pickers.d.ts +26 -0
- package/dist/planmagnet/controls/Pickers.d.ts.map +1 -0
- package/dist/planmagnet/controls/Pickers.js +171 -0
- package/dist/planmagnet/controls/Pickers.js.map +1 -0
- package/dist/planmagnet/controls/ProjectControls.d.ts +13 -0
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/ProjectControls.js +104 -0
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -0
- package/dist/planmagnet/controls/ReleaseControls.d.ts +14 -0
- package/dist/planmagnet/controls/ReleaseControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/ReleaseControls.js +108 -0
- package/dist/planmagnet/controls/ReleaseControls.js.map +1 -0
- package/dist/planmagnet/controls/WorkItemControls.d.ts +52 -0
- package/dist/planmagnet/controls/WorkItemControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/WorkItemControls.js +198 -0
- package/dist/planmagnet/controls/WorkItemControls.js.map +1 -0
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +188 -154
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DocsDocsPagePage.js +4 -4
- package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js +63 -56
- package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +229 -214
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +142 -114
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.js +134 -105
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +102 -108
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js +119 -94
- package/dist/planmagnet/pages/ProductsNewFeaturePagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +97 -90
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +107 -106
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js +2 -0
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +150 -111
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +116 -93
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +55 -63
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +134 -132
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +6 -5
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js +167 -116
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.js +139 -107
- package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +205 -158
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.js +1 -0
- package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js.map +1 -1
- package/dist/planmagnet/people/People.js +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts +34 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js +301 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js.map +1 -0
- package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.js +194 -215
- package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { PersonName as t } from "../people/People.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
3
|
+
import { throwOnError as n } from "../utils/mutationResult.js";
|
|
4
|
+
import { WorkItemSearchSelect as ee } from "../controls/Pickers.js";
|
|
5
|
+
import { MarkdownEditor as te } from "../../components/MarkdownEditor.js";
|
|
6
|
+
import { DOC_STATUSES as ne, DocStatusBadge as r } from "../docs/DocStatusBadge.js";
|
|
7
|
+
import { useState as i } from "react";
|
|
8
|
+
import { ArrowLeft as re, History as ie, Link2 as a, X as ae } from "lucide-react";
|
|
9
|
+
import { useSearchParams as oe } from "react-router";
|
|
10
|
+
import { gql as o } from "@apollo/client";
|
|
11
|
+
import { useApolloClient as se, useMutation as s, useQuery as ce } from "@apollo/client/react";
|
|
12
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
13
|
+
import { AlertDialog as u, AlertDialogAction as d, AlertDialogCancel as f, AlertDialogContent as p, AlertDialogDescription as m, AlertDialogFooter as h, AlertDialogHeader as g, AlertDialogTitle as _, AlertDialogTrigger as v, Button as y, Card as b, CardContent as x, CardHeader as S, CardTitle as C, Input as w } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { Markdown as T } from "@burdenoff/fe-libs/shared/components";
|
|
15
|
+
import { clearGraphqlFetchResponseCache as le } from "@burdenoff/fe-libs/shared/graphql";
|
|
15
16
|
//#region src/planmagnet/pages/DocsDocDetailPagePage.tsx
|
|
16
|
-
var
|
|
17
|
+
var E = o`
|
|
17
18
|
query DocDetail($id: ID!) {
|
|
18
19
|
planmagnetDoc(id: $id) {
|
|
19
20
|
id
|
|
@@ -41,7 +42,7 @@ var w = i`
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
`,
|
|
45
|
+
`, ue = o`
|
|
45
46
|
mutation DocUpdate($id: ID!, $input: PlanmagnetUpdateDocInput!) {
|
|
46
47
|
planmagnetUpdateDoc(id: $id, input: $input) {
|
|
47
48
|
id
|
|
@@ -49,119 +50,128 @@ var w = i`
|
|
|
49
50
|
status
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
`,
|
|
53
|
+
`, de = o`
|
|
53
54
|
mutation DocRevert($id: ID!, $toVersion: Int!, $expectedVersion: Int) {
|
|
54
55
|
planmagnetRevertDoc(id: $id, toVersion: $toVersion, expectedVersion: $expectedVersion) {
|
|
55
56
|
id
|
|
56
57
|
version
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
`,
|
|
60
|
+
`, fe = o`
|
|
60
61
|
mutation DocDelete($id: ID!) {
|
|
61
62
|
planmagnetDeleteDoc(id: $id)
|
|
62
63
|
}
|
|
63
|
-
`,
|
|
64
|
+
`, pe = o`
|
|
65
|
+
mutation DocLinkWorkItem($docId: ID!, $workItemId: ID!) {
|
|
66
|
+
planmagnetLinkDocToWorkItem(docId: $docId, workItemId: $workItemId) {
|
|
67
|
+
id
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`, me = o`
|
|
64
71
|
mutation DocUnlinkWorkItem($docId: ID!, $workItemId: ID!) {
|
|
65
72
|
planmagnetUnlinkDocFromWorkItem(docId: $docId, workItemId: $workItemId)
|
|
66
73
|
}
|
|
67
|
-
`,
|
|
68
|
-
function
|
|
69
|
-
let [
|
|
70
|
-
variables: { id:
|
|
71
|
-
skip: !
|
|
74
|
+
`, he = (e, t) => e instanceof Error ? e.message : t, D = (e) => new Date(e).toLocaleString();
|
|
75
|
+
function O() {
|
|
76
|
+
let [o] = oe(), O = o.get("docId") ?? "", k = e(), [A, j] = i(!1), [M, N] = i(""), [P, F] = i(""), [I, L] = i(""), [R, z] = i(null), [B, ge] = i(null), [V, _e] = i(null), { data: H, loading: ve, error: U } = ce(E, {
|
|
77
|
+
variables: { id: O },
|
|
78
|
+
skip: !O,
|
|
72
79
|
fetchPolicy: "cache-and-network"
|
|
73
|
-
}),
|
|
80
|
+
}), ye = se(), W = {
|
|
74
81
|
refetchQueries: ["DocDetail"],
|
|
75
82
|
awaitRefetchQueries: !0
|
|
76
|
-
}, [
|
|
77
|
-
|
|
83
|
+
}, [G, K] = s(ue, W), [be, xe] = s(de, W), [Se, Ce] = s(fe, { refetchQueries: ["DocsList"] }), [we, Te] = s(me, W), [Ee, De] = s(pe, {
|
|
84
|
+
...W,
|
|
85
|
+
refetchQueries: ["DocDetail", "GetWorkItemDocs"]
|
|
86
|
+
}), [q, J] = i(""), Y = H?.planmagnetDoc, X = K.loading || xe.loading || Ce.loading, Z = async (e, t) => {
|
|
87
|
+
z(null);
|
|
78
88
|
try {
|
|
79
|
-
return await
|
|
89
|
+
return await n(e()), !0;
|
|
80
90
|
} catch (e) {
|
|
81
|
-
return
|
|
82
|
-
query:
|
|
83
|
-
variables: { id:
|
|
91
|
+
return z(he(e, t)), le(), await ye.query({
|
|
92
|
+
query: E,
|
|
93
|
+
variables: { id: O },
|
|
84
94
|
fetchPolicy: "network-only"
|
|
85
95
|
}).catch(() => void 0), !1;
|
|
86
96
|
}
|
|
87
97
|
};
|
|
88
|
-
if (!
|
|
98
|
+
if (!O) return /* @__PURE__ */ c("div", {
|
|
89
99
|
className: "p-6 text-sm text-muted-foreground",
|
|
90
100
|
children: "No doc selected."
|
|
91
101
|
});
|
|
92
|
-
if (
|
|
102
|
+
if (ve && !H) return /* @__PURE__ */ c("div", {
|
|
93
103
|
className: "p-6 text-sm text-muted-foreground",
|
|
94
104
|
children: "Loading doc…"
|
|
95
105
|
});
|
|
96
|
-
if (
|
|
106
|
+
if (U && !Y) return /* @__PURE__ */ l("p", {
|
|
97
107
|
role: "alert",
|
|
98
108
|
className: "p-6 text-sm text-destructive",
|
|
99
|
-
children: ["The doc could not be loaded: ",
|
|
109
|
+
children: ["The doc could not be loaded: ", U.message]
|
|
100
110
|
});
|
|
101
|
-
if (!Y) return /* @__PURE__ */
|
|
111
|
+
if (!Y) return /* @__PURE__ */ l("div", {
|
|
102
112
|
className: "space-y-3 p-6",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ c("p", {
|
|
104
114
|
className: "text-sm text-muted-foreground",
|
|
105
115
|
children: "This doc does not exist in this workspace, or it was deleted."
|
|
106
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ c(y, {
|
|
107
117
|
size: "sm",
|
|
108
118
|
variant: "outline",
|
|
109
|
-
onClick: () =>
|
|
119
|
+
onClick: () => k("/docs/docs-page"),
|
|
110
120
|
children: "Back to docs"
|
|
111
121
|
})]
|
|
112
122
|
});
|
|
113
|
-
let
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
await Z(() =>
|
|
123
|
+
let Oe = () => {
|
|
124
|
+
N(Y.title), F(Y.content), L(""), z(null), _e(Y.version), j(!0);
|
|
125
|
+
}, ke = async () => {
|
|
126
|
+
await Z(() => G({ variables: {
|
|
117
127
|
id: Y.id,
|
|
118
128
|
input: {
|
|
119
|
-
title:
|
|
120
|
-
content:
|
|
121
|
-
...
|
|
122
|
-
expectedVersion:
|
|
129
|
+
title: M.trim(),
|
|
130
|
+
content: P,
|
|
131
|
+
...I.trim() ? { changeNote: I.trim() } : {},
|
|
132
|
+
expectedVersion: V
|
|
123
133
|
}
|
|
124
|
-
} }), "The doc could not be saved.") &&
|
|
125
|
-
}, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ =
|
|
126
|
-
return /* @__PURE__ */
|
|
134
|
+
} }), "The doc could not be saved.") && j(!1);
|
|
135
|
+
}, Q = [...Y.revisions].sort((e, t) => t.version - e.version), $ = B === null ? null : Q.find((e) => e.version === B);
|
|
136
|
+
return /* @__PURE__ */ l("div", {
|
|
127
137
|
className: "space-y-6 p-6",
|
|
128
138
|
"data-testid": "doc-detail",
|
|
129
139
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ l(y, {
|
|
131
141
|
size: "sm",
|
|
132
142
|
variant: "ghost",
|
|
133
|
-
onClick: () =>
|
|
134
|
-
children: [/* @__PURE__ */
|
|
143
|
+
onClick: () => k("/docs/docs-page"),
|
|
144
|
+
children: [/* @__PURE__ */ c(re, { className: "mr-1 h-4 w-4" }), "All docs"]
|
|
135
145
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ l("div", {
|
|
137
147
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
138
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ l("div", {
|
|
139
149
|
className: "min-w-0 space-y-1",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ c("h1", {
|
|
141
151
|
className: "text-2xl font-semibold break-words",
|
|
142
152
|
"data-testid": "doc-title",
|
|
143
153
|
children: Y.title
|
|
144
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ l("p", {
|
|
145
155
|
className: "text-xs text-muted-foreground",
|
|
146
156
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ c(r, { status: Y.status }),
|
|
148
158
|
" · version ",
|
|
149
159
|
Y.version,
|
|
150
160
|
" · updated",
|
|
151
161
|
" ",
|
|
152
|
-
|
|
162
|
+
D(Y.updatedAt),
|
|
153
163
|
" by ",
|
|
154
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ c(t, { id: Y.updatedBy ?? Y.createdBy })
|
|
155
165
|
]
|
|
156
166
|
})]
|
|
157
|
-
}), !
|
|
167
|
+
}), !A && /* @__PURE__ */ l("div", {
|
|
158
168
|
className: "flex flex-wrap gap-2",
|
|
159
169
|
children: [
|
|
160
|
-
|
|
170
|
+
ne.filter((e) => e !== Y.status).map((e) => /* @__PURE__ */ c(y, {
|
|
161
171
|
size: "sm",
|
|
162
172
|
variant: "outline",
|
|
163
173
|
disabled: X,
|
|
164
|
-
onClick: () => Z(() =>
|
|
174
|
+
onClick: () => Z(() => G({ variables: {
|
|
165
175
|
id: Y.id,
|
|
166
176
|
input: {
|
|
167
177
|
status: e,
|
|
@@ -170,144 +180,144 @@ function A() {
|
|
|
170
180
|
} }), "The status could not be changed."),
|
|
171
181
|
children: e === "PUBLISHED" ? "Publish" : e === "ARCHIVED" ? "Archive" : "Back to draft"
|
|
172
182
|
}, e)),
|
|
173
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ c(y, {
|
|
174
184
|
size: "sm",
|
|
175
|
-
onClick:
|
|
185
|
+
onClick: Oe,
|
|
176
186
|
"data-testid": "doc-edit",
|
|
177
187
|
children: "Edit"
|
|
178
188
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(v, {
|
|
180
190
|
asChild: !0,
|
|
181
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ c(y, {
|
|
182
192
|
size: "sm",
|
|
183
193
|
variant: "outline",
|
|
184
194
|
disabled: X,
|
|
185
195
|
children: "Delete"
|
|
186
196
|
})
|
|
187
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(g, { children: [/* @__PURE__ */ l(_, { children: [
|
|
188
198
|
"Delete “",
|
|
189
199
|
Y.title,
|
|
190
200
|
"”?"
|
|
191
|
-
] }), /* @__PURE__ */
|
|
201
|
+
] }), /* @__PURE__ */ l(m, { children: [
|
|
192
202
|
"The doc and its history are removed for everyone, and it is unlinked from",
|
|
193
203
|
" ",
|
|
194
204
|
Y.linkedWorkItems.length,
|
|
195
205
|
" work item",
|
|
196
206
|
Y.linkedWorkItems.length === 1 ? "" : "s",
|
|
197
207
|
"."
|
|
198
|
-
] })] }), /* @__PURE__ */
|
|
208
|
+
] })] }), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(f, { children: "Keep it" }), /* @__PURE__ */ c(d, {
|
|
199
209
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
200
210
|
onClick: async () => {
|
|
201
|
-
await Z(() =>
|
|
211
|
+
await Z(() => Se({ variables: { id: Y.id } }), "The doc could not be deleted.") && k("/docs/docs-page");
|
|
202
212
|
},
|
|
203
213
|
children: "Delete"
|
|
204
214
|
})] })] })] })
|
|
205
215
|
]
|
|
206
216
|
})]
|
|
207
217
|
}),
|
|
208
|
-
|
|
218
|
+
R && /* @__PURE__ */ c("p", {
|
|
209
219
|
role: "alert",
|
|
210
220
|
className: "text-sm text-destructive",
|
|
211
221
|
"data-testid": "doc-error",
|
|
212
|
-
children:
|
|
222
|
+
children: R
|
|
213
223
|
}),
|
|
214
|
-
|
|
224
|
+
A && V !== Y.version && /* @__PURE__ */ l("p", {
|
|
215
225
|
className: "text-sm text-status-warning-text",
|
|
216
226
|
"data-testid": "doc-moved-on",
|
|
217
227
|
children: [
|
|
218
228
|
"Someone saved version ",
|
|
219
229
|
Y.version,
|
|
220
230
|
" after you started editing version ",
|
|
221
|
-
|
|
231
|
+
V,
|
|
222
232
|
". Your text is kept below; copy what you need, then discard and edit the latest."
|
|
223
233
|
]
|
|
224
234
|
}),
|
|
225
|
-
|
|
235
|
+
A ? /* @__PURE__ */ c(b, { children: /* @__PURE__ */ l(x, {
|
|
226
236
|
className: "space-y-3 pt-6",
|
|
227
237
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ c(w, {
|
|
229
239
|
"aria-label": "Doc title",
|
|
230
|
-
value:
|
|
231
|
-
onChange: (e) =>
|
|
240
|
+
value: M,
|
|
241
|
+
onChange: (e) => N(e.target.value)
|
|
232
242
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
value:
|
|
235
|
-
onChange:
|
|
243
|
+
/* @__PURE__ */ c(te, {
|
|
244
|
+
value: P,
|
|
245
|
+
onChange: F,
|
|
236
246
|
minHeight: 240
|
|
237
247
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ c(w, {
|
|
239
249
|
"aria-label": "Change note",
|
|
240
250
|
placeholder: "What changed? (optional, shown in the history)",
|
|
241
|
-
value:
|
|
242
|
-
onChange: (e) =>
|
|
251
|
+
value: I,
|
|
252
|
+
onChange: (e) => L(e.target.value)
|
|
243
253
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ l("div", {
|
|
245
255
|
className: "flex justify-end gap-2",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ c(y, {
|
|
247
257
|
size: "sm",
|
|
248
258
|
variant: "ghost",
|
|
249
259
|
onClick: () => {
|
|
250
|
-
|
|
260
|
+
j(!1), z(null);
|
|
251
261
|
},
|
|
252
|
-
children:
|
|
253
|
-
}), /* @__PURE__ */
|
|
262
|
+
children: V === Y.version ? "Cancel" : "Discard my edits"
|
|
263
|
+
}), /* @__PURE__ */ c(y, {
|
|
254
264
|
size: "sm",
|
|
255
|
-
onClick:
|
|
256
|
-
disabled:
|
|
265
|
+
onClick: ke,
|
|
266
|
+
disabled: K.loading || V !== Y.version,
|
|
257
267
|
"data-testid": "doc-save",
|
|
258
|
-
children:
|
|
268
|
+
children: K.loading ? "Saving…" : "Save new version"
|
|
259
269
|
})]
|
|
260
270
|
})
|
|
261
271
|
]
|
|
262
|
-
}) }) : /* @__PURE__ */
|
|
272
|
+
}) }) : /* @__PURE__ */ c(b, { children: /* @__PURE__ */ c(x, {
|
|
263
273
|
className: "prose prose-sm max-w-none pt-6 dark:prose-invert",
|
|
264
|
-
children: Y.content.trim() ? /* @__PURE__ */
|
|
274
|
+
children: Y.content.trim() ? /* @__PURE__ */ c(T, { children: Y.content }) : /* @__PURE__ */ c("p", {
|
|
265
275
|
className: "text-sm text-muted-foreground",
|
|
266
276
|
children: "This doc is empty."
|
|
267
277
|
})
|
|
268
278
|
}) }),
|
|
269
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ l("div", {
|
|
270
280
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ l(b, {
|
|
272
282
|
"data-testid": "doc-history",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ c(S, { children: /* @__PURE__ */ l(C, {
|
|
274
284
|
className: "flex items-center gap-2",
|
|
275
285
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ c(ie, { className: "h-4 w-4" }),
|
|
277
287
|
" History (",
|
|
278
288
|
Q.length,
|
|
279
289
|
")"
|
|
280
290
|
]
|
|
281
|
-
}) }), /* @__PURE__ */
|
|
291
|
+
}) }), /* @__PURE__ */ l(x, {
|
|
282
292
|
className: "space-y-2",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ c("ol", {
|
|
284
294
|
className: "space-y-2",
|
|
285
295
|
children: Q.map((e) => {
|
|
286
296
|
let n = e.version === Y.version;
|
|
287
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ l("li", {
|
|
288
298
|
className: "space-y-1 rounded-md border p-2",
|
|
289
299
|
"data-testid": "doc-revision",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ l("div", {
|
|
291
301
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ l("span", {
|
|
293
303
|
className: "text-sm font-medium",
|
|
294
304
|
children: [
|
|
295
305
|
"Version ",
|
|
296
306
|
e.version,
|
|
297
307
|
n ? " (current)" : ""
|
|
298
308
|
]
|
|
299
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ l("span", {
|
|
300
310
|
className: "flex gap-1",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ c(y, {
|
|
302
312
|
size: "sm",
|
|
303
313
|
variant: "ghost",
|
|
304
314
|
className: "h-7 text-xs",
|
|
305
|
-
"aria-expanded":
|
|
306
|
-
onClick: () =>
|
|
307
|
-
children:
|
|
308
|
-
}), !n && !
|
|
315
|
+
"aria-expanded": B === e.version,
|
|
316
|
+
onClick: () => ge(B === e.version ? null : e.version),
|
|
317
|
+
children: B === e.version ? "Hide" : "View"
|
|
318
|
+
}), !n && !A && /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(v, {
|
|
309
319
|
asChild: !0,
|
|
310
|
-
children: /* @__PURE__ */
|
|
320
|
+
children: /* @__PURE__ */ c(y, {
|
|
311
321
|
size: "sm",
|
|
312
322
|
variant: "outline",
|
|
313
323
|
className: "h-7 text-xs",
|
|
@@ -315,18 +325,18 @@ function A() {
|
|
|
315
325
|
"data-testid": "doc-restore",
|
|
316
326
|
children: "Restore"
|
|
317
327
|
})
|
|
318
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(g, { children: [/* @__PURE__ */ l(_, { children: [
|
|
319
329
|
"Restore version ",
|
|
320
330
|
e.version,
|
|
321
331
|
"?"
|
|
322
|
-
] }), /* @__PURE__ */
|
|
332
|
+
] }), /* @__PURE__ */ l(m, { children: [
|
|
323
333
|
"Its title and text become version ",
|
|
324
334
|
Y.version + 1,
|
|
325
335
|
". Nothing is deleted: version ",
|
|
326
336
|
Y.version,
|
|
327
337
|
" stays in the history."
|
|
328
|
-
] })] }), /* @__PURE__ */
|
|
329
|
-
onClick: () => Z(() =>
|
|
338
|
+
] })] }), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(f, { children: "Cancel" }), /* @__PURE__ */ c(d, {
|
|
339
|
+
onClick: () => Z(() => be({ variables: {
|
|
330
340
|
id: Y.id,
|
|
331
341
|
toVersion: e.version,
|
|
332
342
|
expectedVersion: Y.version
|
|
@@ -334,21 +344,21 @@ function A() {
|
|
|
334
344
|
children: "Restore"
|
|
335
345
|
})] })] })] })]
|
|
336
346
|
})]
|
|
337
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ l("p", {
|
|
338
348
|
className: "text-xs text-muted-foreground",
|
|
339
349
|
children: [
|
|
340
|
-
|
|
350
|
+
D(e.createdAt),
|
|
341
351
|
" · ",
|
|
342
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ c(t, { id: e.createdBy }),
|
|
343
353
|
e.changeNote ? ` · ${e.changeNote}` : ""
|
|
344
354
|
]
|
|
345
355
|
})]
|
|
346
356
|
}, e.id);
|
|
347
357
|
})
|
|
348
|
-
}), $ && /* @__PURE__ */
|
|
358
|
+
}), $ && /* @__PURE__ */ l("div", {
|
|
349
359
|
className: "space-y-1 rounded-md border bg-muted/40 p-3",
|
|
350
360
|
"data-testid": "doc-revision-view",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ l("p", {
|
|
352
362
|
className: "text-sm font-medium",
|
|
353
363
|
children: [
|
|
354
364
|
"Version ",
|
|
@@ -356,53 +366,77 @@ function A() {
|
|
|
356
366
|
": ",
|
|
357
367
|
$.title
|
|
358
368
|
]
|
|
359
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ c("div", {
|
|
360
370
|
className: "prose prose-sm max-w-none dark:prose-invert",
|
|
361
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ c(T, { children: $.content })
|
|
362
372
|
})]
|
|
363
373
|
})]
|
|
364
374
|
})]
|
|
365
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ l(b, {
|
|
366
376
|
"data-testid": "doc-linked-items",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ c(S, { children: /* @__PURE__ */ l(C, {
|
|
368
378
|
className: "flex items-center gap-2",
|
|
369
379
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ c(a, { className: "h-4 w-4" }),
|
|
371
381
|
" Linked work items (",
|
|
372
382
|
Y.linkedWorkItems.length,
|
|
373
383
|
")"
|
|
374
384
|
]
|
|
375
|
-
}) }), /* @__PURE__ */
|
|
385
|
+
}) }), /* @__PURE__ */ l(x, {
|
|
376
386
|
className: "space-y-2",
|
|
377
|
-
children: [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
387
|
+
children: [
|
|
388
|
+
Y.linkedWorkItems.length === 0 && /* @__PURE__ */ c("p", {
|
|
389
|
+
className: "text-sm text-muted-foreground",
|
|
390
|
+
children: "Not linked to any work item yet. Pick one below, or use “Link existing doc” on the task."
|
|
391
|
+
}),
|
|
392
|
+
Y.linkedWorkItems.map((e) => /* @__PURE__ */ l("div", {
|
|
393
|
+
className: "flex items-center justify-between gap-2 rounded-md border p-2",
|
|
394
|
+
children: [/* @__PURE__ */ l("button", {
|
|
395
|
+
type: "button",
|
|
396
|
+
className: "min-w-0 truncate text-left text-sm hover:underline",
|
|
397
|
+
onClick: () => k(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ c("span", {
|
|
400
|
+
className: "text-muted-foreground",
|
|
401
|
+
children: e.key
|
|
402
|
+
}),
|
|
403
|
+
" ",
|
|
404
|
+
e.title
|
|
405
|
+
]
|
|
406
|
+
}), /* @__PURE__ */ c(y, {
|
|
407
|
+
size: "icon",
|
|
408
|
+
variant: "ghost",
|
|
409
|
+
disabled: Te.loading,
|
|
410
|
+
"aria-label": `Unlink ${e.title}`,
|
|
411
|
+
onClick: () => Z(() => we({ variables: {
|
|
412
|
+
docId: Y.id,
|
|
413
|
+
workItemId: e.id
|
|
414
|
+
} }), "The work item could not be unlinked."),
|
|
415
|
+
children: /* @__PURE__ */ c(ae, { className: "h-4 w-4" })
|
|
416
|
+
})]
|
|
417
|
+
}, e.id)),
|
|
418
|
+
/* @__PURE__ */ l("div", {
|
|
419
|
+
className: "space-y-2 pt-2",
|
|
420
|
+
"data-testid": "doc-link-work-item",
|
|
421
|
+
children: [/* @__PURE__ */ c(ee, {
|
|
422
|
+
id: "doc-link-work-item-select",
|
|
423
|
+
value: q,
|
|
424
|
+
onChange: J,
|
|
425
|
+
exclude: Y.linkedWorkItems.map((e) => e.id)
|
|
426
|
+
}), /* @__PURE__ */ l(y, {
|
|
427
|
+
size: "sm",
|
|
428
|
+
variant: "outline",
|
|
429
|
+
disabled: !q || De.loading,
|
|
430
|
+
onClick: async () => {
|
|
431
|
+
await Z(() => Ee({ variables: {
|
|
432
|
+
docId: Y.id,
|
|
433
|
+
workItemId: q
|
|
434
|
+
} }), "The work item could not be linked.") && J("");
|
|
435
|
+
},
|
|
436
|
+
children: [/* @__PURE__ */ c(a, { className: "mr-1 h-4 w-4" }), "Link work item"]
|
|
437
|
+
})]
|
|
438
|
+
})
|
|
439
|
+
]
|
|
406
440
|
})]
|
|
407
441
|
})]
|
|
408
442
|
})
|
|
@@ -410,6 +444,6 @@ function A() {
|
|
|
410
444
|
});
|
|
411
445
|
}
|
|
412
446
|
//#endregion
|
|
413
|
-
export {
|
|
447
|
+
export { O as DocsDocDetailPagePage };
|
|
414
448
|
|
|
415
449
|
//# sourceMappingURL=DocsDocDetailPagePage.js.map
|