@burdenoff/microfe-planmagnet 2026.925.8 → 2026.925.9
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 +49 -0
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemComments.d.ts +4 -0
- package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -0
- package/dist/planmagnet/comments/WorkItemComments.js +260 -0
- package/dist/planmagnet/comments/WorkItemComments.js.map +1 -0
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +129 -127
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkItemComments.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/comments/WorkItemComments.tsx"],"names":[],"mappings":"AAqGA,wBAAgB,gBAAgB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,2CA8GtE"}
|
|
@@ -0,0 +1,260 @@
|
|
|
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 { useState as r } from "react";
|
|
5
|
+
import { MessageSquare as i } from "lucide-react";
|
|
6
|
+
import { gql as a } from "@apollo/client";
|
|
7
|
+
import { useMutation as o, useQuery as s } from "@apollo/client/react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
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 } from "@burdenoff/fe-libs/ui";
|
|
10
|
+
//#region src/planmagnet/comments/WorkItemComments.tsx
|
|
11
|
+
var w = 1e4, T = 50, E = a`
|
|
12
|
+
query WorkItemComments($workItemId: ID!, $pagination: PlanmagnetPaginationInput) {
|
|
13
|
+
planmagnetWorkItemComments(workItemId: $workItemId, pagination: $pagination) {
|
|
14
|
+
totalCount
|
|
15
|
+
pageInfo {
|
|
16
|
+
hasNextPage
|
|
17
|
+
endCursor
|
|
18
|
+
}
|
|
19
|
+
items {
|
|
20
|
+
id
|
|
21
|
+
authorId
|
|
22
|
+
body
|
|
23
|
+
createdAt
|
|
24
|
+
editedAt
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`, D = a`
|
|
29
|
+
mutation WorkItemCommentAdd($input: PlanmagnetAddWorkItemCommentInput!) {
|
|
30
|
+
planmagnetAddWorkItemComment(input: $input) {
|
|
31
|
+
id
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`, O = a`
|
|
35
|
+
mutation WorkItemCommentEdit($id: ID!, $body: String!) {
|
|
36
|
+
planmagnetEditWorkItemComment(id: $id, body: $body) {
|
|
37
|
+
id
|
|
38
|
+
body
|
|
39
|
+
editedAt
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`, k = a`
|
|
43
|
+
mutation WorkItemCommentDelete($id: ID!) {
|
|
44
|
+
planmagnetDeleteWorkItemComment(id: $id)
|
|
45
|
+
}
|
|
46
|
+
`, A = (e, t) => e instanceof Error ? e.message : t, j = (e) => new Date(e).toLocaleString();
|
|
47
|
+
function M({ message: e }) {
|
|
48
|
+
return /* @__PURE__ */ c("p", {
|
|
49
|
+
role: "alert",
|
|
50
|
+
className: "text-sm text-destructive",
|
|
51
|
+
children: e
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function N({ workItemId: t }) {
|
|
55
|
+
let { currentUser: a } = e(), [u, d] = r(""), [f, p] = r(null), [m, h] = r(!1), { data: g, loading: _, error: v, fetchMore: O } = s(E, {
|
|
56
|
+
variables: {
|
|
57
|
+
workItemId: t,
|
|
58
|
+
pagination: { first: T }
|
|
59
|
+
},
|
|
60
|
+
skip: !t
|
|
61
|
+
}), [k, j] = o(D, {
|
|
62
|
+
refetchQueries: ["WorkItemComments"],
|
|
63
|
+
awaitRefetchQueries: !0
|
|
64
|
+
}), N = g?.planmagnetWorkItemComments, F = N?.items ?? [], I = u.trim(), L = I.length > w;
|
|
65
|
+
return /* @__PURE__ */ l(b, {
|
|
66
|
+
"data-testid": "work-item-comments",
|
|
67
|
+
children: [/* @__PURE__ */ c(S, { children: /* @__PURE__ */ l(C, {
|
|
68
|
+
className: "flex items-center gap-2",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ c(i, { className: "h-4 w-4" }),
|
|
71
|
+
"Discussion ",
|
|
72
|
+
N ? `(${N.totalCount})` : ""
|
|
73
|
+
]
|
|
74
|
+
}) }), /* @__PURE__ */ l(x, {
|
|
75
|
+
className: "space-y-4",
|
|
76
|
+
children: [
|
|
77
|
+
_ && !g && /* @__PURE__ */ c("p", {
|
|
78
|
+
className: "text-sm text-muted-foreground",
|
|
79
|
+
children: "Loading comments…"
|
|
80
|
+
}),
|
|
81
|
+
v && /* @__PURE__ */ c(M, { message: `Comments could not be loaded: ${v.message}` }),
|
|
82
|
+
N && F.length === 0 && /* @__PURE__ */ c("p", {
|
|
83
|
+
className: "text-sm text-muted-foreground",
|
|
84
|
+
children: "No comments yet."
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ c("ol", {
|
|
87
|
+
className: "space-y-3",
|
|
88
|
+
children: F.map((e) => /* @__PURE__ */ c(P, {
|
|
89
|
+
comment: e,
|
|
90
|
+
mine: e.authorId === a?.id
|
|
91
|
+
}, e.id))
|
|
92
|
+
}),
|
|
93
|
+
N?.pageInfo.hasNextPage && /* @__PURE__ */ c(y, {
|
|
94
|
+
size: "sm",
|
|
95
|
+
variant: "outline",
|
|
96
|
+
onClick: async () => {
|
|
97
|
+
let e = N?.pageInfo.endCursor;
|
|
98
|
+
if (e) {
|
|
99
|
+
h(!0);
|
|
100
|
+
try {
|
|
101
|
+
await O({
|
|
102
|
+
variables: { pagination: {
|
|
103
|
+
first: T,
|
|
104
|
+
after: e
|
|
105
|
+
} },
|
|
106
|
+
updateQuery: (e, { fetchMoreResult: t }) => ({ planmagnetWorkItemComments: {
|
|
107
|
+
...t.planmagnetWorkItemComments,
|
|
108
|
+
items: [...e.planmagnetWorkItemComments.items, ...t.planmagnetWorkItemComments.items]
|
|
109
|
+
} })
|
|
110
|
+
});
|
|
111
|
+
} finally {
|
|
112
|
+
h(!1);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
disabled: m,
|
|
117
|
+
children: m ? "Loading…" : `Show more (${F.length} of ${N.totalCount})`
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ l("div", {
|
|
120
|
+
className: "space-y-2 border-t pt-4",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ c("label", {
|
|
123
|
+
htmlFor: `comment-${t}`,
|
|
124
|
+
className: "sr-only",
|
|
125
|
+
children: "Add a comment"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ c("textarea", {
|
|
128
|
+
id: `comment-${t}`,
|
|
129
|
+
className: "w-full min-h-[80px] rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
130
|
+
placeholder: "Add a comment…",
|
|
131
|
+
value: u,
|
|
132
|
+
onChange: (e) => d(e.target.value)
|
|
133
|
+
}),
|
|
134
|
+
L && /* @__PURE__ */ c(M, { message: `A comment can be at most ${w} characters.` }),
|
|
135
|
+
f && /* @__PURE__ */ c(M, { message: f }),
|
|
136
|
+
/* @__PURE__ */ c("div", {
|
|
137
|
+
className: "flex justify-end",
|
|
138
|
+
children: /* @__PURE__ */ c(y, {
|
|
139
|
+
size: "sm",
|
|
140
|
+
onClick: async () => {
|
|
141
|
+
p(null);
|
|
142
|
+
try {
|
|
143
|
+
await n(k({ variables: { input: {
|
|
144
|
+
workItemId: t,
|
|
145
|
+
body: I
|
|
146
|
+
} } })), d("");
|
|
147
|
+
} catch (e) {
|
|
148
|
+
p(A(e, "The comment could not be posted."));
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
disabled: !I || L || j.loading,
|
|
152
|
+
"data-testid": "comment-post",
|
|
153
|
+
children: j.loading ? "Posting…" : "Comment"
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
})
|
|
158
|
+
]
|
|
159
|
+
})]
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function P({ comment: e, mine: i }) {
|
|
163
|
+
let [a, s] = r(!1), [b, x] = r(e.body), [S, C] = r(null), w = {
|
|
164
|
+
refetchQueries: ["WorkItemComments"],
|
|
165
|
+
awaitRefetchQueries: !0
|
|
166
|
+
}, [T, E] = o(O, w), [D, N] = o(k, w);
|
|
167
|
+
return /* @__PURE__ */ l("li", {
|
|
168
|
+
className: "rounded-md border p-3 space-y-1",
|
|
169
|
+
"data-testid": "comment",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ l("div", {
|
|
172
|
+
className: "flex items-center justify-between gap-2 text-xs text-muted-foreground",
|
|
173
|
+
children: [/* @__PURE__ */ l("span", { children: [
|
|
174
|
+
/* @__PURE__ */ c("span", {
|
|
175
|
+
className: "font-medium text-foreground",
|
|
176
|
+
children: /* @__PURE__ */ c(t, { id: e.authorId })
|
|
177
|
+
}),
|
|
178
|
+
" ",
|
|
179
|
+
"· ",
|
|
180
|
+
j(e.createdAt),
|
|
181
|
+
e.editedAt && /* @__PURE__ */ c("span", {
|
|
182
|
+
title: `Edited ${j(e.editedAt)}`,
|
|
183
|
+
children: " · edited"
|
|
184
|
+
})
|
|
185
|
+
] }), i && !a && /* @__PURE__ */ l("span", {
|
|
186
|
+
className: "flex gap-1",
|
|
187
|
+
children: [/* @__PURE__ */ c(y, {
|
|
188
|
+
size: "sm",
|
|
189
|
+
variant: "ghost",
|
|
190
|
+
className: "h-6 px-2 text-xs",
|
|
191
|
+
onClick: () => s(!0),
|
|
192
|
+
children: "Edit"
|
|
193
|
+
}), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ c(v, {
|
|
194
|
+
asChild: !0,
|
|
195
|
+
children: /* @__PURE__ */ c(y, {
|
|
196
|
+
size: "sm",
|
|
197
|
+
variant: "ghost",
|
|
198
|
+
className: "h-6 px-2 text-xs",
|
|
199
|
+
disabled: N.loading,
|
|
200
|
+
children: "Delete"
|
|
201
|
+
})
|
|
202
|
+
}), /* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(g, { children: [/* @__PURE__ */ c(_, { children: "Delete this comment?" }), /* @__PURE__ */ c(m, { children: "It is removed from the discussion for everyone." })] }), /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ c(f, { children: "Keep it" }), /* @__PURE__ */ c(d, {
|
|
203
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
204
|
+
onClick: async () => {
|
|
205
|
+
C(null);
|
|
206
|
+
try {
|
|
207
|
+
await n(D({ variables: { id: e.id } }));
|
|
208
|
+
} catch (e) {
|
|
209
|
+
C(A(e, "The comment could not be deleted."));
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
children: "Delete"
|
|
213
|
+
})] })] })] })]
|
|
214
|
+
})]
|
|
215
|
+
}),
|
|
216
|
+
a ? /* @__PURE__ */ l("div", {
|
|
217
|
+
className: "space-y-2",
|
|
218
|
+
children: [/* @__PURE__ */ c("textarea", {
|
|
219
|
+
"aria-label": "Edit comment",
|
|
220
|
+
className: "w-full min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
221
|
+
value: b,
|
|
222
|
+
onChange: (e) => x(e.target.value)
|
|
223
|
+
}), /* @__PURE__ */ l("div", {
|
|
224
|
+
className: "flex justify-end gap-2",
|
|
225
|
+
children: [/* @__PURE__ */ c(y, {
|
|
226
|
+
size: "sm",
|
|
227
|
+
variant: "outline",
|
|
228
|
+
onClick: () => {
|
|
229
|
+
s(!1), x(e.body), C(null);
|
|
230
|
+
},
|
|
231
|
+
children: "Cancel"
|
|
232
|
+
}), /* @__PURE__ */ c(y, {
|
|
233
|
+
size: "sm",
|
|
234
|
+
onClick: async () => {
|
|
235
|
+
C(null);
|
|
236
|
+
try {
|
|
237
|
+
await n(T({ variables: {
|
|
238
|
+
id: e.id,
|
|
239
|
+
body: b.trim()
|
|
240
|
+
} })), s(!1);
|
|
241
|
+
} catch (e) {
|
|
242
|
+
C(A(e, "The comment could not be saved."));
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
disabled: !b.trim() || E.loading,
|
|
246
|
+
children: E.loading ? "Saving…" : "Save"
|
|
247
|
+
})]
|
|
248
|
+
})]
|
|
249
|
+
}) : /* @__PURE__ */ c("p", {
|
|
250
|
+
className: "text-sm whitespace-pre-wrap break-words",
|
|
251
|
+
children: e.body
|
|
252
|
+
}),
|
|
253
|
+
S && /* @__PURE__ */ c(M, { message: S })
|
|
254
|
+
]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
export { N as WorkItemComments };
|
|
259
|
+
|
|
260
|
+
//# sourceMappingURL=WorkItemComments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkItemComments.js","names":[],"sources":["../../../src/planmagnet/comments/WorkItemComments.tsx"],"sourcesContent":["import { useState } from 'react';\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} from '@burdenoff/fe-libs/ui';\nimport { MessageSquare } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { PersonName } from '../people/People';\nimport { throwOnError } from '../utils/mutationResult';\n\n/**\n * Discussion on a work item (P1.4). Anyone who can read the item sees the\n * thread; posting needs edit rights on work items; only a comment's author\n * can edit or delete it. The server enforces all three and says why it refused\n * (shown inline). The controls here only avoid offering what would be refused.\n */\n\nconst MAX_LENGTH = 10_000;\nconst PAGE = 50;\n\nconst COMMENTS = gql`\n query WorkItemComments($workItemId: ID!, $pagination: PlanmagnetPaginationInput) {\n planmagnetWorkItemComments(workItemId: $workItemId, pagination: $pagination) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n id\n authorId\n body\n createdAt\n editedAt\n }\n }\n }\n`;\nconst ADD = gql`\n mutation WorkItemCommentAdd($input: PlanmagnetAddWorkItemCommentInput!) {\n planmagnetAddWorkItemComment(input: $input) {\n id\n }\n }\n`;\nconst EDIT = gql`\n mutation WorkItemCommentEdit($id: ID!, $body: String!) {\n planmagnetEditWorkItemComment(id: $id, body: $body) {\n id\n body\n editedAt\n }\n }\n`;\nconst DELETE = gql`\n mutation WorkItemCommentDelete($id: ID!) {\n planmagnetDeleteWorkItemComment(id: $id)\n }\n`;\n\ninterface Comment {\n id: string;\n authorId: string;\n body: string;\n createdAt: string;\n editedAt: string | null;\n}\n\ninterface CommentsData {\n planmagnetWorkItemComments: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: Comment[];\n };\n}\n\nconst messageOf = (e: unknown, fallback: string) => (e instanceof Error ? e.message : fallback);\nconst when = (iso: string) => new Date(iso).toLocaleString();\n\nfunction ErrorLine({ message }: { message: string }) {\n return (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {message}\n </p>\n );\n}\n\nexport function WorkItemComments({ workItemId }: { workItemId: string }) {\n const { currentUser } = usePlanMagnet();\n const [draft, setDraft] = useState('');\n const [error, setError] = useState<string | null>(null);\n const [loadingMore, setLoadingMore] = useState(false);\n\n const {\n data,\n loading,\n error: loadError,\n fetchMore,\n } = useQuery<CommentsData>(COMMENTS, {\n variables: { workItemId, pagination: { first: PAGE } },\n skip: !workItemId,\n });\n const refetch = { refetchQueries: ['WorkItemComments'], awaitRefetchQueries: true };\n const [add, addState] = useMutation(ADD, refetch);\n\n const thread = data?.planmagnetWorkItemComments;\n const comments = thread?.items ?? [];\n const trimmed = draft.trim();\n const tooLong = trimmed.length > MAX_LENGTH;\n\n const post = async () => {\n setError(null);\n try {\n await throwOnError(add({ variables: { input: { workItemId, body: trimmed } } }));\n setDraft('');\n } catch (e) {\n setError(messageOf(e, 'The comment could not be posted.'));\n }\n };\n\n const loadMore = async () => {\n const after = thread?.pageInfo.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetWorkItemComments: {\n ...fetchMoreResult.planmagnetWorkItemComments,\n items: [\n ...prev.planmagnetWorkItemComments.items,\n ...fetchMoreResult.planmagnetWorkItemComments.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <Card data-testid=\"work-item-comments\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <MessageSquare className=\"h-4 w-4\" />\n Discussion {thread ? `(${thread.totalCount})` : ''}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-4\">\n {loading && !data && <p className=\"text-sm text-muted-foreground\">Loading comments…</p>}\n {loadError && <ErrorLine message={`Comments could not be loaded: ${loadError.message}`} />}\n {thread && comments.length === 0 && (\n <p className=\"text-sm text-muted-foreground\">No comments yet.</p>\n )}\n <ol className=\"space-y-3\">\n {comments.map((comment) => (\n <CommentRow\n key={comment.id}\n comment={comment}\n mine={comment.authorId === currentUser?.id}\n />\n ))}\n </ol>\n {thread?.pageInfo.hasNextPage && (\n <Button size=\"sm\" variant=\"outline\" onClick={loadMore} disabled={loadingMore}>\n {loadingMore ? 'Loading…' : `Show more (${comments.length} of ${thread.totalCount})`}\n </Button>\n )}\n <div className=\"space-y-2 border-t pt-4\">\n <label htmlFor={`comment-${workItemId}`} className=\"sr-only\">\n Add a comment\n </label>\n <textarea\n id={`comment-${workItemId}`}\n className=\"w-full min-h-[80px] rounded-md border border-input bg-background px-3 py-2 text-sm\"\n placeholder=\"Add a comment…\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n />\n {tooLong && <ErrorLine message={`A comment can be at most ${MAX_LENGTH} characters.`} />}\n {error && <ErrorLine message={error} />}\n <div className=\"flex justify-end\">\n <Button\n size=\"sm\"\n onClick={post}\n disabled={!trimmed || tooLong || addState.loading}\n data-testid=\"comment-post\"\n >\n {addState.loading ? 'Posting…' : 'Comment'}\n </Button>\n </div>\n </div>\n </CardContent>\n </Card>\n );\n}\n\nfunction CommentRow({ comment, mine }: { comment: Comment; mine: boolean }) {\n const [editing, setEditing] = useState(false);\n const [text, setText] = useState(comment.body);\n const [error, setError] = useState<string | null>(null);\n const refetch = { refetchQueries: ['WorkItemComments'], awaitRefetchQueries: true };\n const [edit, editState] = useMutation(EDIT, refetch);\n const [remove, removeState] = useMutation(DELETE, refetch);\n\n const save = async () => {\n setError(null);\n try {\n await throwOnError(edit({ variables: { id: comment.id, body: text.trim() } }));\n setEditing(false);\n } catch (e) {\n setError(messageOf(e, 'The comment could not be saved.'));\n }\n };\n\n return (\n <li className=\"rounded-md border p-3 space-y-1\" data-testid=\"comment\">\n <div className=\"flex items-center justify-between gap-2 text-xs text-muted-foreground\">\n <span>\n <span className=\"font-medium text-foreground\">\n <PersonName id={comment.authorId} />\n </span>{' '}\n · {when(comment.createdAt)}\n {comment.editedAt && <span title={`Edited ${when(comment.editedAt)}`}> · edited</span>}\n </span>\n {mine && !editing && (\n <span className=\"flex gap-1\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n onClick={() => setEditing(true)}\n >\n Edit\n </Button>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n className=\"h-6 px-2 text-xs\"\n disabled={removeState.loading}\n >\n Delete\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Delete this comment?</AlertDialogTitle>\n <AlertDialogDescription>\n It is removed from the discussion for everyone.\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 setError(null);\n try {\n await throwOnError(remove({ variables: { id: comment.id } }));\n } catch (e) {\n setError(messageOf(e, 'The comment could not be deleted.'));\n }\n }}\n >\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </span>\n )}\n </div>\n {editing ? (\n <div className=\"space-y-2\">\n <textarea\n aria-label=\"Edit comment\"\n className=\"w-full min-h-[60px] rounded-md border border-input bg-background px-3 py-2 text-sm\"\n value={text}\n onChange={(e) => setText(e.target.value)}\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => {\n setEditing(false);\n setText(comment.body);\n setError(null);\n }}\n >\n Cancel\n </Button>\n <Button size=\"sm\" onClick={save} disabled={!text.trim() || editState.loading}>\n {editState.loading ? 'Saving…' : 'Save'}\n </Button>\n </div>\n </div>\n ) : (\n <p className=\"text-sm whitespace-pre-wrap break-words\">{comment.body}</p>\n )}\n {error && <ErrorLine message={error} />}\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAM,IAAa,KACb,IAAO,IAEP,IAAW,CAAG;;;;;;;;;;;;;;;;;GAkBd,IAAM,CAAG;;;;;;GAOT,IAAO,CAAG;;;;;;;;GASV,IAAS,CAAG;;;;GAsBZ,KAAa,GAAY,MAAsB,aAAa,QAAQ,EAAE,UAAU,GAChF,KAAQ,MAAgB,IAAI,KAAK,EAAI,CAAC,gBAAgB;AAE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MACV,SAAS,YAAY;AACnB,SAAS,KAAK;AACd,WAAI;AACF,cAAM,EAAa,EAAO,EAAE,WAAW,EAAE,IAAI,EAAQ,IAAI,EAAE,CAAC,CAAC;gBACtD,GAAG;AACV,UAAS,EAAU,GAAG,oCAAoC,CAAC;;;gBAGhE;MAEmB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA,CACT,EAAA,CAAA,CACT;OAEL;;GACL,IACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,YAAD;KACE,cAAW;KACX,WAAU;KACV,OAAO;KACP,WAAW,MAAM,EAAQ,EAAE,OAAO,MAAM;KACxC,CAAA,EACF,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MACE,MAAK;MACL,SAAQ;MACR,eAAe;AAGb,OAFA,EAAW,GAAM,EACjB,EAAQ,EAAQ,KAAK,EACrB,EAAS,KAAK;;gBAEjB;MAEQ,CAAA,EACT,kBAAC,GAAD;MAAQ,MAAK;MAAK,SAzFf,YAAY;AACvB,SAAS,KAAK;AACd,WAAI;AAEF,QADA,MAAM,EAAa,EAAK,EAAE,WAAW;SAAE,IAAI,EAAQ;SAAI,MAAM,EAAK,MAAM;SAAE,EAAE,CAAC,CAAC,EAC9E,EAAW,GAAM;gBACV,GAAG;AACV,UAAS,EAAU,GAAG,kCAAkC,CAAC;;;MAmFlB,UAAU,CAAC,EAAK,MAAM,IAAI,EAAU;gBAClE,EAAU,UAAU,YAAY;MAC1B,CAAA,CACL;OACF;QAEN,kBAAC,KAAD;IAAG,WAAU;cAA2C,EAAQ;IAAS,CAAA;GAE1E,KAAS,kBAAC,GAAD,EAAW,SAAS,GAAS,CAAA;GACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TasksTaskDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TasksTaskDetailPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TasksTaskDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TasksTaskDetailPagePage.tsx"],"names":[],"mappings":"AA4RA,wBAAgB,uBAAuB,4CAgKtC"}
|