@burdenoff/microfe-healthybowl 2026.704.5 → 2026.705.1
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.
|
@@ -17,7 +17,7 @@ import { cva as h } from "../../../class-variance-authority/dist/index.js";
|
|
|
17
17
|
import { createContext as g, useCallback as _, useContext as v, useEffect as y, useMemo as b, useState as x } from "react";
|
|
18
18
|
import { CalendarDays as S, CalendarRange as C, ChevronDown as w, ChevronLeft as T, ChevronRight as E, ChevronUp as D, Circle as O, CircleCheckBig as k, CircleDashed as A, CircleDot as j, CircleDotDashed as M, CircleX as N, Flag as P, LayoutGrid as F, Link2 as I, List as L, Plus as R, Search as z, Trash2 as B, User as V } from "lucide-react";
|
|
19
19
|
import { jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
20
|
-
import { Card as
|
|
20
|
+
import { Card as ee, CardContent as W } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
import { gql as G } from "@apollo/client";
|
|
22
22
|
import { useApolloClient as te, useMutation as ne, useQuery as K } from "@apollo/client/react";
|
|
23
23
|
import "@apollo/client/core";
|
|
@@ -35,10 +35,10 @@ function ie() {
|
|
|
35
35
|
return { ...re };
|
|
36
36
|
}
|
|
37
37
|
var ae = g(null);
|
|
38
|
-
function
|
|
38
|
+
function oe() {
|
|
39
39
|
return v(ae);
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var se = G`
|
|
42
42
|
fragment WorkItemSummaryFields on WorkItem {
|
|
43
43
|
id
|
|
44
44
|
key
|
|
@@ -52,7 +52,7 @@ var oe = G`
|
|
|
52
52
|
dueDate
|
|
53
53
|
labels
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
55
|
+
`, ce = G`
|
|
56
56
|
fragment WorkItemFields on WorkItem {
|
|
57
57
|
id
|
|
58
58
|
workspaceId
|
|
@@ -81,7 +81,7 @@ var oe = G`
|
|
|
81
81
|
updatedBy
|
|
82
82
|
deletedAt
|
|
83
83
|
}
|
|
84
|
-
`,
|
|
84
|
+
`, le = G`
|
|
85
85
|
fragment ProjectSummaryFields on Project {
|
|
86
86
|
id
|
|
87
87
|
name
|
|
@@ -93,7 +93,7 @@ var oe = G`
|
|
|
93
93
|
endDate
|
|
94
94
|
tags
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`, ue = G`
|
|
97
97
|
query ListWorkItems(
|
|
98
98
|
$workspaceId: ID!
|
|
99
99
|
$filter: PlanmagnetWorkItemFilter
|
|
@@ -117,14 +117,14 @@ var oe = G`
|
|
|
117
117
|
totalCount
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
${
|
|
121
|
-
`,
|
|
120
|
+
${se}
|
|
121
|
+
`, de = G`
|
|
122
122
|
query GetWorkItem($id: ID!) {
|
|
123
123
|
planmagnetWorkItem(id: $id) {
|
|
124
124
|
...WorkItemFields
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
${
|
|
127
|
+
${ce}
|
|
128
128
|
`;
|
|
129
129
|
G`
|
|
130
130
|
query GetProjects(
|
|
@@ -150,22 +150,22 @@ G`
|
|
|
150
150
|
totalCount
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
${
|
|
153
|
+
${le}
|
|
154
154
|
`;
|
|
155
|
-
var
|
|
155
|
+
var fe = G`
|
|
156
156
|
mutation CreateWorkItem($input: PlanmagnetCreateWorkItemInput!) {
|
|
157
157
|
planmagnetCreateWorkItem(input: $input) {
|
|
158
158
|
...WorkItemFields
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
${
|
|
162
|
-
`,
|
|
161
|
+
${ce}
|
|
162
|
+
`, pe = G`
|
|
163
163
|
mutation UpdateWorkItem($id: ID!, $input: PlanmagnetUpdateWorkItemInput!) {
|
|
164
164
|
planmagnetUpdateWorkItem(id: $id, input: $input) {
|
|
165
165
|
...WorkItemFields
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
${
|
|
168
|
+
${ce}
|
|
169
169
|
`;
|
|
170
170
|
G`
|
|
171
171
|
mutation MoveWorkItem($id: ID!, $input: PlanmagnetMoveWorkItemInput!) {
|
|
@@ -173,9 +173,9 @@ G`
|
|
|
173
173
|
...WorkItemFields
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
${
|
|
176
|
+
${ce}
|
|
177
177
|
`;
|
|
178
|
-
var
|
|
178
|
+
var me = G`
|
|
179
179
|
fragment WorkItemLinkFields on WorkItemLink {
|
|
180
180
|
id
|
|
181
181
|
workspaceId
|
|
@@ -192,7 +192,7 @@ var pe = G`
|
|
|
192
192
|
createdAt
|
|
193
193
|
updatedAt
|
|
194
194
|
}
|
|
195
|
-
`,
|
|
195
|
+
`, he = G`
|
|
196
196
|
query ListWorkItemLinks(
|
|
197
197
|
$workspaceId: ID!
|
|
198
198
|
$filter: PlanmagnetWorkItemLinkFilter
|
|
@@ -216,7 +216,7 @@ var pe = G`
|
|
|
216
216
|
totalCount
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
${
|
|
219
|
+
${me}
|
|
220
220
|
`;
|
|
221
221
|
G`
|
|
222
222
|
mutation CreateWorkItemLink($input: PlanmagnetCreateWorkItemLinkInput!) {
|
|
@@ -224,13 +224,13 @@ G`
|
|
|
224
224
|
...WorkItemLinkFields
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
${
|
|
227
|
+
${me}
|
|
228
228
|
`, G`
|
|
229
229
|
mutation UnlinkWorkItem($id: ID!) {
|
|
230
230
|
planmagnetUnlinkWorkItem(id: $id)
|
|
231
231
|
}
|
|
232
232
|
`;
|
|
233
|
-
var
|
|
233
|
+
var ge = G`
|
|
234
234
|
query ListMilestones(
|
|
235
235
|
$workspaceId: ID!
|
|
236
236
|
$filter: PlanmagnetMilestoneFilter
|
|
@@ -268,16 +268,16 @@ var he = G`
|
|
|
268
268
|
updatedAt
|
|
269
269
|
}
|
|
270
270
|
`}
|
|
271
|
-
`,
|
|
271
|
+
`, _e = G`
|
|
272
272
|
mutation DeleteWorkItem($id: ID!) {
|
|
273
273
|
planmagnetDeleteWorkItem(id: $id)
|
|
274
274
|
}
|
|
275
275
|
`;
|
|
276
|
-
function
|
|
276
|
+
function q(...n) {
|
|
277
277
|
return t(e(n));
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
279
|
+
var ve = /* @__PURE__ */ new Set(["DONE", "CANCELLED"]);
|
|
280
|
+
function J(e) {
|
|
281
281
|
if (!e) return null;
|
|
282
282
|
let t = m(e);
|
|
283
283
|
return o(t) ? t : null;
|
|
@@ -288,18 +288,18 @@ function ye(e) {
|
|
|
288
288
|
return Number.isNaN(n.getTime()) ? void 0 : n.toISOString();
|
|
289
289
|
}
|
|
290
290
|
function be(e) {
|
|
291
|
-
let t =
|
|
291
|
+
let t = J(e);
|
|
292
292
|
if (!t) return null;
|
|
293
293
|
let n = /* @__PURE__ */ new Date();
|
|
294
294
|
return d(t, t.getFullYear() === n.getFullYear() ? "MMM d" : "MMM d yyyy");
|
|
295
295
|
}
|
|
296
296
|
function xe(e) {
|
|
297
|
-
let t =
|
|
297
|
+
let t = J(e);
|
|
298
298
|
return t ? d(t, "MMM d, yyyy") : null;
|
|
299
299
|
}
|
|
300
300
|
function Se(e, t) {
|
|
301
|
-
let n =
|
|
302
|
-
return !n || t &&
|
|
301
|
+
let n = J(e);
|
|
302
|
+
return !n || t && ve.has(t) ? !1 : i(n).getTime() < i(/* @__PURE__ */ new Date()).getTime();
|
|
303
303
|
}
|
|
304
304
|
var Ce = h("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors", {
|
|
305
305
|
variants: { variant: {
|
|
@@ -313,7 +313,7 @@ var Ce = h("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-m
|
|
|
313
313
|
});
|
|
314
314
|
function we({ className: e, variant: t, ...n }) {
|
|
315
315
|
return /* @__PURE__ */ H("span", {
|
|
316
|
-
className:
|
|
316
|
+
className: q(Ce({ variant: t }), e),
|
|
317
317
|
...n
|
|
318
318
|
});
|
|
319
319
|
}
|
|
@@ -343,7 +343,7 @@ function Oe(e, t) {
|
|
|
343
343
|
}
|
|
344
344
|
function ke({ id: e, name: t, size: n = "md", className: r }) {
|
|
345
345
|
if (!e && !t) return /* @__PURE__ */ H("span", {
|
|
346
|
-
className:
|
|
346
|
+
className: q("inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground", Ee[n], r),
|
|
347
347
|
title: "Unassigned",
|
|
348
348
|
"aria-label": "Unassigned",
|
|
349
349
|
children: /* @__PURE__ */ H(V, {
|
|
@@ -353,7 +353,7 @@ function ke({ id: e, name: t, size: n = "md", className: r }) {
|
|
|
353
353
|
});
|
|
354
354
|
let i = Te[De(t || e || "")];
|
|
355
355
|
return /* @__PURE__ */ H("span", {
|
|
356
|
-
className:
|
|
356
|
+
className: q("inline-flex items-center justify-center rounded-full font-medium", Ee[n], i, r),
|
|
357
357
|
title: t ?? e ?? void 0,
|
|
358
358
|
"aria-label": t ?? e ?? void 0,
|
|
359
359
|
children: Oe(t, e)
|
|
@@ -417,7 +417,7 @@ function Fe({ link: e, renderIcon: t, className: n }) {
|
|
|
417
417
|
className: "h-3 w-3 shrink-0",
|
|
418
418
|
"aria-hidden": "true"
|
|
419
419
|
}), a = /* @__PURE__ */ U("span", {
|
|
420
|
-
className:
|
|
420
|
+
className: q("inline-flex max-w-full items-center gap-1 rounded-full border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] font-medium text-primary", n),
|
|
421
421
|
title: `${Pe(e.relationType)} \xB7 ${Pe(e.entityType)}`,
|
|
422
422
|
children: [i, /* @__PURE__ */ H("span", {
|
|
423
423
|
className: "truncate",
|
|
@@ -484,6 +484,9 @@ var Ie = {
|
|
|
484
484
|
linkedRecordsLabel: "Linked records",
|
|
485
485
|
createdLabel: "Created",
|
|
486
486
|
updatedLabel: "Updated",
|
|
487
|
+
parentLabel: "Parent",
|
|
488
|
+
subtasksLabel: "Sub-tasks",
|
|
489
|
+
addSubtask: "Add sub-task",
|
|
487
490
|
create: "Create task",
|
|
488
491
|
creating: "Creating…",
|
|
489
492
|
cancel: "Cancel",
|
|
@@ -581,14 +584,14 @@ var Be = {
|
|
|
581
584
|
function Ve({ status: e, className: t }) {
|
|
582
585
|
let n = Be[e] ?? Be.TODO, r = n.icon;
|
|
583
586
|
return /* @__PURE__ */ H(r, {
|
|
584
|
-
className:
|
|
587
|
+
className: q("h-3.5 w-3.5 shrink-0", n.tone, t),
|
|
585
588
|
"aria-hidden": "true"
|
|
586
589
|
});
|
|
587
590
|
}
|
|
588
591
|
function He({ status: e, className: t }) {
|
|
589
592
|
let n = Y();
|
|
590
593
|
return /* @__PURE__ */ U("span", {
|
|
591
|
-
className:
|
|
594
|
+
className: q("inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium capitalize text-foreground", t),
|
|
592
595
|
children: [/* @__PURE__ */ H(Ve, { status: e }), n.status[e]]
|
|
593
596
|
});
|
|
594
597
|
}
|
|
@@ -621,12 +624,12 @@ var Ue = {
|
|
|
621
624
|
function Ge({ priority: e, showLabel: t = !1, className: n }) {
|
|
622
625
|
let r = Y(), i = Ue[e] ?? Ue.NONE;
|
|
623
626
|
return /* @__PURE__ */ U("span", {
|
|
624
|
-
className:
|
|
627
|
+
className: q("inline-flex items-center gap-1.5", i.tone, n),
|
|
625
628
|
title: `${r.priorityLabel}: ${r.priority[e]}`,
|
|
626
629
|
children: [/* @__PURE__ */ H("span", {
|
|
627
630
|
className: "flex items-end gap-0.5",
|
|
628
631
|
"aria-hidden": "true",
|
|
629
|
-
children: We.map((e, t) => /* @__PURE__ */ H("span", { className:
|
|
632
|
+
children: We.map((e, t) => /* @__PURE__ */ H("span", { className: q("w-1 rounded-[1px]", e, t < i.level ? "bg-current" : "bg-current/25") }, e))
|
|
630
633
|
}), t && /* @__PURE__ */ H("span", {
|
|
631
634
|
className: "text-xs font-medium capitalize",
|
|
632
635
|
children: r.priority[e]
|
|
@@ -658,13 +661,13 @@ function Je({ open: e, onClose: t, children: n, ariaLabel: r, className: i, vari
|
|
|
658
661
|
}, [e, t]), !e) return null;
|
|
659
662
|
let o = a === "modal";
|
|
660
663
|
return /* @__PURE__ */ H("div", {
|
|
661
|
-
className:
|
|
664
|
+
className: q("fixed inset-0 z-50 flex bg-foreground/40", o ? "items-center justify-center p-4" : "justify-end"),
|
|
662
665
|
onClick: t,
|
|
663
666
|
children: /* @__PURE__ */ U("div", {
|
|
664
667
|
role: "dialog",
|
|
665
668
|
"aria-modal": "true",
|
|
666
669
|
"aria-label": r,
|
|
667
|
-
className:
|
|
670
|
+
className: q("relative overflow-y-auto bg-background text-foreground shadow-lg", o ? "max-h-[90vh] w-full max-w-2xl rounded-lg" : "h-full w-full max-w-lg", i),
|
|
668
671
|
onClick: (e) => e.stopPropagation(),
|
|
669
672
|
children: [/* @__PURE__ */ H("button", {
|
|
670
673
|
type: "button",
|
|
@@ -701,7 +704,7 @@ function Qe({ task: e, hidden: t = Ze, onClick: n, draggable: r, onDragStart: i,
|
|
|
701
704
|
onKeyDown: n ? (t) => {
|
|
702
705
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), n(e));
|
|
703
706
|
} : void 0,
|
|
704
|
-
className:
|
|
707
|
+
className: q("group rounded-lg border border-border bg-card p-2.5 shadow-sm transition", "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring", T && "cursor-pointer hover:border-primary/50 hover:shadow-md", r && "active:cursor-grabbing", o && "opacity-50 ring-2 ring-primary/40", u),
|
|
705
708
|
children: [
|
|
706
709
|
h && /* @__PURE__ */ U("div", {
|
|
707
710
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
@@ -758,7 +761,7 @@ function Qe({ task: e, hidden: t = Ze, onClick: n, draggable: r, onDragStart: i,
|
|
|
758
761
|
children: m.name
|
|
759
762
|
})]
|
|
760
763
|
}) : /* @__PURE__ */ H("span", {}), C && /* @__PURE__ */ U("span", {
|
|
761
|
-
className:
|
|
764
|
+
className: q("flex shrink-0 items-center gap-1 text-[11px]", f ? "font-medium text-destructive" : "text-muted-foreground"),
|
|
762
765
|
title: f ? d.overdueLabel : d.dueDateLabel,
|
|
763
766
|
children: [/* @__PURE__ */ H(S, {
|
|
764
767
|
className: "h-3 w-3",
|
|
@@ -770,7 +773,7 @@ function Qe({ task: e, hidden: t = Ze, onClick: n, draggable: r, onDragStart: i,
|
|
|
770
773
|
});
|
|
771
774
|
}
|
|
772
775
|
function $e(e, t, n = 500) {
|
|
773
|
-
let { data: r, loading: i } = K(
|
|
776
|
+
let { data: r, loading: i } = K(he, {
|
|
774
777
|
variables: {
|
|
775
778
|
workspaceId: e,
|
|
776
779
|
...t ? { filter: { sourceProduct: t } } : {},
|
|
@@ -791,7 +794,7 @@ function $e(e, t, n = 500) {
|
|
|
791
794
|
};
|
|
792
795
|
}
|
|
793
796
|
function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, hideHeader: i, priority: a = "ALL", type: o = "ALL", search: s = "", assigneeId: c, hiddenFields: l, resolveAssignee: u, linkSourceProduct: d, renderLinkIcon: f, onTaskClick: p, className: m, workspaceId: h }) {
|
|
794
|
-
let g =
|
|
797
|
+
let g = oe(), v = h ?? g?.workspaceId, y = te(), S = Y(), C = b(() => new Set(l ?? []), [l]), { linksByItem: w } = $e(v, d), [T, E] = x(null), [D, O] = x(null), [k, A] = x(null), [j, M] = x(null), [N] = ne(pe), { data: P, loading: F, error: I } = K(ue, {
|
|
795
798
|
variables: {
|
|
796
799
|
workspaceId: v,
|
|
797
800
|
...e ? { filter: { projectId: e } } : {},
|
|
@@ -823,15 +826,15 @@ function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, h
|
|
|
823
826
|
S
|
|
824
827
|
]);
|
|
825
828
|
if (!v) return /* @__PURE__ */ H("div", {
|
|
826
|
-
className:
|
|
829
|
+
className: q("p-6 text-sm text-destructive", m),
|
|
827
830
|
children: "TaskBoard: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
828
831
|
});
|
|
829
832
|
if (F && !P) return /* @__PURE__ */ H("div", {
|
|
830
|
-
className:
|
|
833
|
+
className: q("flex items-center justify-center p-12", m),
|
|
831
834
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
832
835
|
});
|
|
833
836
|
if (I && !P) return /* @__PURE__ */ U("div", {
|
|
834
|
-
className:
|
|
837
|
+
className: q("p-6 text-sm text-destructive", m),
|
|
835
838
|
children: [
|
|
836
839
|
S.errorLoading,
|
|
837
840
|
": ",
|
|
@@ -842,9 +845,9 @@ function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, h
|
|
|
842
845
|
e.title,
|
|
843
846
|
e.key,
|
|
844
847
|
...e.labels ?? []
|
|
845
|
-
].join(" ").toLowerCase().includes(z))), V = !n,
|
|
848
|
+
].join(" ").toLowerCase().includes(z))), V = !n, ee = (e) => (t) => {
|
|
846
849
|
!V || !T || (t.preventDefault(), D !== e && O(e));
|
|
847
|
-
},
|
|
850
|
+
}, W = (e) => (t) => {
|
|
848
851
|
if (!V) return;
|
|
849
852
|
t.preventDefault();
|
|
850
853
|
let n = R.find((e) => e.id === T);
|
|
@@ -854,7 +857,7 @@ function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, h
|
|
|
854
857
|
}) : L(n, e));
|
|
855
858
|
};
|
|
856
859
|
return /* @__PURE__ */ U("div", {
|
|
857
|
-
className:
|
|
860
|
+
className: q("space-y-3", m),
|
|
858
861
|
children: [
|
|
859
862
|
!i && /* @__PURE__ */ U("div", {
|
|
860
863
|
className: "flex items-baseline justify-between",
|
|
@@ -879,10 +882,10 @@ function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, h
|
|
|
879
882
|
children: t.map((e) => {
|
|
880
883
|
let t = B.filter((t) => t.status === e.status), n = D === e.status;
|
|
881
884
|
return /* @__PURE__ */ U("div", {
|
|
882
|
-
onDragOver:
|
|
885
|
+
onDragOver: ee(e.status),
|
|
883
886
|
onDragLeave: () => D === e.status && O(null),
|
|
884
|
-
onDrop:
|
|
885
|
-
className:
|
|
887
|
+
onDrop: W(e.status),
|
|
888
|
+
className: q("flex w-72 shrink-0 flex-col rounded-lg border transition-colors", n ? "border-primary/50 bg-primary/5" : "border-transparent bg-muted/40"),
|
|
886
889
|
children: [/* @__PURE__ */ U("div", {
|
|
887
890
|
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
888
891
|
children: [/* @__PURE__ */ U("span", {
|
|
@@ -957,12 +960,13 @@ function et({ projectId: e, columns: t = Ae, readonly: n, confirmMove: r = !0, h
|
|
|
957
960
|
}
|
|
958
961
|
var tt = "TASK", nt = "BACKLOG", rt = "NONE", X = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring", Z = "text-sm font-medium text-foreground";
|
|
959
962
|
function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues: r, hideHeader: i, submitLabel: a, onCreated: o, onError: s, onCancel: c, className: l, workspaceId: u }) {
|
|
960
|
-
let d =
|
|
963
|
+
let d = oe(), f = u ?? d?.workspaceId, p = e ?? r?.projectId, m = Y(), h = b(() => new Set(n ?? []), [n]), [g, _] = x(r?.title ?? ""), [v, y] = x(r?.description ?? ""), [S, C] = x(r?.type ?? tt), [w, T] = x(r?.status ?? nt), [E, D] = x(r?.priority ?? rt), [O, k] = x(r?.assigneeId ?? ""), [A, j] = x(r?.dueDate ?? ""), [M, N] = x((r?.labels ?? []).join(", ")), [P, F] = x(r?.storyPoints == null ? "" : String(r.storyPoints)), [I, { loading: L, error: R }] = ne(fe), z = !!(f && p && g.trim()), B = async (e) => {
|
|
961
964
|
if (e.preventDefault(), !z || !p) return;
|
|
962
|
-
let t = M.split(",").map((e) => e.trim()).filter(Boolean), n = P.trim() ? Number(P) : void 0,
|
|
965
|
+
let t = M.split(",").map((e) => e.trim()).filter(Boolean), n = P.trim() ? Number(P) : void 0, i = {
|
|
963
966
|
projectId: p,
|
|
964
967
|
title: g.trim(),
|
|
965
968
|
type: S,
|
|
969
|
+
...r?.parentId ? { parentId: r.parentId } : {},
|
|
966
970
|
...h.has("status") ? {} : { status: w },
|
|
967
971
|
...h.has("priority") ? {} : { priority: E },
|
|
968
972
|
...h.has("description") || !v.trim() ? {} : { description: v.trim() },
|
|
@@ -972,7 +976,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
972
976
|
...h.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
|
|
973
977
|
};
|
|
974
978
|
try {
|
|
975
|
-
let e = (await I({ variables: { input:
|
|
979
|
+
let e = (await I({ variables: { input: i } })).data?.planmagnetCreateWorkItem;
|
|
976
980
|
if (e) {
|
|
977
981
|
let t = ie();
|
|
978
982
|
try {
|
|
@@ -993,9 +997,9 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
993
997
|
function V() {
|
|
994
998
|
_(""), y(""), C(tt), T(nt), D(rt), k(""), j(""), N(""), F("");
|
|
995
999
|
}
|
|
996
|
-
return f ? /* @__PURE__ */ H(
|
|
997
|
-
className:
|
|
998
|
-
children: /* @__PURE__ */ H(
|
|
1000
|
+
return f ? /* @__PURE__ */ H(ee, {
|
|
1001
|
+
className: q("shadow-sm", l),
|
|
1002
|
+
children: /* @__PURE__ */ H(W, {
|
|
999
1003
|
className: "p-6",
|
|
1000
1004
|
children: /* @__PURE__ */ U("form", {
|
|
1001
1005
|
onSubmit: B,
|
|
@@ -1035,7 +1039,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1035
1039
|
children: m.description
|
|
1036
1040
|
}), /* @__PURE__ */ H("textarea", {
|
|
1037
1041
|
id: "pm-description",
|
|
1038
|
-
className:
|
|
1042
|
+
className: q(X, "min-h-[80px]"),
|
|
1039
1043
|
value: v,
|
|
1040
1044
|
onChange: (e) => y(e.target.value),
|
|
1041
1045
|
placeholder: m.descriptionPlaceholder
|
|
@@ -1052,7 +1056,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1052
1056
|
children: m.typeLabel
|
|
1053
1057
|
}), /* @__PURE__ */ H("select", {
|
|
1054
1058
|
id: "pm-type",
|
|
1055
|
-
className:
|
|
1059
|
+
className: q(X, "capitalize"),
|
|
1056
1060
|
value: S,
|
|
1057
1061
|
onChange: (e) => C(e.target.value),
|
|
1058
1062
|
children: Me.map((e) => /* @__PURE__ */ H("option", {
|
|
@@ -1069,7 +1073,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1069
1073
|
children: m.statusLabel
|
|
1070
1074
|
}), /* @__PURE__ */ H("select", {
|
|
1071
1075
|
id: "pm-status",
|
|
1072
|
-
className:
|
|
1076
|
+
className: q(X, "capitalize"),
|
|
1073
1077
|
value: w,
|
|
1074
1078
|
onChange: (e) => T(e.target.value),
|
|
1075
1079
|
children: Ne.map((e) => /* @__PURE__ */ H("option", {
|
|
@@ -1086,7 +1090,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1086
1090
|
children: m.priorityLabel
|
|
1087
1091
|
}), /* @__PURE__ */ H("select", {
|
|
1088
1092
|
id: "pm-priority",
|
|
1089
|
-
className:
|
|
1093
|
+
className: q(X, "capitalize"),
|
|
1090
1094
|
value: E,
|
|
1091
1095
|
onChange: (e) => D(e.target.value),
|
|
1092
1096
|
children: je.map((e) => /* @__PURE__ */ H("option", {
|
|
@@ -1185,7 +1189,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1185
1189
|
}), /* @__PURE__ */ H("button", {
|
|
1186
1190
|
type: "submit",
|
|
1187
1191
|
disabled: !z || L,
|
|
1188
|
-
className:
|
|
1192
|
+
className: q("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (!z || L) && "cursor-not-allowed opacity-50"),
|
|
1189
1193
|
children: L ? m.creating : a ?? m.create
|
|
1190
1194
|
})]
|
|
1191
1195
|
})
|
|
@@ -1193,7 +1197,7 @@ function it({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1193
1197
|
})
|
|
1194
1198
|
})
|
|
1195
1199
|
}) : /* @__PURE__ */ H("div", {
|
|
1196
|
-
className:
|
|
1200
|
+
className: q("p-6 text-sm text-destructive", l),
|
|
1197
1201
|
children: "CreateTask: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
1198
1202
|
});
|
|
1199
1203
|
}
|
|
@@ -1243,7 +1247,7 @@ var lt = {
|
|
|
1243
1247
|
storyPoints: "storyPoints"
|
|
1244
1248
|
};
|
|
1245
1249
|
function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, search: a, columns: o = at, sortBy: s, sortDir: c = "asc", hideHeader: l, onSelect: u, resolveAssignee: d, linkSourceProduct: f, renderLinkIcon: p, limit: m = 200, className: h, workspaceId: g }) {
|
|
1246
|
-
let _ =
|
|
1250
|
+
let _ = oe(), v = g ?? _?.workspaceId, { linksByItem: y } = $e(v, f), S = Y(), [C, T] = x({
|
|
1247
1251
|
by: s ?? null,
|
|
1248
1252
|
dir: c
|
|
1249
1253
|
}), E = b(() => {
|
|
@@ -1256,7 +1260,7 @@ function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1256
1260
|
r,
|
|
1257
1261
|
i,
|
|
1258
1262
|
a
|
|
1259
|
-
]), { data: O, loading: k, error: A } = K(
|
|
1263
|
+
]), { data: O, loading: k, error: A } = K(ue, {
|
|
1260
1264
|
variables: {
|
|
1261
1265
|
workspaceId: v,
|
|
1262
1266
|
...Object.keys(E).length ? { filter: E } : {},
|
|
@@ -1279,17 +1283,17 @@ function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1279
1283
|
});
|
|
1280
1284
|
};
|
|
1281
1285
|
return v ? k && !O ? /* @__PURE__ */ H("div", {
|
|
1282
|
-
className:
|
|
1286
|
+
className: q("flex items-center justify-center p-12", h),
|
|
1283
1287
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
1284
1288
|
}) : A && !O ? /* @__PURE__ */ U("div", {
|
|
1285
|
-
className:
|
|
1289
|
+
className: q("p-6 text-sm text-destructive", h),
|
|
1286
1290
|
children: [
|
|
1287
1291
|
S.errorLoading,
|
|
1288
1292
|
": ",
|
|
1289
1293
|
A.message
|
|
1290
1294
|
]
|
|
1291
1295
|
}) : /* @__PURE__ */ U("div", {
|
|
1292
|
-
className:
|
|
1296
|
+
className: q("space-y-3", h),
|
|
1293
1297
|
children: [!l && /* @__PURE__ */ U("div", {
|
|
1294
1298
|
className: "flex items-baseline justify-between",
|
|
1295
1299
|
children: [/* @__PURE__ */ H("h2", {
|
|
@@ -1313,7 +1317,7 @@ function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1313
1317
|
let t = !!lt[e], n = C.by === lt[e];
|
|
1314
1318
|
return /* @__PURE__ */ H("th", {
|
|
1315
1319
|
onClick: t ? () => M(e) : void 0,
|
|
1316
|
-
className:
|
|
1320
|
+
className: q("px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", t && "cursor-pointer select-none hover:text-foreground"),
|
|
1317
1321
|
children: /* @__PURE__ */ U("span", {
|
|
1318
1322
|
className: "inline-flex items-center gap-1",
|
|
1319
1323
|
children: [ct(e, S), n && (C.dir === "asc" ? /* @__PURE__ */ H(D, {
|
|
@@ -1332,7 +1336,7 @@ function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1332
1336
|
children: S.noTasksFound
|
|
1333
1337
|
}) }), j.map((e) => /* @__PURE__ */ H("tr", {
|
|
1334
1338
|
onClick: u ? () => u(e.id) : void 0,
|
|
1335
|
-
className:
|
|
1339
|
+
className: q("border-b border-border last:border-0", u && "cursor-pointer hover:bg-muted/40"),
|
|
1336
1340
|
children: o.map((t) => /* @__PURE__ */ H("td", {
|
|
1337
1341
|
className: "px-3 py-2 align-middle text-foreground",
|
|
1338
1342
|
children: dt(t, e, {
|
|
@@ -1346,7 +1350,7 @@ function ut({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1346
1350
|
})
|
|
1347
1351
|
})]
|
|
1348
1352
|
}) : /* @__PURE__ */ H("div", {
|
|
1349
|
-
className:
|
|
1353
|
+
className: q("p-6 text-sm text-destructive", h),
|
|
1350
1354
|
children: "TaskList: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
1351
1355
|
});
|
|
1352
1356
|
}
|
|
@@ -1390,7 +1394,7 @@ function dt(e, t, n) {
|
|
|
1390
1394
|
case "dueDate": {
|
|
1391
1395
|
let e = be(t.dueDate);
|
|
1392
1396
|
return e ? /* @__PURE__ */ H("span", {
|
|
1393
|
-
className:
|
|
1397
|
+
className: q("text-xs", Se(t.dueDate, t.status) ? "font-medium text-destructive" : "text-muted-foreground"),
|
|
1394
1398
|
children: e
|
|
1395
1399
|
}) : /* @__PURE__ */ H("span", {
|
|
1396
1400
|
className: "text-muted-foreground",
|
|
@@ -1439,7 +1443,7 @@ function ft(e, t, n) {
|
|
|
1439
1443
|
}
|
|
1440
1444
|
}
|
|
1441
1445
|
function pt(e, t = {}) {
|
|
1442
|
-
let { projectId: n, enabled: r = !0, limit: i = 100 } = t, { data: a, loading: o } = K(
|
|
1446
|
+
let { projectId: n, enabled: r = !0, limit: i = 100 } = t, { data: a, loading: o } = K(ge, {
|
|
1443
1447
|
variables: {
|
|
1444
1448
|
workspaceId: e,
|
|
1445
1449
|
...n ? { filter: { projectId: n } } : {},
|
|
@@ -1453,7 +1457,7 @@ function pt(e, t = {}) {
|
|
|
1453
1457
|
byDay: b(() => {
|
|
1454
1458
|
let e = /* @__PURE__ */ new Map();
|
|
1455
1459
|
for (let t of s) {
|
|
1456
|
-
let n =
|
|
1460
|
+
let n = J(t.dueDate);
|
|
1457
1461
|
if (!n) continue;
|
|
1458
1462
|
let r = `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}`, i = e.get(r);
|
|
1459
1463
|
i ? i.push(t) : e.set(r, [t]);
|
|
@@ -1468,10 +1472,10 @@ function ht(e) {
|
|
|
1468
1472
|
return d(e, "yyyy-MM-dd");
|
|
1469
1473
|
}
|
|
1470
1474
|
function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = "", assigneeId: m, defaultMode: h = "week", onSelect: g, resolveAssignee: _, showMilestones: v = !0, className: y, workspaceId: S }) {
|
|
1471
|
-
let C =
|
|
1475
|
+
let C = oe(), w = S ?? C?.workspaceId, D = Y(), { milestones: O, byDay: k } = pt(w, {
|
|
1472
1476
|
projectId: e,
|
|
1473
1477
|
enabled: v
|
|
1474
|
-
}), [A, j] = x(h), [M, N] = x(0), { data: F, loading: I, error: L } = K(
|
|
1478
|
+
}), [A, j] = x(h), [M, N] = x(0), { data: F, loading: I, error: L } = K(ue, {
|
|
1475
1479
|
variables: {
|
|
1476
1480
|
workspaceId: w,
|
|
1477
1481
|
...e ? { filter: { projectId: e } } : {},
|
|
@@ -1491,7 +1495,7 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1491
1495
|
i,
|
|
1492
1496
|
o,
|
|
1493
1497
|
m
|
|
1494
|
-
]), { anchor: z, rangeStart: B, rangeEnd: V, days:
|
|
1498
|
+
]), { anchor: z, rangeStart: B, rangeEnd: V, days: ee } = b(() => {
|
|
1495
1499
|
let e = /* @__PURE__ */ new Date();
|
|
1496
1500
|
if (A === "week") {
|
|
1497
1501
|
let t = a(e, M), n = r(t, mt), i = u(t, mt);
|
|
@@ -1515,10 +1519,10 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1515
1519
|
end: o
|
|
1516
1520
|
})
|
|
1517
1521
|
};
|
|
1518
|
-
}, [A, M]), { byDay:
|
|
1522
|
+
}, [A, M]), { byDay: W, overdue: G, undated: te } = b(() => {
|
|
1519
1523
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
1520
1524
|
for (let r of R) {
|
|
1521
|
-
let i =
|
|
1525
|
+
let i = J(r.dueDate);
|
|
1522
1526
|
if (!i) {
|
|
1523
1527
|
n.push(r);
|
|
1524
1528
|
continue;
|
|
@@ -1537,15 +1541,15 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1537
1541
|
};
|
|
1538
1542
|
}, [R]);
|
|
1539
1543
|
if (!w) return /* @__PURE__ */ H("div", {
|
|
1540
|
-
className:
|
|
1544
|
+
className: q("p-6 text-sm text-destructive", y),
|
|
1541
1545
|
children: "Timeline: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
1542
1546
|
});
|
|
1543
1547
|
if (I && !F) return /* @__PURE__ */ H("div", {
|
|
1544
|
-
className:
|
|
1548
|
+
className: q("flex items-center justify-center p-12", y),
|
|
1545
1549
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
1546
1550
|
});
|
|
1547
1551
|
if (L && !F) return /* @__PURE__ */ U("div", {
|
|
1548
|
-
className:
|
|
1552
|
+
className: q("p-6 text-sm text-destructive", y),
|
|
1549
1553
|
children: [
|
|
1550
1554
|
D.errorLoading,
|
|
1551
1555
|
": ",
|
|
@@ -1554,7 +1558,7 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1554
1558
|
});
|
|
1555
1559
|
let ne = A === "week" ? `${d(B, "MMM d")} \u2013 ${d(V, "MMM d")}` : d(z, "MMMM yyyy");
|
|
1556
1560
|
return /* @__PURE__ */ U("div", {
|
|
1557
|
-
className:
|
|
1561
|
+
className: q("space-y-3", y),
|
|
1558
1562
|
children: [
|
|
1559
1563
|
/* @__PURE__ */ U("div", {
|
|
1560
1564
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
@@ -1593,7 +1597,7 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1593
1597
|
onClick: () => {
|
|
1594
1598
|
j(e), N(0);
|
|
1595
1599
|
},
|
|
1596
|
-
className:
|
|
1600
|
+
className: q("rounded px-3 py-1 text-xs font-medium capitalize transition-colors", A === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
1597
1601
|
children: e === "week" ? D.week : D.month
|
|
1598
1602
|
}, e))
|
|
1599
1603
|
})]
|
|
@@ -1628,17 +1632,17 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1628
1632
|
}),
|
|
1629
1633
|
A === "week" ? /* @__PURE__ */ H("div", {
|
|
1630
1634
|
className: "grid grid-cols-7 gap-2",
|
|
1631
|
-
children:
|
|
1632
|
-
let t =
|
|
1635
|
+
children: ee.map((e) => {
|
|
1636
|
+
let t = W.get(ht(e)) ?? [], n = k.get(ht(e)) ?? [], r = p(e);
|
|
1633
1637
|
return /* @__PURE__ */ U("div", {
|
|
1634
|
-
className:
|
|
1638
|
+
className: q("flex min-h-32 flex-col rounded-lg border p-2", r ? "border-primary/50 bg-primary/5" : "border-border bg-muted/20"),
|
|
1635
1639
|
children: [/* @__PURE__ */ U("div", {
|
|
1636
1640
|
className: "mb-2 flex items-baseline justify-between",
|
|
1637
1641
|
children: [/* @__PURE__ */ H("span", {
|
|
1638
|
-
className:
|
|
1642
|
+
className: q("text-xs font-semibold uppercase", r ? "text-primary" : "text-muted-foreground"),
|
|
1639
1643
|
children: d(e, "EEE")
|
|
1640
1644
|
}), /* @__PURE__ */ H("span", {
|
|
1641
|
-
className:
|
|
1645
|
+
className: q("text-sm font-semibold", r ? "text-primary" : "text-foreground"),
|
|
1642
1646
|
children: d(e, "d")
|
|
1643
1647
|
})]
|
|
1644
1648
|
}), /* @__PURE__ */ U("div", {
|
|
@@ -1667,13 +1671,13 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1667
1671
|
].map((e) => /* @__PURE__ */ H("div", {
|
|
1668
1672
|
className: "px-1 pb-1 text-center text-[10px] font-semibold uppercase text-muted-foreground",
|
|
1669
1673
|
children: e
|
|
1670
|
-
}, e)),
|
|
1671
|
-
let t =
|
|
1674
|
+
}, e)), ee.map((e) => {
|
|
1675
|
+
let t = W.get(ht(e)) ?? [], n = p(e), r = f(e, z);
|
|
1672
1676
|
return /* @__PURE__ */ U("div", {
|
|
1673
|
-
className:
|
|
1677
|
+
className: q("flex min-h-20 flex-col gap-1 rounded-md border p-1", n ? "border-primary/50 bg-primary/5" : "border-border/60 bg-muted/10", !r && "opacity-40"),
|
|
1674
1678
|
children: [
|
|
1675
1679
|
/* @__PURE__ */ H("span", {
|
|
1676
|
-
className:
|
|
1680
|
+
className: q("text-[10px] font-semibold", n ? "text-primary" : "text-muted-foreground"),
|
|
1677
1681
|
children: d(e, "d")
|
|
1678
1682
|
}),
|
|
1679
1683
|
t.slice(0, 3).map((e) => /* @__PURE__ */ H(vt, {
|
|
@@ -1715,7 +1719,7 @@ function gt({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1715
1719
|
function _t({ milestone: e, compact: t }) {
|
|
1716
1720
|
let n = be(e.dueDate);
|
|
1717
1721
|
return /* @__PURE__ */ U("span", {
|
|
1718
|
-
className:
|
|
1722
|
+
className: q("inline-flex max-w-full items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-1.5 py-1 text-[11px] font-medium text-primary", t && "w-full"),
|
|
1719
1723
|
title: e.name + (n ? ` \xB7 ${n}` : ""),
|
|
1720
1724
|
children: [
|
|
1721
1725
|
/* @__PURE__ */ H(P, {
|
|
@@ -1740,7 +1744,7 @@ function vt({ task: e, onSelect: t, resolveAssignee: n, tone: r, compact: i }) {
|
|
|
1740
1744
|
disabled: !o,
|
|
1741
1745
|
onClick: o ? () => t?.(e.id) : void 0,
|
|
1742
1746
|
title: e.title,
|
|
1743
|
-
className:
|
|
1747
|
+
className: q("flex w-full items-center gap-1.5 rounded-md border px-1.5 py-1 text-left transition-colors", r === "destructive" ? "border-destructive/40 bg-card hover:bg-destructive/5" : "border-border bg-card hover:border-primary/50", o ? "cursor-pointer" : "cursor-default"),
|
|
1744
1748
|
children: [
|
|
1745
1749
|
/* @__PURE__ */ H(Ge, { priority: e.priority }),
|
|
1746
1750
|
/* @__PURE__ */ H("span", {
|
|
@@ -1771,7 +1775,7 @@ function xt({ view: e, onViewChange: t, views: n = [
|
|
|
1771
1775
|
timeline: m.timeline
|
|
1772
1776
|
};
|
|
1773
1777
|
return /* @__PURE__ */ U("div", {
|
|
1774
|
-
className:
|
|
1778
|
+
className: q("flex flex-wrap items-center justify-between gap-3 border-b border-border pb-2", p),
|
|
1775
1779
|
children: [/* @__PURE__ */ H("div", {
|
|
1776
1780
|
className: "flex items-center gap-1",
|
|
1777
1781
|
role: "tablist",
|
|
@@ -1783,7 +1787,7 @@ function xt({ view: e, onViewChange: t, views: n = [
|
|
|
1783
1787
|
role: "tab",
|
|
1784
1788
|
"aria-selected": i,
|
|
1785
1789
|
onClick: () => t(n),
|
|
1786
|
-
className:
|
|
1790
|
+
className: q("relative flex items-center gap-1.5 rounded-t-md px-2.5 py-1.5 text-sm font-medium transition-colors", i ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
|
|
1787
1791
|
children: [
|
|
1788
1792
|
/* @__PURE__ */ H(r, {
|
|
1789
1793
|
className: "h-4 w-4",
|
|
@@ -1815,7 +1819,7 @@ function xt({ view: e, onViewChange: t, views: n = [
|
|
|
1815
1819
|
type: "button",
|
|
1816
1820
|
onClick: () => f(!d),
|
|
1817
1821
|
"aria-pressed": d,
|
|
1818
|
-
className:
|
|
1822
|
+
className: q("flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors", d ? "border-primary bg-primary/10 text-primary" : "border-border bg-background text-muted-foreground hover:bg-muted/50 hover:text-foreground"),
|
|
1819
1823
|
children: [/* @__PURE__ */ H(V, {
|
|
1820
1824
|
className: "h-3.5 w-3.5",
|
|
1821
1825
|
"aria-hidden": "true"
|
|
@@ -1867,39 +1871,49 @@ var Q = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm t
|
|
|
1867
1871
|
HIGH: "accent",
|
|
1868
1872
|
CRITICAL: "destructive"
|
|
1869
1873
|
};
|
|
1870
|
-
function Ct({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, onDeleted: a, onError: o, resolveAssignee: s, assigneeOptions: c, linkSourceProduct: l, renderLinkIcon: u,
|
|
1871
|
-
let
|
|
1874
|
+
function Ct({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i, onDeleted: a, onError: o, resolveAssignee: s, assigneeOptions: c, linkSourceProduct: l, renderLinkIcon: u, onOpenItem: d, onAddSubtask: f, className: p }) {
|
|
1875
|
+
let m = te(), h = Y(), g = b(() => new Set(n ?? []), [n]), { data: _, loading: v, error: S } = K(de, {
|
|
1872
1876
|
variables: { id: e },
|
|
1873
1877
|
skip: !e
|
|
1874
|
-
}),
|
|
1878
|
+
}), C = _?.planmagnetWorkItem ?? null, { linksByItem: w } = $e(C?.workspaceId, l), T = C ? w.get(C.id) ?? [] : [], { data: E } = K(de, {
|
|
1879
|
+
variables: { id: C?.parentId },
|
|
1880
|
+
skip: !C?.parentId
|
|
1881
|
+
}), D = E?.planmagnetWorkItem ?? null, { data: O } = K(ue, {
|
|
1882
|
+
variables: {
|
|
1883
|
+
workspaceId: C?.workspaceId,
|
|
1884
|
+
filter: { parentId: C?.id },
|
|
1885
|
+
pagination: { first: 100 }
|
|
1886
|
+
},
|
|
1887
|
+
skip: !C?.id || !C?.workspaceId
|
|
1888
|
+
}), k = O?.planmagnetWorkItems?.items ?? [], [A, j] = x(!1), [M, N] = x(!1), [P, F] = x(""), [I, L] = x(""), [R, z] = x("TASK"), [V, G] = x("BACKLOG"), [re, ae] = x("NONE"), [oe, se] = x(""), [ce, le] = x(""), [fe, me] = x(""), [he, ge] = x("");
|
|
1875
1889
|
y(() => {
|
|
1876
|
-
|
|
1877
|
-
}, [
|
|
1878
|
-
let [
|
|
1879
|
-
if (
|
|
1880
|
-
await
|
|
1890
|
+
C && (F(C.title), L(C.description ?? ""), z(C.type), G(C.status), ae(C.priority), se(C.assigneeId ?? ""), le(C.dueDate ? String(C.dueDate).slice(0, 10) : ""), me((C.labels ?? []).join(", ")), ge(C.storyPoints == null ? "" : String(C.storyPoints)));
|
|
1891
|
+
}, [C]);
|
|
1892
|
+
let [ve, { loading: J, error: be }] = ne(pe), [Se, { loading: Ce, error: Te }] = ne(_e), Ee = async () => {
|
|
1893
|
+
if (C) try {
|
|
1894
|
+
await Se({ variables: { id: C.id } }), m.cache.evict({ id: m.cache.identify({
|
|
1881
1895
|
__typename: "WorkItem",
|
|
1882
|
-
id:
|
|
1883
|
-
}) }),
|
|
1896
|
+
id: C.id
|
|
1897
|
+
}) }), m.cache.gc(), m.refetchQueries({ include: [ue] }).catch(() => {}), a?.(C.id);
|
|
1884
1898
|
} catch (e) {
|
|
1885
1899
|
o?.(e instanceof Error ? e : Error(String(e)));
|
|
1886
1900
|
}
|
|
1887
|
-
},
|
|
1888
|
-
if (e.preventDefault(), !
|
|
1889
|
-
let t =
|
|
1890
|
-
title:
|
|
1891
|
-
...
|
|
1892
|
-
...
|
|
1893
|
-
...
|
|
1894
|
-
...
|
|
1895
|
-
...
|
|
1896
|
-
...
|
|
1897
|
-
...
|
|
1898
|
-
...
|
|
1901
|
+
}, De = async (e) => {
|
|
1902
|
+
if (e.preventDefault(), !C) return;
|
|
1903
|
+
let t = fe.split(",").map((e) => e.trim()).filter(Boolean), n = he.trim() ? Number(he) : void 0, r = {
|
|
1904
|
+
title: P.trim(),
|
|
1905
|
+
...g.has("description") ? {} : { description: I.trim() },
|
|
1906
|
+
...g.has("type") ? {} : { type: R },
|
|
1907
|
+
...g.has("status") ? {} : { status: V },
|
|
1908
|
+
...g.has("priority") ? {} : { priority: re },
|
|
1909
|
+
...g.has("assignee") ? {} : { assigneeId: oe.trim() },
|
|
1910
|
+
...g.has("dueDate") ? {} : { dueDate: ye(ce) },
|
|
1911
|
+
...g.has("labels") ? {} : { labels: t },
|
|
1912
|
+
...g.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
|
|
1899
1913
|
};
|
|
1900
1914
|
try {
|
|
1901
|
-
let e = (await
|
|
1902
|
-
id:
|
|
1915
|
+
let e = (await ve({ variables: {
|
|
1916
|
+
id: C.id,
|
|
1903
1917
|
input: r
|
|
1904
1918
|
} })).data?.planmagnetUpdateWorkItem;
|
|
1905
1919
|
if (e) {
|
|
@@ -1913,94 +1927,94 @@ function Ct({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
1913
1927
|
operation: "updated"
|
|
1914
1928
|
});
|
|
1915
1929
|
} catch {}
|
|
1916
|
-
i?.(e),
|
|
1930
|
+
i?.(e), j(!1);
|
|
1917
1931
|
}
|
|
1918
1932
|
} catch (e) {
|
|
1919
1933
|
o?.(e instanceof Error ? e : Error(String(e)));
|
|
1920
1934
|
}
|
|
1921
1935
|
};
|
|
1922
1936
|
if (!e) return /* @__PURE__ */ H("div", {
|
|
1923
|
-
className:
|
|
1937
|
+
className: q("p-6 text-sm text-destructive", p),
|
|
1924
1938
|
children: "TaskDetail: no work-item id provided."
|
|
1925
1939
|
});
|
|
1926
|
-
if (
|
|
1927
|
-
className:
|
|
1940
|
+
if (v && !_) return /* @__PURE__ */ H("div", {
|
|
1941
|
+
className: q("flex items-center justify-center p-12", p),
|
|
1928
1942
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
1929
1943
|
});
|
|
1930
|
-
if (
|
|
1931
|
-
className:
|
|
1944
|
+
if (S && !_) return /* @__PURE__ */ U("div", {
|
|
1945
|
+
className: q("p-6 text-sm text-destructive", p),
|
|
1932
1946
|
children: [
|
|
1933
|
-
|
|
1947
|
+
h.errorLoading,
|
|
1934
1948
|
": ",
|
|
1935
|
-
|
|
1949
|
+
S.message
|
|
1936
1950
|
]
|
|
1937
1951
|
});
|
|
1938
|
-
if (!
|
|
1939
|
-
className:
|
|
1940
|
-
children:
|
|
1952
|
+
if (!C) return /* @__PURE__ */ H("div", {
|
|
1953
|
+
className: q("p-6 text-sm text-muted-foreground", p),
|
|
1954
|
+
children: h.taskNotFound
|
|
1941
1955
|
});
|
|
1942
|
-
let
|
|
1943
|
-
return /* @__PURE__ */ H(
|
|
1944
|
-
className:
|
|
1945
|
-
children: /* @__PURE__ */ U(
|
|
1956
|
+
let Oe = !t;
|
|
1957
|
+
return /* @__PURE__ */ H(ee, {
|
|
1958
|
+
className: q("shadow-sm", p),
|
|
1959
|
+
children: /* @__PURE__ */ U(W, {
|
|
1946
1960
|
className: "space-y-4 p-6",
|
|
1947
1961
|
children: [
|
|
1948
1962
|
!r && /* @__PURE__ */ U("div", {
|
|
1949
1963
|
className: "flex items-start justify-between gap-4",
|
|
1950
1964
|
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
1951
1965
|
className: "text-xs text-muted-foreground",
|
|
1952
|
-
children:
|
|
1966
|
+
children: C.key
|
|
1953
1967
|
}), /* @__PURE__ */ H("h2", {
|
|
1954
1968
|
className: "text-xl font-semibold text-foreground",
|
|
1955
|
-
children:
|
|
1956
|
-
})] }),
|
|
1969
|
+
children: C.title
|
|
1970
|
+
})] }), Oe && !A && /* @__PURE__ */ U("div", {
|
|
1957
1971
|
className: "flex shrink-0 items-center gap-2",
|
|
1958
|
-
children: [a && (
|
|
1972
|
+
children: [a && (M ? /* @__PURE__ */ U("span", {
|
|
1959
1973
|
className: "flex items-center gap-1 text-xs",
|
|
1960
1974
|
children: [
|
|
1961
1975
|
/* @__PURE__ */ H("span", {
|
|
1962
1976
|
className: "text-muted-foreground",
|
|
1963
|
-
children:
|
|
1977
|
+
children: h.deletePrompt
|
|
1964
1978
|
}),
|
|
1965
1979
|
/* @__PURE__ */ H("button", {
|
|
1966
1980
|
type: "button",
|
|
1967
|
-
disabled:
|
|
1968
|
-
onClick:
|
|
1981
|
+
disabled: Ce,
|
|
1982
|
+
onClick: Ee,
|
|
1969
1983
|
className: "rounded bg-destructive px-2 py-1 font-medium text-destructive-foreground disabled:opacity-50",
|
|
1970
|
-
children:
|
|
1984
|
+
children: Ce ? "…" : h.yes
|
|
1971
1985
|
}),
|
|
1972
1986
|
/* @__PURE__ */ H("button", {
|
|
1973
1987
|
type: "button",
|
|
1974
|
-
onClick: () =>
|
|
1988
|
+
onClick: () => N(!1),
|
|
1975
1989
|
className: "rounded bg-muted px-2 py-1 text-muted-foreground",
|
|
1976
|
-
children:
|
|
1990
|
+
children: h.no
|
|
1977
1991
|
})
|
|
1978
1992
|
]
|
|
1979
1993
|
}) : /* @__PURE__ */ H("button", {
|
|
1980
1994
|
type: "button",
|
|
1981
|
-
onClick: () =>
|
|
1982
|
-
title:
|
|
1983
|
-
"aria-label":
|
|
1995
|
+
onClick: () => N(!0),
|
|
1996
|
+
title: h.del,
|
|
1997
|
+
"aria-label": h.del,
|
|
1984
1998
|
className: "rounded-md p-1.5 text-destructive hover:bg-destructive/10",
|
|
1985
1999
|
children: /* @__PURE__ */ H(B, { className: "h-4 w-4" })
|
|
1986
2000
|
})), /* @__PURE__ */ H("button", {
|
|
1987
2001
|
type: "button",
|
|
1988
|
-
onClick: () =>
|
|
2002
|
+
onClick: () => j(!0),
|
|
1989
2003
|
className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground",
|
|
1990
|
-
children:
|
|
2004
|
+
children: h.edit
|
|
1991
2005
|
})]
|
|
1992
2006
|
})]
|
|
1993
2007
|
}),
|
|
1994
|
-
|
|
2008
|
+
Te && /* @__PURE__ */ U("p", {
|
|
1995
2009
|
className: "text-sm text-destructive",
|
|
1996
2010
|
children: [
|
|
1997
|
-
|
|
2011
|
+
h.failedToDelete,
|
|
1998
2012
|
": ",
|
|
1999
|
-
|
|
2013
|
+
Te.message
|
|
2000
2014
|
]
|
|
2001
2015
|
}),
|
|
2002
|
-
|
|
2003
|
-
onSubmit:
|
|
2016
|
+
A ? /* @__PURE__ */ U("form", {
|
|
2017
|
+
onSubmit: De,
|
|
2004
2018
|
className: "space-y-4",
|
|
2005
2019
|
children: [
|
|
2006
2020
|
/* @__PURE__ */ U("div", {
|
|
@@ -2008,96 +2022,96 @@ function Ct({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
2008
2022
|
children: [/* @__PURE__ */ H("label", {
|
|
2009
2023
|
htmlFor: "pm-detail-title",
|
|
2010
2024
|
className: $,
|
|
2011
|
-
children:
|
|
2025
|
+
children: h.title
|
|
2012
2026
|
}), /* @__PURE__ */ H("input", {
|
|
2013
2027
|
id: "pm-detail-title",
|
|
2014
2028
|
className: Q,
|
|
2015
|
-
value:
|
|
2016
|
-
onChange: (e) =>
|
|
2029
|
+
value: P,
|
|
2030
|
+
onChange: (e) => F(e.target.value),
|
|
2017
2031
|
required: !0
|
|
2018
2032
|
})]
|
|
2019
2033
|
}),
|
|
2020
|
-
!
|
|
2034
|
+
!g.has("description") && /* @__PURE__ */ U("div", {
|
|
2021
2035
|
className: "space-y-1",
|
|
2022
2036
|
children: [/* @__PURE__ */ H("label", {
|
|
2023
2037
|
htmlFor: "pm-detail-desc",
|
|
2024
2038
|
className: $,
|
|
2025
|
-
children:
|
|
2039
|
+
children: h.description
|
|
2026
2040
|
}), /* @__PURE__ */ H("textarea", {
|
|
2027
2041
|
id: "pm-detail-desc",
|
|
2028
|
-
className:
|
|
2029
|
-
value:
|
|
2030
|
-
onChange: (e) =>
|
|
2042
|
+
className: q(Q, "min-h-[80px]"),
|
|
2043
|
+
value: I,
|
|
2044
|
+
onChange: (e) => L(e.target.value)
|
|
2031
2045
|
})]
|
|
2032
2046
|
}),
|
|
2033
2047
|
/* @__PURE__ */ U("div", {
|
|
2034
2048
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
2035
2049
|
children: [
|
|
2036
|
-
!
|
|
2050
|
+
!g.has("type") && /* @__PURE__ */ U("div", {
|
|
2037
2051
|
className: "space-y-1",
|
|
2038
2052
|
children: [/* @__PURE__ */ H("label", {
|
|
2039
2053
|
htmlFor: "pm-detail-type",
|
|
2040
2054
|
className: $,
|
|
2041
|
-
children:
|
|
2055
|
+
children: h.typeLabel
|
|
2042
2056
|
}), /* @__PURE__ */ H("select", {
|
|
2043
2057
|
id: "pm-detail-type",
|
|
2044
|
-
className:
|
|
2045
|
-
value:
|
|
2046
|
-
onChange: (e) =>
|
|
2058
|
+
className: q(Q, "capitalize"),
|
|
2059
|
+
value: R,
|
|
2060
|
+
onChange: (e) => z(e.target.value),
|
|
2047
2061
|
children: Me.map((e) => /* @__PURE__ */ H("option", {
|
|
2048
2062
|
value: e,
|
|
2049
|
-
children:
|
|
2063
|
+
children: h.type[e]
|
|
2050
2064
|
}, e))
|
|
2051
2065
|
})]
|
|
2052
2066
|
}),
|
|
2053
|
-
!
|
|
2067
|
+
!g.has("status") && /* @__PURE__ */ U("div", {
|
|
2054
2068
|
className: "space-y-1",
|
|
2055
2069
|
children: [/* @__PURE__ */ H("label", {
|
|
2056
2070
|
htmlFor: "pm-detail-status",
|
|
2057
2071
|
className: $,
|
|
2058
|
-
children:
|
|
2072
|
+
children: h.statusLabel
|
|
2059
2073
|
}), /* @__PURE__ */ H("select", {
|
|
2060
2074
|
id: "pm-detail-status",
|
|
2061
|
-
className:
|
|
2062
|
-
value:
|
|
2063
|
-
onChange: (e) =>
|
|
2075
|
+
className: q(Q, "capitalize"),
|
|
2076
|
+
value: V,
|
|
2077
|
+
onChange: (e) => G(e.target.value),
|
|
2064
2078
|
children: Ne.map((e) => /* @__PURE__ */ H("option", {
|
|
2065
2079
|
value: e,
|
|
2066
|
-
children:
|
|
2080
|
+
children: h.status[e]
|
|
2067
2081
|
}, e))
|
|
2068
2082
|
})]
|
|
2069
2083
|
}),
|
|
2070
|
-
!
|
|
2084
|
+
!g.has("priority") && /* @__PURE__ */ U("div", {
|
|
2071
2085
|
className: "space-y-1",
|
|
2072
2086
|
children: [/* @__PURE__ */ H("label", {
|
|
2073
2087
|
htmlFor: "pm-detail-priority",
|
|
2074
2088
|
className: $,
|
|
2075
|
-
children:
|
|
2089
|
+
children: h.priorityLabel
|
|
2076
2090
|
}), /* @__PURE__ */ H("select", {
|
|
2077
2091
|
id: "pm-detail-priority",
|
|
2078
|
-
className:
|
|
2079
|
-
value:
|
|
2080
|
-
onChange: (e) =>
|
|
2092
|
+
className: q(Q, "capitalize"),
|
|
2093
|
+
value: re,
|
|
2094
|
+
onChange: (e) => ae(e.target.value),
|
|
2081
2095
|
children: je.map((e) => /* @__PURE__ */ H("option", {
|
|
2082
2096
|
value: e,
|
|
2083
|
-
children:
|
|
2097
|
+
children: h.priority[e]
|
|
2084
2098
|
}, e))
|
|
2085
2099
|
})]
|
|
2086
2100
|
}),
|
|
2087
|
-
!
|
|
2101
|
+
!g.has("assignee") && /* @__PURE__ */ U("div", {
|
|
2088
2102
|
className: "space-y-1",
|
|
2089
2103
|
children: [/* @__PURE__ */ H("label", {
|
|
2090
2104
|
htmlFor: "pm-detail-assignee",
|
|
2091
2105
|
className: $,
|
|
2092
|
-
children:
|
|
2106
|
+
children: h.assigneeLabel
|
|
2093
2107
|
}), c && c.length > 0 ? /* @__PURE__ */ U("select", {
|
|
2094
2108
|
id: "pm-detail-assignee",
|
|
2095
2109
|
className: Q,
|
|
2096
|
-
value:
|
|
2097
|
-
onChange: (e) =>
|
|
2110
|
+
value: oe,
|
|
2111
|
+
onChange: (e) => se(e.target.value),
|
|
2098
2112
|
children: [/* @__PURE__ */ H("option", {
|
|
2099
2113
|
value: "",
|
|
2100
|
-
children:
|
|
2114
|
+
children: h.unassigned
|
|
2101
2115
|
}), c.map((e) => /* @__PURE__ */ H("option", {
|
|
2102
2116
|
value: e.id,
|
|
2103
2117
|
children: e.name
|
|
@@ -2105,183 +2119,247 @@ function Ct({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
2105
2119
|
}) : /* @__PURE__ */ H("input", {
|
|
2106
2120
|
id: "pm-detail-assignee",
|
|
2107
2121
|
className: Q,
|
|
2108
|
-
value:
|
|
2109
|
-
onChange: (e) =>
|
|
2110
|
-
placeholder:
|
|
2122
|
+
value: oe,
|
|
2123
|
+
onChange: (e) => se(e.target.value),
|
|
2124
|
+
placeholder: h.assigneePlaceholder
|
|
2111
2125
|
})]
|
|
2112
2126
|
}),
|
|
2113
|
-
!
|
|
2127
|
+
!g.has("dueDate") && /* @__PURE__ */ U("div", {
|
|
2114
2128
|
className: "space-y-1",
|
|
2115
2129
|
children: [/* @__PURE__ */ H("label", {
|
|
2116
2130
|
htmlFor: "pm-detail-due",
|
|
2117
2131
|
className: $,
|
|
2118
|
-
children:
|
|
2132
|
+
children: h.dueDateLabel
|
|
2119
2133
|
}), /* @__PURE__ */ H("input", {
|
|
2120
2134
|
id: "pm-detail-due",
|
|
2121
2135
|
type: "date",
|
|
2122
2136
|
className: Q,
|
|
2123
|
-
value:
|
|
2124
|
-
onChange: (e) =>
|
|
2137
|
+
value: ce,
|
|
2138
|
+
onChange: (e) => le(e.target.value)
|
|
2125
2139
|
})]
|
|
2126
2140
|
}),
|
|
2127
|
-
!
|
|
2141
|
+
!g.has("storyPoints") && /* @__PURE__ */ U("div", {
|
|
2128
2142
|
className: "space-y-1",
|
|
2129
2143
|
children: [/* @__PURE__ */ H("label", {
|
|
2130
2144
|
htmlFor: "pm-detail-points",
|
|
2131
2145
|
className: $,
|
|
2132
|
-
children:
|
|
2146
|
+
children: h.storyPointsLabel
|
|
2133
2147
|
}), /* @__PURE__ */ H("input", {
|
|
2134
2148
|
id: "pm-detail-points",
|
|
2135
2149
|
type: "number",
|
|
2136
2150
|
min: 0,
|
|
2137
2151
|
className: Q,
|
|
2138
|
-
value:
|
|
2139
|
-
onChange: (e) =>
|
|
2152
|
+
value: he,
|
|
2153
|
+
onChange: (e) => ge(e.target.value)
|
|
2140
2154
|
})]
|
|
2141
2155
|
})
|
|
2142
2156
|
]
|
|
2143
2157
|
}),
|
|
2144
|
-
!
|
|
2158
|
+
!g.has("labels") && /* @__PURE__ */ U("div", {
|
|
2145
2159
|
className: "space-y-1",
|
|
2146
2160
|
children: [/* @__PURE__ */ H("label", {
|
|
2147
2161
|
htmlFor: "pm-detail-labels",
|
|
2148
2162
|
className: $,
|
|
2149
|
-
children:
|
|
2163
|
+
children: h.labelsLabel
|
|
2150
2164
|
}), /* @__PURE__ */ H("input", {
|
|
2151
2165
|
id: "pm-detail-labels",
|
|
2152
2166
|
className: Q,
|
|
2153
|
-
value:
|
|
2154
|
-
onChange: (e) =>
|
|
2155
|
-
placeholder:
|
|
2167
|
+
value: fe,
|
|
2168
|
+
onChange: (e) => me(e.target.value),
|
|
2169
|
+
placeholder: h.labelsPlaceholder
|
|
2156
2170
|
})]
|
|
2157
2171
|
}),
|
|
2158
|
-
|
|
2172
|
+
be && /* @__PURE__ */ U("p", {
|
|
2159
2173
|
className: "text-sm text-destructive",
|
|
2160
2174
|
children: [
|
|
2161
|
-
|
|
2175
|
+
h.failedToSave,
|
|
2162
2176
|
": ",
|
|
2163
|
-
|
|
2177
|
+
be.message
|
|
2164
2178
|
]
|
|
2165
2179
|
}),
|
|
2166
2180
|
/* @__PURE__ */ U("div", {
|
|
2167
2181
|
className: "flex items-center justify-end gap-2",
|
|
2168
2182
|
children: [/* @__PURE__ */ H("button", {
|
|
2169
2183
|
type: "button",
|
|
2170
|
-
onClick: () =>
|
|
2184
|
+
onClick: () => j(!1),
|
|
2171
2185
|
className: "rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70",
|
|
2172
|
-
children:
|
|
2186
|
+
children: h.cancel
|
|
2173
2187
|
}), /* @__PURE__ */ H("button", {
|
|
2174
2188
|
type: "submit",
|
|
2175
|
-
disabled:
|
|
2176
|
-
className:
|
|
2177
|
-
children:
|
|
2189
|
+
disabled: J || !P.trim(),
|
|
2190
|
+
className: q("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (J || !P.trim()) && "cursor-not-allowed opacity-50"),
|
|
2191
|
+
children: J ? h.saving : h.save
|
|
2178
2192
|
})]
|
|
2179
2193
|
})
|
|
2180
2194
|
]
|
|
2181
2195
|
}) : /* @__PURE__ */ U("dl", {
|
|
2182
2196
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
2183
2197
|
children: [
|
|
2184
|
-
!
|
|
2185
|
-
label:
|
|
2198
|
+
!g.has("type") && /* @__PURE__ */ H(wt, {
|
|
2199
|
+
label: h.typeLabel,
|
|
2186
2200
|
children: /* @__PURE__ */ H(we, {
|
|
2187
2201
|
variant: "secondary",
|
|
2188
|
-
children:
|
|
2202
|
+
children: h.type[C.type]
|
|
2189
2203
|
})
|
|
2190
2204
|
}),
|
|
2191
|
-
!
|
|
2192
|
-
label:
|
|
2205
|
+
!g.has("status") && /* @__PURE__ */ H(wt, {
|
|
2206
|
+
label: h.statusLabel,
|
|
2193
2207
|
children: /* @__PURE__ */ H("span", {
|
|
2194
2208
|
className: "capitalize text-foreground",
|
|
2195
|
-
children:
|
|
2209
|
+
children: h.status[C.status]
|
|
2196
2210
|
})
|
|
2197
2211
|
}),
|
|
2198
|
-
!
|
|
2199
|
-
label:
|
|
2212
|
+
!g.has("priority") && /* @__PURE__ */ H(wt, {
|
|
2213
|
+
label: h.priorityLabel,
|
|
2200
2214
|
children: /* @__PURE__ */ H(we, {
|
|
2201
|
-
variant: St[
|
|
2202
|
-
children:
|
|
2215
|
+
variant: St[C.priority],
|
|
2216
|
+
children: h.priority[C.priority]
|
|
2203
2217
|
})
|
|
2204
2218
|
}),
|
|
2205
|
-
!
|
|
2206
|
-
label:
|
|
2207
|
-
children:
|
|
2219
|
+
!g.has("assignee") && /* @__PURE__ */ H(wt, {
|
|
2220
|
+
label: h.assigneeLabel,
|
|
2221
|
+
children: C.assigneeId ? /* @__PURE__ */ U("span", {
|
|
2208
2222
|
className: "flex items-center gap-1.5",
|
|
2209
2223
|
children: [/* @__PURE__ */ H(ke, {
|
|
2210
|
-
id:
|
|
2211
|
-
name: s?.(
|
|
2224
|
+
id: C.assigneeId,
|
|
2225
|
+
name: s?.(C.assigneeId)?.name,
|
|
2212
2226
|
size: "sm"
|
|
2213
2227
|
}), /* @__PURE__ */ H("span", {
|
|
2214
2228
|
className: "text-foreground",
|
|
2215
|
-
children: s?.(
|
|
2229
|
+
children: s?.(C.assigneeId)?.name ?? h.assigned
|
|
2216
2230
|
})]
|
|
2217
2231
|
}) : /* @__PURE__ */ H("span", {
|
|
2218
2232
|
className: "text-muted-foreground",
|
|
2219
|
-
children:
|
|
2233
|
+
children: h.unassigned
|
|
2220
2234
|
})
|
|
2221
2235
|
}),
|
|
2222
|
-
!
|
|
2223
|
-
label:
|
|
2236
|
+
!g.has("dueDate") && /* @__PURE__ */ H(wt, {
|
|
2237
|
+
label: h.dueDateLabel,
|
|
2224
2238
|
children: /* @__PURE__ */ H("span", {
|
|
2225
2239
|
className: "text-foreground",
|
|
2226
|
-
children: xe(
|
|
2240
|
+
children: xe(C.dueDate) ?? "—"
|
|
2227
2241
|
})
|
|
2228
2242
|
}),
|
|
2229
|
-
!
|
|
2230
|
-
label:
|
|
2243
|
+
!g.has("storyPoints") && /* @__PURE__ */ H(wt, {
|
|
2244
|
+
label: h.storyPointsLabel,
|
|
2231
2245
|
children: /* @__PURE__ */ H("span", {
|
|
2232
2246
|
className: "text-foreground",
|
|
2233
|
-
children:
|
|
2247
|
+
children: C.storyPoints ?? 0
|
|
2234
2248
|
})
|
|
2235
2249
|
}),
|
|
2236
|
-
!
|
|
2250
|
+
!g.has("description") && /* @__PURE__ */ U("div", {
|
|
2237
2251
|
className: "sm:col-span-2",
|
|
2238
2252
|
children: [/* @__PURE__ */ H("dt", {
|
|
2239
2253
|
className: $,
|
|
2240
|
-
children:
|
|
2254
|
+
children: h.description
|
|
2241
2255
|
}), /* @__PURE__ */ H("dd", {
|
|
2242
2256
|
className: "mt-1 whitespace-pre-wrap text-sm text-foreground",
|
|
2243
|
-
children:
|
|
2257
|
+
children: C.description || "—"
|
|
2244
2258
|
})]
|
|
2245
2259
|
}),
|
|
2246
|
-
!
|
|
2260
|
+
!g.has("labels") && /* @__PURE__ */ U("div", {
|
|
2247
2261
|
className: "sm:col-span-2",
|
|
2248
2262
|
children: [/* @__PURE__ */ H("dt", {
|
|
2249
2263
|
className: $,
|
|
2250
|
-
children:
|
|
2264
|
+
children: h.labelsLabel
|
|
2251
2265
|
}), /* @__PURE__ */ H("dd", {
|
|
2252
2266
|
className: "mt-1 flex flex-wrap gap-1",
|
|
2253
|
-
children: (
|
|
2267
|
+
children: (C.labels ?? []).length === 0 ? /* @__PURE__ */ H("span", {
|
|
2254
2268
|
className: "text-sm text-muted-foreground",
|
|
2255
2269
|
children: "—"
|
|
2256
|
-
}) :
|
|
2270
|
+
}) : C.labels.map((e) => /* @__PURE__ */ H("span", {
|
|
2257
2271
|
className: "rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",
|
|
2258
2272
|
children: e
|
|
2259
2273
|
}, e))
|
|
2260
2274
|
})]
|
|
2261
2275
|
}),
|
|
2262
|
-
|
|
2276
|
+
T.length > 0 && /* @__PURE__ */ U("div", {
|
|
2263
2277
|
className: "sm:col-span-2",
|
|
2264
2278
|
children: [/* @__PURE__ */ H("dt", {
|
|
2265
2279
|
className: $,
|
|
2266
|
-
children:
|
|
2280
|
+
children: h.linkedRecordsLabel
|
|
2267
2281
|
}), /* @__PURE__ */ H("dd", {
|
|
2268
2282
|
className: "mt-1 flex flex-wrap gap-1.5",
|
|
2269
|
-
children:
|
|
2283
|
+
children: T.map((e) => /* @__PURE__ */ H(Fe, {
|
|
2270
2284
|
link: e,
|
|
2271
2285
|
renderIcon: u
|
|
2272
2286
|
}, e.id))
|
|
2273
2287
|
})]
|
|
2274
2288
|
}),
|
|
2275
|
-
|
|
2289
|
+
D && /* @__PURE__ */ U("div", {
|
|
2290
|
+
className: "sm:col-span-2",
|
|
2291
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
2292
|
+
className: $,
|
|
2293
|
+
children: h.parentLabel
|
|
2294
|
+
}), /* @__PURE__ */ H("dd", {
|
|
2295
|
+
className: "mt-1",
|
|
2296
|
+
children: /* @__PURE__ */ U("button", {
|
|
2297
|
+
type: "button",
|
|
2298
|
+
onClick: () => d?.(D.id),
|
|
2299
|
+
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-1 text-sm text-foreground hover:bg-muted",
|
|
2300
|
+
children: [
|
|
2301
|
+
/* @__PURE__ */ H(Ve, { status: D.status }),
|
|
2302
|
+
/* @__PURE__ */ H("span", {
|
|
2303
|
+
className: "text-xs text-muted-foreground",
|
|
2304
|
+
children: D.key
|
|
2305
|
+
}),
|
|
2306
|
+
/* @__PURE__ */ H("span", {
|
|
2307
|
+
className: "truncate",
|
|
2308
|
+
children: D.title
|
|
2309
|
+
})
|
|
2310
|
+
]
|
|
2311
|
+
})
|
|
2312
|
+
})]
|
|
2313
|
+
}),
|
|
2314
|
+
(k.length > 0 || f && Oe) && /* @__PURE__ */ U("div", {
|
|
2315
|
+
className: "sm:col-span-2",
|
|
2316
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2317
|
+
className: "flex items-center justify-between",
|
|
2318
|
+
children: [/* @__PURE__ */ U("dt", {
|
|
2319
|
+
className: $,
|
|
2320
|
+
children: [h.subtasksLabel, k.length > 0 ? ` (${k.length})` : ""]
|
|
2321
|
+
}), f && Oe && /* @__PURE__ */ U("button", {
|
|
2322
|
+
type: "button",
|
|
2323
|
+
onClick: () => f({
|
|
2324
|
+
id: C.id,
|
|
2325
|
+
projectId: C.projectId
|
|
2326
|
+
}),
|
|
2327
|
+
className: "text-xs font-medium text-primary hover:underline",
|
|
2328
|
+
children: ["+ ", h.addSubtask]
|
|
2329
|
+
})]
|
|
2330
|
+
}), /* @__PURE__ */ H("dd", {
|
|
2331
|
+
className: "mt-1 space-y-1",
|
|
2332
|
+
children: k.length === 0 ? /* @__PURE__ */ H("span", {
|
|
2333
|
+
className: "text-sm text-muted-foreground",
|
|
2334
|
+
children: "—"
|
|
2335
|
+
}) : k.map((e) => /* @__PURE__ */ U("button", {
|
|
2336
|
+
type: "button",
|
|
2337
|
+
onClick: () => d?.(e.id),
|
|
2338
|
+
className: "flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm hover:bg-muted",
|
|
2339
|
+
children: [
|
|
2340
|
+
/* @__PURE__ */ H(Ve, { status: e.status }),
|
|
2341
|
+
/* @__PURE__ */ H("span", {
|
|
2342
|
+
className: "text-xs text-muted-foreground",
|
|
2343
|
+
children: e.key
|
|
2344
|
+
}),
|
|
2345
|
+
/* @__PURE__ */ H("span", {
|
|
2346
|
+
className: "flex-1 truncate text-foreground",
|
|
2347
|
+
children: e.title
|
|
2348
|
+
})
|
|
2349
|
+
]
|
|
2350
|
+
}, e.id))
|
|
2351
|
+
})]
|
|
2352
|
+
}),
|
|
2353
|
+
(C.createdAt || C.updatedAt) && /* @__PURE__ */ U("div", {
|
|
2276
2354
|
className: "flex flex-wrap gap-x-6 gap-y-1 border-t border-border pt-3 text-xs text-muted-foreground sm:col-span-2",
|
|
2277
|
-
children: [
|
|
2278
|
-
|
|
2355
|
+
children: [C.createdAt && /* @__PURE__ */ U("span", { children: [
|
|
2356
|
+
h.createdLabel,
|
|
2279
2357
|
" ",
|
|
2280
|
-
xe(
|
|
2281
|
-
] }),
|
|
2282
|
-
|
|
2358
|
+
xe(C.createdAt)
|
|
2359
|
+
] }), C.updatedAt && /* @__PURE__ */ U("span", { children: [
|
|
2360
|
+
h.updatedLabel,
|
|
2283
2361
|
" ",
|
|
2284
|
-
xe(
|
|
2362
|
+
xe(C.updatedAt)
|
|
2285
2363
|
] })]
|
|
2286
2364
|
})
|
|
2287
2365
|
]
|
|
@@ -2300,39 +2378,50 @@ function wt({ label: e, children: t }) {
|
|
|
2300
2378
|
})] });
|
|
2301
2379
|
}
|
|
2302
2380
|
function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, readonly: i, hiddenFields: a, views: o, defaultView: s = "board", confirmMove: c, resolveAssignee: l, linkSourceProduct: u, renderLinkIcon: d, assigneeOptions: f, currentActorId: p, labels: m, openItemId: h, header: g, onTaskSaved: v, createSurface: b = "modal", detailSurface: S = "drawer", className: C }) {
|
|
2303
|
-
let w =
|
|
2381
|
+
let w = oe(), T = e ?? w?.workspaceId, E = te(), D = ze(m), [O, k] = x(s), [A, j] = x(""), [M, N] = x("ALL"), [P, F] = x("ALL"), [I, L] = x(!1), [R, z] = x(!1), [B, V] = x(null), [ee, W] = x(null);
|
|
2304
2382
|
y(() => {
|
|
2305
2383
|
h && V(h);
|
|
2306
2384
|
}, [h]);
|
|
2307
|
-
let
|
|
2308
|
-
E.refetchQueries({ include: [
|
|
2309
|
-
}, [E]),
|
|
2310
|
-
|
|
2385
|
+
let G = _(() => {
|
|
2386
|
+
E.refetchQueries({ include: [ue] }).catch(() => {});
|
|
2387
|
+
}, [E]), ne = _((e) => {
|
|
2388
|
+
G(), z(!1), W(null), v?.({
|
|
2311
2389
|
workItem: e,
|
|
2312
2390
|
operation: "created"
|
|
2313
2391
|
});
|
|
2314
|
-
}, [
|
|
2315
|
-
|
|
2392
|
+
}, [G, v]), K = _((e) => {
|
|
2393
|
+
V(null), W({
|
|
2394
|
+
parentId: e.id,
|
|
2395
|
+
projectId: e.projectId,
|
|
2396
|
+
type: "SUB_TASK"
|
|
2397
|
+
}), z(!0);
|
|
2398
|
+
}, []), re = _(() => {
|
|
2399
|
+
W(null), z(!0);
|
|
2400
|
+
}, []), ie = _(() => {
|
|
2401
|
+
z(!1), W(null);
|
|
2402
|
+
}, []), ae = _((e) => {
|
|
2403
|
+
G(), v?.({
|
|
2316
2404
|
workItem: e,
|
|
2317
2405
|
operation: "updated"
|
|
2318
2406
|
});
|
|
2319
|
-
}, [
|
|
2407
|
+
}, [G, v]), se = _(() => {
|
|
2320
2408
|
V(null);
|
|
2321
|
-
}, []),
|
|
2409
|
+
}, []), ce = _((e) => {
|
|
2322
2410
|
V(e.id);
|
|
2323
|
-
}, []),
|
|
2411
|
+
}, []), le = _((e) => V(e), []);
|
|
2324
2412
|
if (!T) return /* @__PURE__ */ H("div", {
|
|
2325
|
-
className:
|
|
2413
|
+
className: q("p-6 text-sm text-destructive", C),
|
|
2326
2414
|
children: "TasksPage: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
2327
2415
|
});
|
|
2328
|
-
let
|
|
2416
|
+
let de = !i && !!t, fe = R && b === "inline", pe = B != null && S === "inline", me = /* @__PURE__ */ H(it, {
|
|
2329
2417
|
workspaceId: T,
|
|
2330
2418
|
projectId: t,
|
|
2331
2419
|
assigneeOptions: f,
|
|
2332
2420
|
hiddenFields: a,
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2421
|
+
defaultValues: ee ?? void 0,
|
|
2422
|
+
onCreated: ne,
|
|
2423
|
+
onCancel: ie
|
|
2424
|
+
}), he = B == null ? null : /* @__PURE__ */ H(Ct, {
|
|
2336
2425
|
id: B,
|
|
2337
2426
|
readonly: i,
|
|
2338
2427
|
hiddenFields: a,
|
|
@@ -2340,9 +2429,11 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2340
2429
|
assigneeOptions: f,
|
|
2341
2430
|
linkSourceProduct: u,
|
|
2342
2431
|
renderLinkIcon: d,
|
|
2343
|
-
onUpdated:
|
|
2344
|
-
onDeleted:
|
|
2345
|
-
|
|
2432
|
+
onUpdated: ae,
|
|
2433
|
+
onDeleted: se,
|
|
2434
|
+
onOpenItem: le,
|
|
2435
|
+
onAddSubtask: K
|
|
2436
|
+
}), ge = M === "ALL" ? void 0 : M, _e = P === "ALL" ? void 0 : P, ve = I && p ? p : void 0, J = u ? [
|
|
2346
2437
|
"title",
|
|
2347
2438
|
"status",
|
|
2348
2439
|
"priority",
|
|
@@ -2353,7 +2444,7 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2353
2444
|
return /* @__PURE__ */ H(Re, {
|
|
2354
2445
|
value: D,
|
|
2355
2446
|
children: /* @__PURE__ */ U("div", {
|
|
2356
|
-
className:
|
|
2447
|
+
className: q("space-y-4 p-6", C),
|
|
2357
2448
|
children: [
|
|
2358
2449
|
g && /* @__PURE__ */ H("div", {
|
|
2359
2450
|
className: "min-w-0",
|
|
@@ -2372,12 +2463,12 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2372
2463
|
onPriorityChange: N,
|
|
2373
2464
|
type: P,
|
|
2374
2465
|
onTypeChange: F,
|
|
2375
|
-
onNewTask:
|
|
2376
|
-
canCreate:
|
|
2466
|
+
onNewTask: re,
|
|
2467
|
+
canCreate: de,
|
|
2377
2468
|
mine: I,
|
|
2378
2469
|
onMineChange: p ? L : void 0
|
|
2379
2470
|
}),
|
|
2380
|
-
|
|
2471
|
+
fe && /* @__PURE__ */ H("div", { children: me }),
|
|
2381
2472
|
O === "board" && /* @__PURE__ */ H(et, {
|
|
2382
2473
|
workspaceId: T,
|
|
2383
2474
|
projectId: n,
|
|
@@ -2388,26 +2479,26 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2388
2479
|
priority: M,
|
|
2389
2480
|
type: P,
|
|
2390
2481
|
search: A,
|
|
2391
|
-
assigneeId:
|
|
2482
|
+
assigneeId: ve,
|
|
2392
2483
|
hiddenFields: a,
|
|
2393
2484
|
resolveAssignee: l,
|
|
2394
2485
|
linkSourceProduct: u,
|
|
2395
2486
|
renderLinkIcon: d,
|
|
2396
|
-
onTaskClick:
|
|
2487
|
+
onTaskClick: ce
|
|
2397
2488
|
}),
|
|
2398
2489
|
O === "list" && /* @__PURE__ */ H(ut, {
|
|
2399
2490
|
workspaceId: T,
|
|
2400
2491
|
projectId: n,
|
|
2401
|
-
priority:
|
|
2402
|
-
type:
|
|
2492
|
+
priority: ge,
|
|
2493
|
+
type: _e,
|
|
2403
2494
|
search: A || void 0,
|
|
2404
|
-
assigneeId:
|
|
2495
|
+
assigneeId: ve,
|
|
2405
2496
|
hideHeader: !0,
|
|
2406
2497
|
resolveAssignee: l,
|
|
2407
2498
|
linkSourceProduct: u,
|
|
2408
2499
|
renderLinkIcon: d,
|
|
2409
|
-
columns:
|
|
2410
|
-
onSelect:
|
|
2500
|
+
columns: J ? [...J] : void 0,
|
|
2501
|
+
onSelect: le
|
|
2411
2502
|
}),
|
|
2412
2503
|
O === "timeline" && /* @__PURE__ */ H(gt, {
|
|
2413
2504
|
workspaceId: T,
|
|
@@ -2415,22 +2506,22 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2415
2506
|
priority: M,
|
|
2416
2507
|
type: P,
|
|
2417
2508
|
search: A,
|
|
2418
|
-
assigneeId:
|
|
2509
|
+
assigneeId: ve,
|
|
2419
2510
|
resolveAssignee: l,
|
|
2420
|
-
onSelect:
|
|
2511
|
+
onSelect: le
|
|
2421
2512
|
}),
|
|
2422
|
-
|
|
2513
|
+
pe && /* @__PURE__ */ H("div", {
|
|
2423
2514
|
className: "pb-6",
|
|
2424
|
-
children:
|
|
2515
|
+
children: he
|
|
2425
2516
|
}),
|
|
2426
2517
|
b === "modal" && /* @__PURE__ */ H(Ye, {
|
|
2427
2518
|
open: R,
|
|
2428
|
-
onClose:
|
|
2519
|
+
onClose: ie,
|
|
2429
2520
|
ariaLabel: "Create task",
|
|
2430
2521
|
className: "max-w-xl",
|
|
2431
2522
|
children: /* @__PURE__ */ H("div", {
|
|
2432
2523
|
className: "p-2 pt-8",
|
|
2433
|
-
children:
|
|
2524
|
+
children: me
|
|
2434
2525
|
})
|
|
2435
2526
|
}),
|
|
2436
2527
|
S === "drawer" && /* @__PURE__ */ H(Xe, {
|
|
@@ -2439,7 +2530,7 @@ function Tt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2439
2530
|
ariaLabel: "Task detail",
|
|
2440
2531
|
children: /* @__PURE__ */ H("div", {
|
|
2441
2532
|
className: "p-2 pt-8",
|
|
2442
|
-
children:
|
|
2533
|
+
children: he
|
|
2443
2534
|
})
|
|
2444
2535
|
})
|
|
2445
2536
|
]
|