@burdenoff/microfe-healthybowl 2026.704.4 → 2026.704.5
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,28 +17,28 @@ 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
|
|
21
|
-
import { gql as
|
|
22
|
-
import { useApolloClient as
|
|
20
|
+
import { Card as W, CardContent as ee } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { gql as G } from "@apollo/client";
|
|
22
|
+
import { useApolloClient as te, useMutation as ne, useQuery as K } from "@apollo/client/react";
|
|
23
23
|
import "@apollo/client/core";
|
|
24
24
|
import "@apollo/client/link/context";
|
|
25
25
|
import "@apollo/client/link/error";
|
|
26
26
|
//#region node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js
|
|
27
|
-
var
|
|
27
|
+
var re = {
|
|
28
28
|
apiGatewayUrl: "",
|
|
29
29
|
workspaceId: ""
|
|
30
30
|
};
|
|
31
31
|
new Proxy({}, { get(e, t) {
|
|
32
|
-
return
|
|
32
|
+
return re[t];
|
|
33
33
|
} });
|
|
34
|
-
function
|
|
35
|
-
return { ...
|
|
34
|
+
function ie() {
|
|
35
|
+
return { ...re };
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return v(
|
|
37
|
+
var ae = g(null);
|
|
38
|
+
function q() {
|
|
39
|
+
return v(ae);
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var oe = G`
|
|
42
42
|
fragment WorkItemSummaryFields on WorkItem {
|
|
43
43
|
id
|
|
44
44
|
key
|
|
@@ -52,7 +52,7 @@ var se = W`
|
|
|
52
52
|
dueDate
|
|
53
53
|
labels
|
|
54
54
|
}
|
|
55
|
-
`,
|
|
55
|
+
`, se = G`
|
|
56
56
|
fragment WorkItemFields on WorkItem {
|
|
57
57
|
id
|
|
58
58
|
workspaceId
|
|
@@ -81,7 +81,7 @@ var se = W`
|
|
|
81
81
|
updatedBy
|
|
82
82
|
deletedAt
|
|
83
83
|
}
|
|
84
|
-
`, ce =
|
|
84
|
+
`, ce = G`
|
|
85
85
|
fragment ProjectSummaryFields on Project {
|
|
86
86
|
id
|
|
87
87
|
name
|
|
@@ -93,7 +93,7 @@ var se = W`
|
|
|
93
93
|
endDate
|
|
94
94
|
tags
|
|
95
95
|
}
|
|
96
|
-
`, le =
|
|
96
|
+
`, le = G`
|
|
97
97
|
query ListWorkItems(
|
|
98
98
|
$workspaceId: ID!
|
|
99
99
|
$filter: PlanmagnetWorkItemFilter
|
|
@@ -117,16 +117,16 @@ var se = W`
|
|
|
117
117
|
totalCount
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
${
|
|
121
|
-
`, ue =
|
|
120
|
+
${oe}
|
|
121
|
+
`, ue = G`
|
|
122
122
|
query GetWorkItem($id: ID!) {
|
|
123
123
|
planmagnetWorkItem(id: $id) {
|
|
124
124
|
...WorkItemFields
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
${
|
|
127
|
+
${se}
|
|
128
128
|
`;
|
|
129
|
-
|
|
129
|
+
G`
|
|
130
130
|
query GetProjects(
|
|
131
131
|
$workspaceId: ID!
|
|
132
132
|
$filter: PlanmagnetProjectFilter
|
|
@@ -152,30 +152,30 @@ W`
|
|
|
152
152
|
}
|
|
153
153
|
${ce}
|
|
154
154
|
`;
|
|
155
|
-
var de =
|
|
155
|
+
var de = G`
|
|
156
156
|
mutation CreateWorkItem($input: PlanmagnetCreateWorkItemInput!) {
|
|
157
157
|
planmagnetCreateWorkItem(input: $input) {
|
|
158
158
|
...WorkItemFields
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
${
|
|
162
|
-
`, fe =
|
|
161
|
+
${se}
|
|
162
|
+
`, fe = 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
|
+
${se}
|
|
169
169
|
`;
|
|
170
|
-
|
|
170
|
+
G`
|
|
171
171
|
mutation MoveWorkItem($id: ID!, $input: PlanmagnetMoveWorkItemInput!) {
|
|
172
172
|
planmagnetMoveWorkItem(id: $id, input: $input) {
|
|
173
173
|
...WorkItemFields
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
${
|
|
176
|
+
${se}
|
|
177
177
|
`;
|
|
178
|
-
var pe =
|
|
178
|
+
var pe = G`
|
|
179
179
|
fragment WorkItemLinkFields on WorkItemLink {
|
|
180
180
|
id
|
|
181
181
|
workspaceId
|
|
@@ -192,7 +192,7 @@ var pe = W`
|
|
|
192
192
|
createdAt
|
|
193
193
|
updatedAt
|
|
194
194
|
}
|
|
195
|
-
`, me =
|
|
195
|
+
`, me = G`
|
|
196
196
|
query ListWorkItemLinks(
|
|
197
197
|
$workspaceId: ID!
|
|
198
198
|
$filter: PlanmagnetWorkItemLinkFilter
|
|
@@ -218,19 +218,19 @@ var pe = W`
|
|
|
218
218
|
}
|
|
219
219
|
${pe}
|
|
220
220
|
`;
|
|
221
|
-
|
|
221
|
+
G`
|
|
222
222
|
mutation CreateWorkItemLink($input: PlanmagnetCreateWorkItemLinkInput!) {
|
|
223
223
|
planmagnetLinkWorkItem(input: $input) {
|
|
224
224
|
...WorkItemLinkFields
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
${pe}
|
|
228
|
-
`,
|
|
228
|
+
`, G`
|
|
229
229
|
mutation UnlinkWorkItem($id: ID!) {
|
|
230
230
|
planmagnetUnlinkWorkItem(id: $id)
|
|
231
231
|
}
|
|
232
232
|
`;
|
|
233
|
-
var he =
|
|
233
|
+
var he = G`
|
|
234
234
|
query ListMilestones(
|
|
235
235
|
$workspaceId: ID!
|
|
236
236
|
$filter: PlanmagnetMilestoneFilter
|
|
@@ -254,7 +254,7 @@ var he = W`
|
|
|
254
254
|
totalCount
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
${
|
|
257
|
+
${G`
|
|
258
258
|
fragment MilestoneFields on Milestone {
|
|
259
259
|
id
|
|
260
260
|
projectId
|
|
@@ -268,7 +268,7 @@ var he = W`
|
|
|
268
268
|
updatedAt
|
|
269
269
|
}
|
|
270
270
|
`}
|
|
271
|
-
`, ge =
|
|
271
|
+
`, ge = G`
|
|
272
272
|
mutation DeleteWorkItem($id: ID!) {
|
|
273
273
|
planmagnetDeleteWorkItem(id: $id)
|
|
274
274
|
}
|
|
@@ -293,11 +293,15 @@ function be(e) {
|
|
|
293
293
|
let n = /* @__PURE__ */ new Date();
|
|
294
294
|
return d(t, t.getFullYear() === n.getFullYear() ? "MMM d" : "MMM d yyyy");
|
|
295
295
|
}
|
|
296
|
-
function xe(e
|
|
296
|
+
function xe(e) {
|
|
297
|
+
let t = ve(e);
|
|
298
|
+
return t ? d(t, "MMM d, yyyy") : null;
|
|
299
|
+
}
|
|
300
|
+
function Se(e, t) {
|
|
297
301
|
let n = ve(e);
|
|
298
302
|
return !n || t && _e.has(t) ? !1 : i(n).getTime() < i(/* @__PURE__ */ new Date()).getTime();
|
|
299
303
|
}
|
|
300
|
-
var
|
|
304
|
+
var Ce = h("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium capitalize transition-colors", {
|
|
301
305
|
variants: { variant: {
|
|
302
306
|
default: "bg-primary/10 text-primary",
|
|
303
307
|
muted: "bg-muted text-muted-foreground",
|
|
@@ -307,29 +311,29 @@ var Se = h("inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-m
|
|
|
307
311
|
} },
|
|
308
312
|
defaultVariants: { variant: "default" }
|
|
309
313
|
});
|
|
310
|
-
function
|
|
314
|
+
function we({ className: e, variant: t, ...n }) {
|
|
311
315
|
return /* @__PURE__ */ H("span", {
|
|
312
|
-
className: J(
|
|
316
|
+
className: J(Ce({ variant: t }), e),
|
|
313
317
|
...n
|
|
314
318
|
});
|
|
315
319
|
}
|
|
316
|
-
var
|
|
320
|
+
var Te = [
|
|
317
321
|
"bg-primary/15 text-primary",
|
|
318
322
|
"bg-secondary text-secondary-foreground",
|
|
319
323
|
"bg-accent text-accent-foreground",
|
|
320
324
|
"bg-muted text-muted-foreground",
|
|
321
325
|
"bg-destructive/15 text-destructive"
|
|
322
|
-
],
|
|
326
|
+
], Ee = {
|
|
323
327
|
sm: "h-5 w-5 text-[9px]",
|
|
324
328
|
md: "h-6 w-6 text-[10px]",
|
|
325
329
|
lg: "h-8 w-8 text-xs"
|
|
326
330
|
};
|
|
327
|
-
function
|
|
331
|
+
function De(e) {
|
|
328
332
|
let t = 0;
|
|
329
333
|
for (let n = 0; n < e.length; n++) t = t * 31 + e.charCodeAt(n) >>> 0;
|
|
330
|
-
return t %
|
|
334
|
+
return t % Te.length;
|
|
331
335
|
}
|
|
332
|
-
function
|
|
336
|
+
function Oe(e, t) {
|
|
333
337
|
let n = (e ?? "").trim();
|
|
334
338
|
if (n) {
|
|
335
339
|
let e = n.split(/\s+/);
|
|
@@ -337,9 +341,9 @@ function De(e, t) {
|
|
|
337
341
|
}
|
|
338
342
|
return (t ?? "").replace(/[^a-zA-Z0-9]/g, "").slice(0, 2).toUpperCase() || "?";
|
|
339
343
|
}
|
|
340
|
-
function
|
|
344
|
+
function ke({ id: e, name: t, size: n = "md", className: r }) {
|
|
341
345
|
if (!e && !t) return /* @__PURE__ */ H("span", {
|
|
342
|
-
className: J("inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground",
|
|
346
|
+
className: J("inline-flex items-center justify-center rounded-full border border-dashed border-border text-muted-foreground", Ee[n], r),
|
|
343
347
|
title: "Unassigned",
|
|
344
348
|
"aria-label": "Unassigned",
|
|
345
349
|
children: /* @__PURE__ */ H(V, {
|
|
@@ -347,15 +351,15 @@ function Oe({ id: e, name: t, size: n = "md", className: r }) {
|
|
|
347
351
|
"aria-hidden": "true"
|
|
348
352
|
})
|
|
349
353
|
});
|
|
350
|
-
let i =
|
|
354
|
+
let i = Te[De(t || e || "")];
|
|
351
355
|
return /* @__PURE__ */ H("span", {
|
|
352
|
-
className: J("inline-flex items-center justify-center rounded-full font-medium",
|
|
356
|
+
className: J("inline-flex items-center justify-center rounded-full font-medium", Ee[n], i, r),
|
|
353
357
|
title: t ?? e ?? void 0,
|
|
354
358
|
"aria-label": t ?? e ?? void 0,
|
|
355
|
-
children:
|
|
359
|
+
children: Oe(t, e)
|
|
356
360
|
});
|
|
357
361
|
}
|
|
358
|
-
var
|
|
362
|
+
var Ae = [
|
|
359
363
|
{
|
|
360
364
|
status: "BACKLOG",
|
|
361
365
|
label: "Backlog"
|
|
@@ -379,20 +383,24 @@ var ke = [
|
|
|
379
383
|
{
|
|
380
384
|
status: "DONE",
|
|
381
385
|
label: "Done"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
status: "CANCELLED",
|
|
389
|
+
label: "Cancelled"
|
|
382
390
|
}
|
|
383
|
-
],
|
|
391
|
+
], je = [
|
|
384
392
|
"NONE",
|
|
385
393
|
"LOW",
|
|
386
394
|
"MEDIUM",
|
|
387
395
|
"HIGH",
|
|
388
396
|
"CRITICAL"
|
|
389
|
-
],
|
|
397
|
+
], Me = [
|
|
390
398
|
"TASK",
|
|
391
399
|
"STORY",
|
|
392
400
|
"BUG",
|
|
393
401
|
"EPIC",
|
|
394
402
|
"SUB_TASK"
|
|
395
|
-
],
|
|
403
|
+
], Ne = [
|
|
396
404
|
"BACKLOG",
|
|
397
405
|
"TODO",
|
|
398
406
|
"IN_PROGRESS",
|
|
@@ -401,16 +409,16 @@ var ke = [
|
|
|
401
409
|
"DONE",
|
|
402
410
|
"CANCELLED"
|
|
403
411
|
];
|
|
404
|
-
function
|
|
412
|
+
function Pe(e) {
|
|
405
413
|
return e.toLowerCase().replace(/_/g, " ");
|
|
406
414
|
}
|
|
407
|
-
function
|
|
408
|
-
let r = e.displayNameSnapshot ||
|
|
415
|
+
function Fe({ link: e, renderIcon: t, className: n }) {
|
|
416
|
+
let r = e.displayNameSnapshot || Pe(e.entityType), i = t?.(e.entityType) ?? /* @__PURE__ */ H(I, {
|
|
409
417
|
className: "h-3 w-3 shrink-0",
|
|
410
418
|
"aria-hidden": "true"
|
|
411
419
|
}), a = /* @__PURE__ */ U("span", {
|
|
412
420
|
className: J("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),
|
|
413
|
-
title: `${
|
|
421
|
+
title: `${Pe(e.relationType)} \xB7 ${Pe(e.entityType)}`,
|
|
414
422
|
children: [i, /* @__PURE__ */ H("span", {
|
|
415
423
|
className: "truncate",
|
|
416
424
|
children: r
|
|
@@ -423,7 +431,7 @@ function Pe({ link: e, renderIcon: t, className: n }) {
|
|
|
423
431
|
children: a
|
|
424
432
|
}) : a;
|
|
425
433
|
}
|
|
426
|
-
var
|
|
434
|
+
var Ie = {
|
|
427
435
|
board: "Board",
|
|
428
436
|
list: "List",
|
|
429
437
|
timeline: "Timeline",
|
|
@@ -435,6 +443,9 @@ var Fe = {
|
|
|
435
443
|
noTasks: "No tasks",
|
|
436
444
|
noTasksFound: "No tasks found.",
|
|
437
445
|
dropHere: "Drop here",
|
|
446
|
+
moveConfirmTitle: "Move task?",
|
|
447
|
+
moveConfirmPrompt: "Move \"{task}\" to {status}?",
|
|
448
|
+
moveConfirm: "Move",
|
|
438
449
|
unassigned: "Unassigned",
|
|
439
450
|
assigned: "Assigned",
|
|
440
451
|
overdue: "{n} overdue",
|
|
@@ -470,6 +481,9 @@ var Fe = {
|
|
|
470
481
|
storyPointsLabel: "Story points",
|
|
471
482
|
labelsLabel: "Labels",
|
|
472
483
|
labelsPlaceholder: "comma, separated, labels",
|
|
484
|
+
linkedRecordsLabel: "Linked records",
|
|
485
|
+
createdLabel: "Created",
|
|
486
|
+
updatedLabel: "Updated",
|
|
473
487
|
create: "Create task",
|
|
474
488
|
creating: "Creating…",
|
|
475
489
|
cancel: "Cancel",
|
|
@@ -512,29 +526,29 @@ var Fe = {
|
|
|
512
526
|
EPIC: "Epic",
|
|
513
527
|
SUB_TASK: "Sub Task"
|
|
514
528
|
}
|
|
515
|
-
},
|
|
529
|
+
}, Le = g(Ie), Re = Le.Provider;
|
|
516
530
|
function Y() {
|
|
517
|
-
return v(
|
|
531
|
+
return v(Le);
|
|
518
532
|
}
|
|
519
|
-
function
|
|
533
|
+
function ze(e) {
|
|
520
534
|
return e ? {
|
|
521
|
-
...
|
|
535
|
+
...Ie,
|
|
522
536
|
...e,
|
|
523
537
|
status: {
|
|
524
|
-
...
|
|
538
|
+
...Ie.status,
|
|
525
539
|
...e.status
|
|
526
540
|
},
|
|
527
541
|
priority: {
|
|
528
|
-
...
|
|
542
|
+
...Ie.priority,
|
|
529
543
|
...e.priority
|
|
530
544
|
},
|
|
531
545
|
type: {
|
|
532
|
-
...
|
|
546
|
+
...Ie.type,
|
|
533
547
|
...e.type
|
|
534
548
|
}
|
|
535
|
-
} :
|
|
549
|
+
} : Ie;
|
|
536
550
|
}
|
|
537
|
-
var
|
|
551
|
+
var Be = {
|
|
538
552
|
BACKLOG: {
|
|
539
553
|
icon: A,
|
|
540
554
|
tone: "text-muted-foreground/60"
|
|
@@ -564,21 +578,21 @@ var ze = {
|
|
|
564
578
|
tone: "text-destructive/70"
|
|
565
579
|
}
|
|
566
580
|
};
|
|
567
|
-
function
|
|
568
|
-
let n =
|
|
581
|
+
function Ve({ status: e, className: t }) {
|
|
582
|
+
let n = Be[e] ?? Be.TODO, r = n.icon;
|
|
569
583
|
return /* @__PURE__ */ H(r, {
|
|
570
584
|
className: J("h-3.5 w-3.5 shrink-0", n.tone, t),
|
|
571
585
|
"aria-hidden": "true"
|
|
572
586
|
});
|
|
573
587
|
}
|
|
574
|
-
function
|
|
588
|
+
function He({ status: e, className: t }) {
|
|
575
589
|
let n = Y();
|
|
576
590
|
return /* @__PURE__ */ U("span", {
|
|
577
591
|
className: J("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),
|
|
578
|
-
children: [/* @__PURE__ */ H(
|
|
592
|
+
children: [/* @__PURE__ */ H(Ve, { status: e }), n.status[e]]
|
|
579
593
|
});
|
|
580
594
|
}
|
|
581
|
-
var
|
|
595
|
+
var Ue = {
|
|
582
596
|
NONE: {
|
|
583
597
|
level: 0,
|
|
584
598
|
tone: "text-muted-foreground/50"
|
|
@@ -599,42 +613,42 @@ var He = {
|
|
|
599
613
|
level: 3,
|
|
600
614
|
tone: "text-destructive"
|
|
601
615
|
}
|
|
602
|
-
},
|
|
616
|
+
}, We = [
|
|
603
617
|
"h-1.5",
|
|
604
618
|
"h-2.5",
|
|
605
619
|
"h-3.5"
|
|
606
620
|
];
|
|
607
|
-
function
|
|
608
|
-
let r = Y(), i =
|
|
621
|
+
function Ge({ priority: e, showLabel: t = !1, className: n }) {
|
|
622
|
+
let r = Y(), i = Ue[e] ?? Ue.NONE;
|
|
609
623
|
return /* @__PURE__ */ U("span", {
|
|
610
624
|
className: J("inline-flex items-center gap-1.5", i.tone, n),
|
|
611
625
|
title: `${r.priorityLabel}: ${r.priority[e]}`,
|
|
612
626
|
children: [/* @__PURE__ */ H("span", {
|
|
613
627
|
className: "flex items-end gap-0.5",
|
|
614
628
|
"aria-hidden": "true",
|
|
615
|
-
children:
|
|
629
|
+
children: We.map((e, t) => /* @__PURE__ */ H("span", { className: J("w-1 rounded-[1px]", e, t < i.level ? "bg-current" : "bg-current/25") }, e))
|
|
616
630
|
}), t && /* @__PURE__ */ H("span", {
|
|
617
631
|
className: "text-xs font-medium capitalize",
|
|
618
632
|
children: r.priority[e]
|
|
619
633
|
})]
|
|
620
634
|
});
|
|
621
635
|
}
|
|
622
|
-
var
|
|
636
|
+
var Ke = {
|
|
623
637
|
TASK: "secondary",
|
|
624
638
|
STORY: "default",
|
|
625
639
|
BUG: "destructive",
|
|
626
640
|
EPIC: "accent",
|
|
627
641
|
SUB_TASK: "muted"
|
|
628
642
|
};
|
|
629
|
-
function
|
|
643
|
+
function qe({ type: e, className: t }) {
|
|
630
644
|
let n = Y();
|
|
631
|
-
return /* @__PURE__ */ H(
|
|
632
|
-
variant:
|
|
645
|
+
return /* @__PURE__ */ H(we, {
|
|
646
|
+
variant: Ke[e],
|
|
633
647
|
className: t,
|
|
634
648
|
children: n.type[e]
|
|
635
649
|
});
|
|
636
650
|
}
|
|
637
|
-
function
|
|
651
|
+
function Je({ open: e, onClose: t, children: n, ariaLabel: r, className: i, variant: a }) {
|
|
638
652
|
if (y(() => {
|
|
639
653
|
if (!e) return;
|
|
640
654
|
let n = (e) => {
|
|
@@ -662,21 +676,21 @@ function qe({ open: e, onClose: t, children: n, ariaLabel: r, className: i, vari
|
|
|
662
676
|
})
|
|
663
677
|
});
|
|
664
678
|
}
|
|
665
|
-
function
|
|
666
|
-
return /* @__PURE__ */ H(
|
|
679
|
+
function Ye(e) {
|
|
680
|
+
return /* @__PURE__ */ H(Je, {
|
|
667
681
|
variant: "modal",
|
|
668
682
|
...e
|
|
669
683
|
});
|
|
670
684
|
}
|
|
671
|
-
function
|
|
672
|
-
return /* @__PURE__ */ H(
|
|
685
|
+
function Xe(e) {
|
|
686
|
+
return /* @__PURE__ */ H(Je, {
|
|
673
687
|
variant: "drawer",
|
|
674
688
|
...e
|
|
675
689
|
});
|
|
676
690
|
}
|
|
677
|
-
var
|
|
678
|
-
function
|
|
679
|
-
let d = Y(), f =
|
|
691
|
+
var Ze = /* @__PURE__ */ new Set();
|
|
692
|
+
function Qe({ task: e, hidden: t = Ze, onClick: n, draggable: r, onDragStart: i, onDragEnd: a, dragging: o, resolveAssignee: s, links: c, renderLinkIcon: l, className: u }) {
|
|
693
|
+
let d = Y(), f = Se(e.dueDate, e.status), p = be(e.dueDate), m = e.assigneeId ? s?.(e.assigneeId) : null, h = !t.has("key") || !t.has("type"), g = !t.has("links") && (c?.length ?? 0) > 0, _ = !t.has("labels") && (e.labels?.length ?? 0) > 0, v = !t.has("priority"), y = !t.has("storyPoints") && e.storyPoints != null, b = v || y, x = !t.has("assignee"), C = !t.has("dueDate") && !!p, w = x || C, T = !!n;
|
|
680
694
|
return /* @__PURE__ */ U("div", {
|
|
681
695
|
role: T ? "button" : void 0,
|
|
682
696
|
tabIndex: T ? 0 : void 0,
|
|
@@ -694,7 +708,7 @@ function Ze({ task: e, hidden: t = Xe, onClick: n, draggable: r, onDragStart: i,
|
|
|
694
708
|
children: [t.has("key") ? /* @__PURE__ */ H("span", {}) : /* @__PURE__ */ H("span", {
|
|
695
709
|
className: "font-mono text-[10px] uppercase tracking-wide text-muted-foreground",
|
|
696
710
|
children: e.key
|
|
697
|
-
}), !t.has("type") && /* @__PURE__ */ H(
|
|
711
|
+
}), !t.has("type") && /* @__PURE__ */ H(qe, { type: e.type })]
|
|
698
712
|
}),
|
|
699
713
|
/* @__PURE__ */ H("p", {
|
|
700
714
|
className: "line-clamp-2 text-sm font-medium leading-snug text-foreground",
|
|
@@ -702,7 +716,7 @@ function Ze({ task: e, hidden: t = Xe, onClick: n, draggable: r, onDragStart: i,
|
|
|
702
716
|
}),
|
|
703
717
|
g && /* @__PURE__ */ U("div", {
|
|
704
718
|
className: "mt-1.5 flex flex-wrap gap-1",
|
|
705
|
-
children: [c.slice(0, 3).map((e) => /* @__PURE__ */ H(
|
|
719
|
+
children: [c.slice(0, 3).map((e) => /* @__PURE__ */ H(Fe, {
|
|
706
720
|
link: e,
|
|
707
721
|
renderIcon: l
|
|
708
722
|
}, e.id)), c.length > 3 && /* @__PURE__ */ U("span", {
|
|
@@ -722,7 +736,7 @@ function Ze({ task: e, hidden: t = Xe, onClick: n, draggable: r, onDragStart: i,
|
|
|
722
736
|
}),
|
|
723
737
|
b && /* @__PURE__ */ U("div", {
|
|
724
738
|
className: "mt-2 flex items-center justify-between",
|
|
725
|
-
children: [v ? /* @__PURE__ */ H(
|
|
739
|
+
children: [v ? /* @__PURE__ */ H(Ge, {
|
|
726
740
|
priority: e.priority,
|
|
727
741
|
showLabel: !0
|
|
728
742
|
}) : /* @__PURE__ */ H("span", {}), y && /* @__PURE__ */ H("span", {
|
|
@@ -735,7 +749,7 @@ function Ze({ task: e, hidden: t = Xe, onClick: n, draggable: r, onDragStart: i,
|
|
|
735
749
|
className: "mt-2 flex items-center justify-between gap-2",
|
|
736
750
|
children: [x ? /* @__PURE__ */ U("span", {
|
|
737
751
|
className: "flex min-w-0 items-center gap-1.5",
|
|
738
|
-
children: [/* @__PURE__ */ H(
|
|
752
|
+
children: [/* @__PURE__ */ H(ke, {
|
|
739
753
|
id: e.assigneeId,
|
|
740
754
|
name: m?.name,
|
|
741
755
|
size: "sm"
|
|
@@ -755,8 +769,8 @@ function Ze({ task: e, hidden: t = Xe, onClick: n, draggable: r, onDragStart: i,
|
|
|
755
769
|
]
|
|
756
770
|
});
|
|
757
771
|
}
|
|
758
|
-
function
|
|
759
|
-
let { data: r, loading: i } =
|
|
772
|
+
function $e(e, t, n = 500) {
|
|
773
|
+
let { data: r, loading: i } = K(me, {
|
|
760
774
|
variables: {
|
|
761
775
|
workspaceId: e,
|
|
762
776
|
...t ? { filter: { sourceProduct: t } } : {},
|
|
@@ -776,101 +790,104 @@ function Qe(e, t, n = 500) {
|
|
|
776
790
|
loading: i
|
|
777
791
|
};
|
|
778
792
|
}
|
|
779
|
-
function
|
|
780
|
-
let
|
|
793
|
+
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 = q(), 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(fe), { data: P, loading: F, error: I } = K(le, {
|
|
781
795
|
variables: {
|
|
782
|
-
workspaceId:
|
|
796
|
+
workspaceId: v,
|
|
783
797
|
...e ? { filter: { projectId: e } } : {},
|
|
784
798
|
pagination: { first: 200 }
|
|
785
799
|
},
|
|
786
|
-
skip: !
|
|
787
|
-
}),
|
|
800
|
+
skip: !v
|
|
801
|
+
}), L = _((e, t) => {
|
|
788
802
|
let n = e.status;
|
|
789
803
|
if (n === t) return;
|
|
790
|
-
let r =
|
|
804
|
+
let r = y.cache.identify({
|
|
791
805
|
__typename: "WorkItem",
|
|
792
806
|
id: e.id
|
|
793
807
|
});
|
|
794
|
-
r && (
|
|
808
|
+
r && (A(null), y.cache.modify({
|
|
795
809
|
id: r,
|
|
796
810
|
fields: { status: () => t }
|
|
797
|
-
}),
|
|
811
|
+
}), N({ variables: {
|
|
798
812
|
id: e.id,
|
|
799
813
|
input: { status: t }
|
|
800
814
|
} }).catch(() => {
|
|
801
|
-
|
|
815
|
+
y.cache.modify({
|
|
802
816
|
id: r,
|
|
803
817
|
fields: { status: () => n }
|
|
804
|
-
}),
|
|
818
|
+
}), A(S.moveFailed);
|
|
805
819
|
}));
|
|
806
820
|
}, [
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
821
|
+
y,
|
|
822
|
+
N,
|
|
823
|
+
S
|
|
810
824
|
]);
|
|
811
|
-
if (!
|
|
812
|
-
className: J("p-6 text-sm text-destructive",
|
|
825
|
+
if (!v) return /* @__PURE__ */ H("div", {
|
|
826
|
+
className: J("p-6 text-sm text-destructive", m),
|
|
813
827
|
children: "TaskBoard: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
814
828
|
});
|
|
815
|
-
if (
|
|
816
|
-
className: J("flex items-center justify-center p-12",
|
|
829
|
+
if (F && !P) return /* @__PURE__ */ H("div", {
|
|
830
|
+
className: J("flex items-center justify-center p-12", m),
|
|
817
831
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
818
832
|
});
|
|
819
|
-
if (
|
|
820
|
-
className: J("p-6 text-sm text-destructive",
|
|
833
|
+
if (I && !P) return /* @__PURE__ */ U("div", {
|
|
834
|
+
className: J("p-6 text-sm text-destructive", m),
|
|
821
835
|
children: [
|
|
822
|
-
|
|
836
|
+
S.errorLoading,
|
|
823
837
|
": ",
|
|
824
|
-
|
|
838
|
+
I.message
|
|
825
839
|
]
|
|
826
840
|
});
|
|
827
|
-
let
|
|
841
|
+
let R = P?.planmagnetWorkItems?.items ?? [], z = s.trim().toLowerCase(), B = R.filter((e) => !(a !== "ALL" && e.priority !== a || o !== "ALL" && e.type !== o || c && e.assigneeId !== c || z && ![
|
|
828
842
|
e.title,
|
|
829
843
|
e.key,
|
|
830
844
|
...e.labels ?? []
|
|
831
|
-
].join(" ").toLowerCase().includes(
|
|
832
|
-
!
|
|
833
|
-
},
|
|
834
|
-
if (!
|
|
845
|
+
].join(" ").toLowerCase().includes(z))), V = !n, W = (e) => (t) => {
|
|
846
|
+
!V || !T || (t.preventDefault(), D !== e && O(e));
|
|
847
|
+
}, ee = (e) => (t) => {
|
|
848
|
+
if (!V) return;
|
|
835
849
|
t.preventDefault();
|
|
836
|
-
let n =
|
|
837
|
-
|
|
850
|
+
let n = R.find((e) => e.id === T);
|
|
851
|
+
O(null), E(null), !(!n || n.status === e) && (r ? M({
|
|
852
|
+
task: n,
|
|
853
|
+
toStatus: e
|
|
854
|
+
}) : L(n, e));
|
|
838
855
|
};
|
|
839
856
|
return /* @__PURE__ */ U("div", {
|
|
840
|
-
className: J("space-y-3",
|
|
857
|
+
className: J("space-y-3", m),
|
|
841
858
|
children: [
|
|
842
|
-
!
|
|
859
|
+
!i && /* @__PURE__ */ U("div", {
|
|
843
860
|
className: "flex items-baseline justify-between",
|
|
844
861
|
children: [/* @__PURE__ */ H("h2", {
|
|
845
862
|
className: "text-lg font-semibold text-foreground",
|
|
846
|
-
children:
|
|
863
|
+
children: S.board
|
|
847
864
|
}), /* @__PURE__ */ U("span", {
|
|
848
865
|
className: "text-sm text-muted-foreground",
|
|
849
866
|
children: [
|
|
850
|
-
|
|
867
|
+
B.length,
|
|
851
868
|
" ",
|
|
852
|
-
|
|
869
|
+
B.length === 1 ? S.tasksSingular : S.tasksPlural
|
|
853
870
|
]
|
|
854
871
|
})]
|
|
855
872
|
}),
|
|
856
|
-
|
|
873
|
+
k && /* @__PURE__ */ H("div", {
|
|
857
874
|
className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-1.5 text-xs text-destructive",
|
|
858
|
-
children:
|
|
875
|
+
children: k
|
|
859
876
|
}),
|
|
860
877
|
/* @__PURE__ */ H("div", {
|
|
861
878
|
className: "flex gap-3 overflow-x-auto pb-2",
|
|
862
879
|
children: t.map((e) => {
|
|
863
|
-
let t =
|
|
880
|
+
let t = B.filter((t) => t.status === e.status), n = D === e.status;
|
|
864
881
|
return /* @__PURE__ */ U("div", {
|
|
865
|
-
onDragOver:
|
|
866
|
-
onDragLeave: () =>
|
|
867
|
-
onDrop:
|
|
882
|
+
onDragOver: W(e.status),
|
|
883
|
+
onDragLeave: () => D === e.status && O(null),
|
|
884
|
+
onDrop: ee(e.status),
|
|
868
885
|
className: J("flex w-72 shrink-0 flex-col rounded-lg border transition-colors", n ? "border-primary/50 bg-primary/5" : "border-transparent bg-muted/40"),
|
|
869
886
|
children: [/* @__PURE__ */ U("div", {
|
|
870
887
|
className: "flex items-center justify-between gap-2 px-3 py-2",
|
|
871
888
|
children: [/* @__PURE__ */ U("span", {
|
|
872
889
|
className: "flex items-center gap-2 text-sm font-medium text-foreground",
|
|
873
|
-
children: [/* @__PURE__ */ H(
|
|
890
|
+
children: [/* @__PURE__ */ H(Ve, { status: e.status }), S.status[e.status]]
|
|
874
891
|
}), /* @__PURE__ */ H("span", {
|
|
875
892
|
className: "rounded-full bg-muted px-1.5 text-xs font-medium text-muted-foreground",
|
|
876
893
|
children: t.length
|
|
@@ -879,33 +896,68 @@ function $e({ projectId: e, columns: t = ke, readonly: n, hideHeader: r, priorit
|
|
|
879
896
|
className: "flex flex-col gap-2 px-2 pb-2",
|
|
880
897
|
children: t.length === 0 ? /* @__PURE__ */ H("div", {
|
|
881
898
|
className: "rounded-md border border-dashed border-border/70 px-3 py-6 text-center text-xs text-muted-foreground",
|
|
882
|
-
children: n ?
|
|
883
|
-
}) : t.map((e) => /* @__PURE__ */ H(
|
|
899
|
+
children: n ? S.dropHere : S.noTasks
|
|
900
|
+
}) : t.map((e) => /* @__PURE__ */ H(Qe, {
|
|
884
901
|
task: e,
|
|
885
|
-
hidden:
|
|
886
|
-
onClick:
|
|
887
|
-
draggable:
|
|
888
|
-
dragging:
|
|
889
|
-
resolveAssignee:
|
|
890
|
-
links:
|
|
891
|
-
renderLinkIcon:
|
|
902
|
+
hidden: C,
|
|
903
|
+
onClick: p,
|
|
904
|
+
draggable: V,
|
|
905
|
+
dragging: T === e.id,
|
|
906
|
+
resolveAssignee: u,
|
|
907
|
+
links: w.get(e.id),
|
|
908
|
+
renderLinkIcon: f,
|
|
892
909
|
onDragStart: (e, t) => {
|
|
893
|
-
|
|
910
|
+
E(e.id), t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", e.id);
|
|
894
911
|
},
|
|
895
912
|
onDragEnd: () => {
|
|
896
|
-
|
|
913
|
+
E(null), O(null);
|
|
897
914
|
}
|
|
898
915
|
}, e.id))
|
|
899
916
|
})]
|
|
900
917
|
}, e.status);
|
|
901
918
|
})
|
|
919
|
+
}),
|
|
920
|
+
/* @__PURE__ */ H(Ye, {
|
|
921
|
+
open: j != null,
|
|
922
|
+
onClose: () => M(null),
|
|
923
|
+
ariaLabel: S.moveConfirmTitle,
|
|
924
|
+
className: "max-w-sm",
|
|
925
|
+
children: j && /* @__PURE__ */ U("div", {
|
|
926
|
+
className: "space-y-4 p-6",
|
|
927
|
+
children: [
|
|
928
|
+
/* @__PURE__ */ H("h3", {
|
|
929
|
+
className: "text-base font-semibold text-foreground",
|
|
930
|
+
children: S.moveConfirmTitle
|
|
931
|
+
}),
|
|
932
|
+
/* @__PURE__ */ H("p", {
|
|
933
|
+
className: "text-sm text-muted-foreground",
|
|
934
|
+
children: S.moveConfirmPrompt.replace("{task}", j.task.title).replace("{status}", S.status[j.toStatus])
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ U("div", {
|
|
937
|
+
className: "flex items-center justify-end gap-2",
|
|
938
|
+
children: [/* @__PURE__ */ H("button", {
|
|
939
|
+
type: "button",
|
|
940
|
+
onClick: () => M(null),
|
|
941
|
+
className: "rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70",
|
|
942
|
+
children: S.cancel
|
|
943
|
+
}), /* @__PURE__ */ H("button", {
|
|
944
|
+
type: "button",
|
|
945
|
+
onClick: () => {
|
|
946
|
+
L(j.task, j.toStatus), M(null);
|
|
947
|
+
},
|
|
948
|
+
className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:brightness-110",
|
|
949
|
+
children: S.moveConfirm
|
|
950
|
+
})]
|
|
951
|
+
})
|
|
952
|
+
]
|
|
953
|
+
})
|
|
902
954
|
})
|
|
903
955
|
]
|
|
904
956
|
});
|
|
905
957
|
}
|
|
906
|
-
var
|
|
907
|
-
function
|
|
908
|
-
let d =
|
|
958
|
+
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
|
+
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 = q(), 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(de), z = !!(f && p && g.trim()), B = async (e) => {
|
|
909
961
|
if (e.preventDefault(), !z || !p) return;
|
|
910
962
|
let t = M.split(",").map((e) => e.trim()).filter(Boolean), n = P.trim() ? Number(P) : void 0, r = {
|
|
911
963
|
projectId: p,
|
|
@@ -922,7 +974,7 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
922
974
|
try {
|
|
923
975
|
let e = (await I({ variables: { input: r } })).data?.planmagnetCreateWorkItem;
|
|
924
976
|
if (e) {
|
|
925
|
-
let t =
|
|
977
|
+
let t = ie();
|
|
926
978
|
try {
|
|
927
979
|
await t.onTaskSaved?.({
|
|
928
980
|
id: e.id,
|
|
@@ -939,11 +991,11 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
939
991
|
}
|
|
940
992
|
};
|
|
941
993
|
function V() {
|
|
942
|
-
_(""), y(""), C(
|
|
994
|
+
_(""), y(""), C(tt), T(nt), D(rt), k(""), j(""), N(""), F("");
|
|
943
995
|
}
|
|
944
|
-
return f ? /* @__PURE__ */ H(
|
|
996
|
+
return f ? /* @__PURE__ */ H(W, {
|
|
945
997
|
className: J("shadow-sm", l),
|
|
946
|
-
children: /* @__PURE__ */ H(
|
|
998
|
+
children: /* @__PURE__ */ H(ee, {
|
|
947
999
|
className: "p-6",
|
|
948
1000
|
children: /* @__PURE__ */ U("form", {
|
|
949
1001
|
onSubmit: B,
|
|
@@ -1003,7 +1055,7 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1003
1055
|
className: J(X, "capitalize"),
|
|
1004
1056
|
value: S,
|
|
1005
1057
|
onChange: (e) => C(e.target.value),
|
|
1006
|
-
children:
|
|
1058
|
+
children: Me.map((e) => /* @__PURE__ */ H("option", {
|
|
1007
1059
|
value: e,
|
|
1008
1060
|
children: m.type[e]
|
|
1009
1061
|
}, e))
|
|
@@ -1020,7 +1072,7 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1020
1072
|
className: J(X, "capitalize"),
|
|
1021
1073
|
value: w,
|
|
1022
1074
|
onChange: (e) => T(e.target.value),
|
|
1023
|
-
children:
|
|
1075
|
+
children: Ne.map((e) => /* @__PURE__ */ H("option", {
|
|
1024
1076
|
value: e,
|
|
1025
1077
|
children: m.status[e]
|
|
1026
1078
|
}, e))
|
|
@@ -1037,7 +1089,7 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1037
1089
|
className: J(X, "capitalize"),
|
|
1038
1090
|
value: E,
|
|
1039
1091
|
onChange: (e) => D(e.target.value),
|
|
1040
|
-
children:
|
|
1092
|
+
children: je.map((e) => /* @__PURE__ */ H("option", {
|
|
1041
1093
|
value: e,
|
|
1042
1094
|
children: m.priority[e]
|
|
1043
1095
|
}, e))
|
|
@@ -1145,20 +1197,20 @@ function rt({ projectId: e, assigneeOptions: t, hiddenFields: n, defaultValues:
|
|
|
1145
1197
|
children: "CreateTask: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
1146
1198
|
});
|
|
1147
1199
|
}
|
|
1148
|
-
var
|
|
1200
|
+
var at = [
|
|
1149
1201
|
"title",
|
|
1150
1202
|
"status",
|
|
1151
1203
|
"priority",
|
|
1152
1204
|
"assignee",
|
|
1153
1205
|
"dueDate",
|
|
1154
1206
|
"storyPoints"
|
|
1155
|
-
],
|
|
1207
|
+
], ot = {
|
|
1156
1208
|
CRITICAL: 0,
|
|
1157
1209
|
HIGH: 1,
|
|
1158
1210
|
MEDIUM: 2,
|
|
1159
1211
|
LOW: 3,
|
|
1160
1212
|
NONE: 4
|
|
1161
|
-
},
|
|
1213
|
+
}, st = {
|
|
1162
1214
|
BACKLOG: 0,
|
|
1163
1215
|
TODO: 1,
|
|
1164
1216
|
IN_PROGRESS: 2,
|
|
@@ -1167,7 +1219,7 @@ var it = [
|
|
|
1167
1219
|
DONE: 5,
|
|
1168
1220
|
CANCELLED: 6
|
|
1169
1221
|
};
|
|
1170
|
-
function
|
|
1222
|
+
function ct(e, t) {
|
|
1171
1223
|
switch (e) {
|
|
1172
1224
|
case "key": return t.colKey;
|
|
1173
1225
|
case "title": return t.colTask;
|
|
@@ -1182,7 +1234,7 @@ function st(e, t) {
|
|
|
1182
1234
|
default: return e;
|
|
1183
1235
|
}
|
|
1184
1236
|
}
|
|
1185
|
-
var
|
|
1237
|
+
var lt = {
|
|
1186
1238
|
title: "title",
|
|
1187
1239
|
type: "type",
|
|
1188
1240
|
status: "status",
|
|
@@ -1190,8 +1242,8 @@ var ct = {
|
|
|
1190
1242
|
dueDate: "dueDate",
|
|
1191
1243
|
storyPoints: "storyPoints"
|
|
1192
1244
|
};
|
|
1193
|
-
function
|
|
1194
|
-
let _ =
|
|
1245
|
+
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 _ = q(), v = g ?? _?.workspaceId, { linksByItem: y } = $e(v, f), S = Y(), [C, T] = x({
|
|
1195
1247
|
by: s ?? null,
|
|
1196
1248
|
dir: c
|
|
1197
1249
|
}), E = b(() => {
|
|
@@ -1204,7 +1256,7 @@ function lt({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1204
1256
|
r,
|
|
1205
1257
|
i,
|
|
1206
1258
|
a
|
|
1207
|
-
]), { data: O, loading: k, error: A } =
|
|
1259
|
+
]), { data: O, loading: k, error: A } = K(le, {
|
|
1208
1260
|
variables: {
|
|
1209
1261
|
workspaceId: v,
|
|
1210
1262
|
...Object.keys(E).length ? { filter: E } : {},
|
|
@@ -1215,9 +1267,9 @@ function lt({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1215
1267
|
let e = O?.planmagnetWorkItems?.items ?? [];
|
|
1216
1268
|
if (!C.by) return e;
|
|
1217
1269
|
let t = C.dir === "desc" ? -1 : 1, n = C.by;
|
|
1218
|
-
return [...e].sort((e, r) => t *
|
|
1270
|
+
return [...e].sort((e, r) => t * ft(e, r, n));
|
|
1219
1271
|
}, [O, C]), M = (e) => {
|
|
1220
|
-
let t =
|
|
1272
|
+
let t = lt[e];
|
|
1221
1273
|
t && T((e) => e.by === t ? {
|
|
1222
1274
|
by: t,
|
|
1223
1275
|
dir: e.dir === "asc" ? "desc" : "asc"
|
|
@@ -1258,13 +1310,13 @@ function lt({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1258
1310
|
children: [/* @__PURE__ */ H("thead", { children: /* @__PURE__ */ H("tr", {
|
|
1259
1311
|
className: "border-b border-border bg-muted/50 text-left",
|
|
1260
1312
|
children: o.map((e) => {
|
|
1261
|
-
let t = !!
|
|
1313
|
+
let t = !!lt[e], n = C.by === lt[e];
|
|
1262
1314
|
return /* @__PURE__ */ H("th", {
|
|
1263
1315
|
onClick: t ? () => M(e) : void 0,
|
|
1264
1316
|
className: J("px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", t && "cursor-pointer select-none hover:text-foreground"),
|
|
1265
1317
|
children: /* @__PURE__ */ U("span", {
|
|
1266
1318
|
className: "inline-flex items-center gap-1",
|
|
1267
|
-
children: [
|
|
1319
|
+
children: [ct(e, S), n && (C.dir === "asc" ? /* @__PURE__ */ H(D, {
|
|
1268
1320
|
className: "h-3 w-3",
|
|
1269
1321
|
"aria-hidden": "true"
|
|
1270
1322
|
}) : /* @__PURE__ */ H(w, {
|
|
@@ -1283,7 +1335,7 @@ function lt({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1283
1335
|
className: J("border-b border-border last:border-0", u && "cursor-pointer hover:bg-muted/40"),
|
|
1284
1336
|
children: o.map((t) => /* @__PURE__ */ H("td", {
|
|
1285
1337
|
className: "px-3 py-2 align-middle text-foreground",
|
|
1286
|
-
children:
|
|
1338
|
+
children: dt(t, e, {
|
|
1287
1339
|
resolveAssignee: d,
|
|
1288
1340
|
links: y.get(e.id),
|
|
1289
1341
|
renderLinkIcon: p,
|
|
@@ -1298,7 +1350,7 @@ function lt({ projectId: e, status: t, type: n, priority: r, assigneeId: i, sear
|
|
|
1298
1350
|
children: "TaskList: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
1299
1351
|
});
|
|
1300
1352
|
}
|
|
1301
|
-
function
|
|
1353
|
+
function dt(e, t, n) {
|
|
1302
1354
|
let { resolveAssignee: r, links: i, renderLinkIcon: a, unassigned: o } = n;
|
|
1303
1355
|
switch (e) {
|
|
1304
1356
|
case "key": return /* @__PURE__ */ H("span", {
|
|
@@ -1315,9 +1367,9 @@ function ut(e, t, n) {
|
|
|
1315
1367
|
children: t.key
|
|
1316
1368
|
})]
|
|
1317
1369
|
});
|
|
1318
|
-
case "type": return /* @__PURE__ */ H(
|
|
1319
|
-
case "status": return /* @__PURE__ */ H(
|
|
1320
|
-
case "priority": return /* @__PURE__ */ H(
|
|
1370
|
+
case "type": return /* @__PURE__ */ H(qe, { type: t.type });
|
|
1371
|
+
case "status": return /* @__PURE__ */ H(He, { status: t.status });
|
|
1372
|
+
case "priority": return /* @__PURE__ */ H(Ge, {
|
|
1321
1373
|
priority: t.priority,
|
|
1322
1374
|
showLabel: !0
|
|
1323
1375
|
});
|
|
@@ -1325,7 +1377,7 @@ function ut(e, t, n) {
|
|
|
1325
1377
|
let e = t.assigneeId ? r?.(t.assigneeId) : null;
|
|
1326
1378
|
return /* @__PURE__ */ U("span", {
|
|
1327
1379
|
className: "flex items-center gap-1.5",
|
|
1328
|
-
children: [/* @__PURE__ */ H(
|
|
1380
|
+
children: [/* @__PURE__ */ H(ke, {
|
|
1329
1381
|
id: t.assigneeId,
|
|
1330
1382
|
name: e?.name,
|
|
1331
1383
|
size: "sm"
|
|
@@ -1338,7 +1390,7 @@ function ut(e, t, n) {
|
|
|
1338
1390
|
case "dueDate": {
|
|
1339
1391
|
let e = be(t.dueDate);
|
|
1340
1392
|
return e ? /* @__PURE__ */ H("span", {
|
|
1341
|
-
className: J("text-xs",
|
|
1393
|
+
className: J("text-xs", Se(t.dueDate, t.status) ? "font-medium text-destructive" : "text-muted-foreground"),
|
|
1342
1394
|
children: e
|
|
1343
1395
|
}) : /* @__PURE__ */ H("span", {
|
|
1344
1396
|
className: "text-muted-foreground",
|
|
@@ -1357,7 +1409,7 @@ function ut(e, t, n) {
|
|
|
1357
1409
|
children: "—"
|
|
1358
1410
|
}) : /* @__PURE__ */ U("div", {
|
|
1359
1411
|
className: "flex flex-wrap gap-1",
|
|
1360
|
-
children: [i.slice(0, 2).map((e) => /* @__PURE__ */ H(
|
|
1412
|
+
children: [i.slice(0, 2).map((e) => /* @__PURE__ */ H(Fe, {
|
|
1361
1413
|
link: e,
|
|
1362
1414
|
renderIcon: a
|
|
1363
1415
|
}, e.id)), i.length > 2 && /* @__PURE__ */ U("span", {
|
|
@@ -1375,10 +1427,10 @@ function ut(e, t, n) {
|
|
|
1375
1427
|
default: return null;
|
|
1376
1428
|
}
|
|
1377
1429
|
}
|
|
1378
|
-
function
|
|
1430
|
+
function ft(e, t, n) {
|
|
1379
1431
|
switch (n) {
|
|
1380
|
-
case "priority": return
|
|
1381
|
-
case "status": return
|
|
1432
|
+
case "priority": return ot[e.priority] - ot[t.priority];
|
|
1433
|
+
case "status": return st[e.status] - st[t.status];
|
|
1382
1434
|
case "title": return e.title.localeCompare(t.title);
|
|
1383
1435
|
case "type": return e.type.localeCompare(t.type);
|
|
1384
1436
|
case "dueDate": return (e.dueDate ?? "").localeCompare(t.dueDate ?? "");
|
|
@@ -1386,8 +1438,8 @@ function dt(e, t, n) {
|
|
|
1386
1438
|
default: return 0;
|
|
1387
1439
|
}
|
|
1388
1440
|
}
|
|
1389
|
-
function
|
|
1390
|
-
let { projectId: n, enabled: r = !0, limit: i = 100 } = t, { data: a, loading: o } =
|
|
1441
|
+
function pt(e, t = {}) {
|
|
1442
|
+
let { projectId: n, enabled: r = !0, limit: i = 100 } = t, { data: a, loading: o } = K(he, {
|
|
1391
1443
|
variables: {
|
|
1392
1444
|
workspaceId: e,
|
|
1393
1445
|
...n ? { filter: { projectId: n } } : {},
|
|
@@ -1411,15 +1463,15 @@ function ft(e, t = {}) {
|
|
|
1411
1463
|
loading: o
|
|
1412
1464
|
};
|
|
1413
1465
|
}
|
|
1414
|
-
var
|
|
1415
|
-
function
|
|
1466
|
+
var mt = { weekStartsOn: 1 };
|
|
1467
|
+
function ht(e) {
|
|
1416
1468
|
return d(e, "yyyy-MM-dd");
|
|
1417
1469
|
}
|
|
1418
|
-
function
|
|
1419
|
-
let C =
|
|
1470
|
+
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 = q(), w = S ?? C?.workspaceId, D = Y(), { milestones: O, byDay: k } = pt(w, {
|
|
1420
1472
|
projectId: e,
|
|
1421
1473
|
enabled: v
|
|
1422
|
-
}), [A, j] = x(h), [M, N] = x(0), { data: F, loading: I, error: L } =
|
|
1474
|
+
}), [A, j] = x(h), [M, N] = x(0), { data: F, loading: I, error: L } = K(le, {
|
|
1423
1475
|
variables: {
|
|
1424
1476
|
workspaceId: w,
|
|
1425
1477
|
...e ? { filter: { projectId: e } } : {},
|
|
@@ -1439,10 +1491,10 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1439
1491
|
i,
|
|
1440
1492
|
o,
|
|
1441
1493
|
m
|
|
1442
|
-
]), { anchor: z, rangeStart: B, rangeEnd: V, days:
|
|
1494
|
+
]), { anchor: z, rangeStart: B, rangeEnd: V, days: W } = b(() => {
|
|
1443
1495
|
let e = /* @__PURE__ */ new Date();
|
|
1444
1496
|
if (A === "week") {
|
|
1445
|
-
let t = a(e, M), n = r(t,
|
|
1497
|
+
let t = a(e, M), n = r(t, mt), i = u(t, mt);
|
|
1446
1498
|
return {
|
|
1447
1499
|
anchor: t,
|
|
1448
1500
|
rangeStart: n,
|
|
@@ -1453,7 +1505,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1453
1505
|
})
|
|
1454
1506
|
};
|
|
1455
1507
|
}
|
|
1456
|
-
let t = n(e, M), i = r(l(t),
|
|
1508
|
+
let t = n(e, M), i = r(l(t), mt), o = u(s(t), mt);
|
|
1457
1509
|
return {
|
|
1458
1510
|
anchor: t,
|
|
1459
1511
|
rangeStart: i,
|
|
@@ -1463,7 +1515,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1463
1515
|
end: o
|
|
1464
1516
|
})
|
|
1465
1517
|
};
|
|
1466
|
-
}, [A, M]), { byDay:
|
|
1518
|
+
}, [A, M]), { byDay: ee, overdue: G, undated: te } = b(() => {
|
|
1467
1519
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
1468
1520
|
for (let r of R) {
|
|
1469
1521
|
let i = ve(r.dueDate);
|
|
@@ -1471,11 +1523,11 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1471
1523
|
n.push(r);
|
|
1472
1524
|
continue;
|
|
1473
1525
|
}
|
|
1474
|
-
if (
|
|
1526
|
+
if (Se(r.dueDate, r.status)) {
|
|
1475
1527
|
t.push(r);
|
|
1476
1528
|
continue;
|
|
1477
1529
|
}
|
|
1478
|
-
let a =
|
|
1530
|
+
let a = ht(i), o = e.get(a);
|
|
1479
1531
|
o ? o.push(r) : e.set(a, [r]);
|
|
1480
1532
|
}
|
|
1481
1533
|
return {
|
|
@@ -1500,7 +1552,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1500
1552
|
L.message
|
|
1501
1553
|
]
|
|
1502
1554
|
});
|
|
1503
|
-
let
|
|
1555
|
+
let ne = A === "week" ? `${d(B, "MMM d")} \u2013 ${d(V, "MMM d")}` : d(z, "MMMM yyyy");
|
|
1504
1556
|
return /* @__PURE__ */ U("div", {
|
|
1505
1557
|
className: J("space-y-3", y),
|
|
1506
1558
|
children: [
|
|
@@ -1531,7 +1583,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1531
1583
|
}),
|
|
1532
1584
|
/* @__PURE__ */ H("span", {
|
|
1533
1585
|
className: "ml-2 text-sm font-medium text-foreground",
|
|
1534
|
-
children:
|
|
1586
|
+
children: ne
|
|
1535
1587
|
})
|
|
1536
1588
|
]
|
|
1537
1589
|
}), /* @__PURE__ */ H("div", {
|
|
@@ -1546,14 +1598,14 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1546
1598
|
}, e))
|
|
1547
1599
|
})]
|
|
1548
1600
|
}),
|
|
1549
|
-
|
|
1601
|
+
G.length > 0 && /* @__PURE__ */ U("div", {
|
|
1550
1602
|
className: "rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2",
|
|
1551
1603
|
children: [/* @__PURE__ */ H("p", {
|
|
1552
1604
|
className: "mb-1 text-xs font-semibold text-destructive",
|
|
1553
|
-
children: D.overdue.replace("{n}", String(
|
|
1605
|
+
children: D.overdue.replace("{n}", String(G.length))
|
|
1554
1606
|
}), /* @__PURE__ */ H("div", {
|
|
1555
1607
|
className: "flex flex-wrap gap-1.5",
|
|
1556
|
-
children:
|
|
1608
|
+
children: G.map((e) => /* @__PURE__ */ H(vt, {
|
|
1557
1609
|
task: e,
|
|
1558
1610
|
onSelect: g,
|
|
1559
1611
|
resolveAssignee: _,
|
|
@@ -1571,13 +1623,13 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1571
1623
|
}), D.milestones]
|
|
1572
1624
|
}), /* @__PURE__ */ H("div", {
|
|
1573
1625
|
className: "flex flex-wrap gap-1.5",
|
|
1574
|
-
children: O.map((e) => /* @__PURE__ */ H(
|
|
1626
|
+
children: O.map((e) => /* @__PURE__ */ H(_t, { milestone: e }, e.id))
|
|
1575
1627
|
})]
|
|
1576
1628
|
}),
|
|
1577
1629
|
A === "week" ? /* @__PURE__ */ H("div", {
|
|
1578
1630
|
className: "grid grid-cols-7 gap-2",
|
|
1579
|
-
children:
|
|
1580
|
-
let t =
|
|
1631
|
+
children: W.map((e) => {
|
|
1632
|
+
let t = ee.get(ht(e)) ?? [], n = k.get(ht(e)) ?? [], r = p(e);
|
|
1581
1633
|
return /* @__PURE__ */ U("div", {
|
|
1582
1634
|
className: J("flex min-h-32 flex-col rounded-lg border p-2", r ? "border-primary/50 bg-primary/5" : "border-border bg-muted/20"),
|
|
1583
1635
|
children: [/* @__PURE__ */ U("div", {
|
|
@@ -1591,16 +1643,16 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1591
1643
|
})]
|
|
1592
1644
|
}), /* @__PURE__ */ U("div", {
|
|
1593
1645
|
className: "flex flex-col gap-1.5",
|
|
1594
|
-
children: [n.map((e) => /* @__PURE__ */ H(
|
|
1646
|
+
children: [n.map((e) => /* @__PURE__ */ H(_t, {
|
|
1595
1647
|
milestone: e,
|
|
1596
1648
|
compact: !0
|
|
1597
|
-
}, e.id)), t.map((e) => /* @__PURE__ */ H(
|
|
1649
|
+
}, e.id)), t.map((e) => /* @__PURE__ */ H(vt, {
|
|
1598
1650
|
task: e,
|
|
1599
1651
|
onSelect: g,
|
|
1600
1652
|
resolveAssignee: _
|
|
1601
1653
|
}, e.id))]
|
|
1602
1654
|
})]
|
|
1603
|
-
},
|
|
1655
|
+
}, ht(e));
|
|
1604
1656
|
})
|
|
1605
1657
|
}) : /* @__PURE__ */ U("div", {
|
|
1606
1658
|
className: "grid grid-cols-7 gap-1",
|
|
@@ -1615,8 +1667,8 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1615
1667
|
].map((e) => /* @__PURE__ */ H("div", {
|
|
1616
1668
|
className: "px-1 pb-1 text-center text-[10px] font-semibold uppercase text-muted-foreground",
|
|
1617
1669
|
children: e
|
|
1618
|
-
}, e)),
|
|
1619
|
-
let t =
|
|
1670
|
+
}, e)), W.map((e) => {
|
|
1671
|
+
let t = ee.get(ht(e)) ?? [], n = p(e), r = f(e, z);
|
|
1620
1672
|
return /* @__PURE__ */ U("div", {
|
|
1621
1673
|
className: J("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"),
|
|
1622
1674
|
children: [
|
|
@@ -1624,7 +1676,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1624
1676
|
className: J("text-[10px] font-semibold", n ? "text-primary" : "text-muted-foreground"),
|
|
1625
1677
|
children: d(e, "d")
|
|
1626
1678
|
}),
|
|
1627
|
-
t.slice(0, 3).map((e) => /* @__PURE__ */ H(
|
|
1679
|
+
t.slice(0, 3).map((e) => /* @__PURE__ */ H(vt, {
|
|
1628
1680
|
task: e,
|
|
1629
1681
|
onSelect: g,
|
|
1630
1682
|
resolveAssignee: _,
|
|
@@ -1640,17 +1692,17 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1640
1692
|
]
|
|
1641
1693
|
})
|
|
1642
1694
|
]
|
|
1643
|
-
},
|
|
1695
|
+
}, ht(e));
|
|
1644
1696
|
})]
|
|
1645
1697
|
}),
|
|
1646
|
-
|
|
1698
|
+
te.length > 0 && /* @__PURE__ */ U("div", {
|
|
1647
1699
|
className: "rounded-md border border-border bg-muted/20 px-3 py-2",
|
|
1648
1700
|
children: [/* @__PURE__ */ H("p", {
|
|
1649
1701
|
className: "mb-1 text-xs font-semibold text-muted-foreground",
|
|
1650
|
-
children: D.noDueDate.replace("{n}", String(
|
|
1702
|
+
children: D.noDueDate.replace("{n}", String(te.length))
|
|
1651
1703
|
}), /* @__PURE__ */ H("div", {
|
|
1652
1704
|
className: "flex flex-wrap gap-1.5",
|
|
1653
|
-
children:
|
|
1705
|
+
children: te.map((e) => /* @__PURE__ */ H(vt, {
|
|
1654
1706
|
task: e,
|
|
1655
1707
|
onSelect: g,
|
|
1656
1708
|
resolveAssignee: _
|
|
@@ -1660,7 +1712,7 @@ function ht({ projectId: e, priority: t = "ALL", type: i = "ALL", search: o = ""
|
|
|
1660
1712
|
]
|
|
1661
1713
|
});
|
|
1662
1714
|
}
|
|
1663
|
-
function
|
|
1715
|
+
function _t({ milestone: e, compact: t }) {
|
|
1664
1716
|
let n = be(e.dueDate);
|
|
1665
1717
|
return /* @__PURE__ */ U("span", {
|
|
1666
1718
|
className: J("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"),
|
|
@@ -1681,7 +1733,7 @@ function gt({ milestone: e, compact: t }) {
|
|
|
1681
1733
|
]
|
|
1682
1734
|
});
|
|
1683
1735
|
}
|
|
1684
|
-
function
|
|
1736
|
+
function vt({ task: e, onSelect: t, resolveAssignee: n, tone: r, compact: i }) {
|
|
1685
1737
|
let a = e.assigneeId ? n?.(e.assigneeId) : null, o = !!t;
|
|
1686
1738
|
return /* @__PURE__ */ U("button", {
|
|
1687
1739
|
type: "button",
|
|
@@ -1690,12 +1742,12 @@ function _t({ task: e, onSelect: t, resolveAssignee: n, tone: r, compact: i }) {
|
|
|
1690
1742
|
title: e.title,
|
|
1691
1743
|
className: J("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"),
|
|
1692
1744
|
children: [
|
|
1693
|
-
/* @__PURE__ */ H(
|
|
1745
|
+
/* @__PURE__ */ H(Ge, { priority: e.priority }),
|
|
1694
1746
|
/* @__PURE__ */ H("span", {
|
|
1695
1747
|
className: "min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",
|
|
1696
1748
|
children: e.title
|
|
1697
1749
|
}),
|
|
1698
|
-
!i && /* @__PURE__ */ H(
|
|
1750
|
+
!i && /* @__PURE__ */ H(ke, {
|
|
1699
1751
|
id: e.assigneeId,
|
|
1700
1752
|
name: a?.name,
|
|
1701
1753
|
size: "sm"
|
|
@@ -1703,12 +1755,12 @@ function _t({ task: e, onSelect: t, resolveAssignee: n, tone: r, compact: i }) {
|
|
|
1703
1755
|
]
|
|
1704
1756
|
});
|
|
1705
1757
|
}
|
|
1706
|
-
var
|
|
1758
|
+
var yt = {
|
|
1707
1759
|
board: F,
|
|
1708
1760
|
list: L,
|
|
1709
1761
|
timeline: C
|
|
1710
|
-
},
|
|
1711
|
-
function
|
|
1762
|
+
}, bt = "h-8 rounded-md border border-border bg-background px-2 text-xs font-medium text-foreground capitalize transition-colors hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
1763
|
+
function xt({ view: e, onViewChange: t, views: n = [
|
|
1712
1764
|
"board",
|
|
1713
1765
|
"list",
|
|
1714
1766
|
"timeline"
|
|
@@ -1725,7 +1777,7 @@ function bt({ view: e, onViewChange: t, views: n = [
|
|
|
1725
1777
|
role: "tablist",
|
|
1726
1778
|
"aria-label": "Task views",
|
|
1727
1779
|
children: n.map((n) => {
|
|
1728
|
-
let r =
|
|
1780
|
+
let r = yt[n], i = n === e;
|
|
1729
1781
|
return /* @__PURE__ */ U("button", {
|
|
1730
1782
|
type: "button",
|
|
1731
1783
|
role: "tab",
|
|
@@ -1773,11 +1825,11 @@ function bt({ view: e, onViewChange: t, views: n = [
|
|
|
1773
1825
|
value: a,
|
|
1774
1826
|
onChange: (e) => o(e.target.value),
|
|
1775
1827
|
"aria-label": m.priorityLabel,
|
|
1776
|
-
className:
|
|
1828
|
+
className: bt,
|
|
1777
1829
|
children: [/* @__PURE__ */ H("option", {
|
|
1778
1830
|
value: "ALL",
|
|
1779
1831
|
children: m.allPriorities
|
|
1780
|
-
}),
|
|
1832
|
+
}), je.map((e) => /* @__PURE__ */ H("option", {
|
|
1781
1833
|
value: e,
|
|
1782
1834
|
children: m.priority[e]
|
|
1783
1835
|
}, e))]
|
|
@@ -1786,11 +1838,11 @@ function bt({ view: e, onViewChange: t, views: n = [
|
|
|
1786
1838
|
value: s,
|
|
1787
1839
|
onChange: (e) => c(e.target.value),
|
|
1788
1840
|
"aria-label": m.typeLabel,
|
|
1789
|
-
className:
|
|
1841
|
+
className: bt,
|
|
1790
1842
|
children: [/* @__PURE__ */ H("option", {
|
|
1791
1843
|
value: "ALL",
|
|
1792
1844
|
children: m.allTypes
|
|
1793
|
-
}),
|
|
1845
|
+
}), Me.map((e) => /* @__PURE__ */ H("option", {
|
|
1794
1846
|
value: e,
|
|
1795
1847
|
children: m.type[e]
|
|
1796
1848
|
}, e))]
|
|
@@ -1808,50 +1860,50 @@ function bt({ view: e, onViewChange: t, views: n = [
|
|
|
1808
1860
|
})]
|
|
1809
1861
|
});
|
|
1810
1862
|
}
|
|
1811
|
-
var Q = "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", $ = "text-xs font-medium uppercase tracking-wide text-muted-foreground",
|
|
1863
|
+
var Q = "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", $ = "text-xs font-medium uppercase tracking-wide text-muted-foreground", St = {
|
|
1812
1864
|
NONE: "muted",
|
|
1813
1865
|
LOW: "muted",
|
|
1814
1866
|
MEDIUM: "secondary",
|
|
1815
1867
|
HIGH: "accent",
|
|
1816
1868
|
CRITICAL: "destructive"
|
|
1817
1869
|
};
|
|
1818
|
-
function
|
|
1819
|
-
let
|
|
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, className: d }) {
|
|
1871
|
+
let f = te(), p = Y(), m = b(() => new Set(n ?? []), [n]), { data: h, loading: g, error: _ } = K(ue, {
|
|
1820
1872
|
variables: { id: e },
|
|
1821
1873
|
skip: !e
|
|
1822
|
-
}),
|
|
1874
|
+
}), v = h?.planmagnetWorkItem ?? null, { linksByItem: S } = $e(v?.workspaceId, l), C = v ? S.get(v.id) ?? [] : [], [w, T] = x(!1), [E, D] = x(!1), [O, k] = x(""), [A, j] = x(""), [M, N] = x("TASK"), [P, F] = x("BACKLOG"), [I, L] = x("NONE"), [R, z] = x(""), [V, G] = x(""), [re, ae] = x(""), [q, oe] = x("");
|
|
1823
1875
|
y(() => {
|
|
1824
|
-
|
|
1825
|
-
}, [
|
|
1826
|
-
let [
|
|
1827
|
-
if (
|
|
1828
|
-
await
|
|
1876
|
+
v && (k(v.title), j(v.description ?? ""), N(v.type), F(v.status), L(v.priority), z(v.assigneeId ?? ""), G(v.dueDate ? String(v.dueDate).slice(0, 10) : ""), ae((v.labels ?? []).join(", ")), oe(v.storyPoints == null ? "" : String(v.storyPoints)));
|
|
1877
|
+
}, [v]);
|
|
1878
|
+
let [se, { loading: ce, error: de }] = ne(fe), [pe, { loading: me, error: he }] = ne(ge), _e = async () => {
|
|
1879
|
+
if (v) try {
|
|
1880
|
+
await pe({ variables: { id: v.id } }), f.cache.evict({ id: f.cache.identify({
|
|
1829
1881
|
__typename: "WorkItem",
|
|
1830
|
-
id:
|
|
1831
|
-
}) }),
|
|
1882
|
+
id: v.id
|
|
1883
|
+
}) }), f.cache.gc(), f.refetchQueries({ include: [le] }).catch(() => {}), a?.(v.id);
|
|
1832
1884
|
} catch (e) {
|
|
1833
1885
|
o?.(e instanceof Error ? e : Error(String(e)));
|
|
1834
1886
|
}
|
|
1835
|
-
},
|
|
1836
|
-
if (e.preventDefault(), !
|
|
1837
|
-
let t =
|
|
1838
|
-
title:
|
|
1839
|
-
...
|
|
1840
|
-
...
|
|
1841
|
-
...
|
|
1842
|
-
...
|
|
1843
|
-
...
|
|
1844
|
-
...
|
|
1845
|
-
...
|
|
1846
|
-
...
|
|
1887
|
+
}, ve = async (e) => {
|
|
1888
|
+
if (e.preventDefault(), !v) return;
|
|
1889
|
+
let t = re.split(",").map((e) => e.trim()).filter(Boolean), n = q.trim() ? Number(q) : void 0, r = {
|
|
1890
|
+
title: O.trim(),
|
|
1891
|
+
...m.has("description") ? {} : { description: A.trim() },
|
|
1892
|
+
...m.has("type") ? {} : { type: M },
|
|
1893
|
+
...m.has("status") ? {} : { status: P },
|
|
1894
|
+
...m.has("priority") ? {} : { priority: I },
|
|
1895
|
+
...m.has("assignee") ? {} : { assigneeId: R.trim() },
|
|
1896
|
+
...m.has("dueDate") ? {} : { dueDate: ye(V) },
|
|
1897
|
+
...m.has("labels") ? {} : { labels: t },
|
|
1898
|
+
...m.has("storyPoints") || n == null || Number.isNaN(n) ? {} : { storyPoints: n }
|
|
1847
1899
|
};
|
|
1848
1900
|
try {
|
|
1849
|
-
let e = (await
|
|
1850
|
-
id:
|
|
1901
|
+
let e = (await se({ variables: {
|
|
1902
|
+
id: v.id,
|
|
1851
1903
|
input: r
|
|
1852
1904
|
} })).data?.planmagnetUpdateWorkItem;
|
|
1853
1905
|
if (e) {
|
|
1854
|
-
let t =
|
|
1906
|
+
let t = ie();
|
|
1855
1907
|
try {
|
|
1856
1908
|
await t.onTaskSaved?.({
|
|
1857
1909
|
id: e.id,
|
|
@@ -1861,94 +1913,94 @@ function St({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
1861
1913
|
operation: "updated"
|
|
1862
1914
|
});
|
|
1863
1915
|
} catch {}
|
|
1864
|
-
i?.(e),
|
|
1916
|
+
i?.(e), T(!1);
|
|
1865
1917
|
}
|
|
1866
1918
|
} catch (e) {
|
|
1867
1919
|
o?.(e instanceof Error ? e : Error(String(e)));
|
|
1868
1920
|
}
|
|
1869
1921
|
};
|
|
1870
1922
|
if (!e) return /* @__PURE__ */ H("div", {
|
|
1871
|
-
className: J("p-6 text-sm text-destructive",
|
|
1923
|
+
className: J("p-6 text-sm text-destructive", d),
|
|
1872
1924
|
children: "TaskDetail: no work-item id provided."
|
|
1873
1925
|
});
|
|
1874
|
-
if (
|
|
1875
|
-
className: J("flex items-center justify-center p-12",
|
|
1926
|
+
if (g && !h) return /* @__PURE__ */ H("div", {
|
|
1927
|
+
className: J("flex items-center justify-center p-12", d),
|
|
1876
1928
|
children: /* @__PURE__ */ H("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" })
|
|
1877
1929
|
});
|
|
1878
|
-
if (
|
|
1879
|
-
className: J("p-6 text-sm text-destructive",
|
|
1930
|
+
if (_ && !h) return /* @__PURE__ */ U("div", {
|
|
1931
|
+
className: J("p-6 text-sm text-destructive", d),
|
|
1880
1932
|
children: [
|
|
1881
|
-
|
|
1933
|
+
p.errorLoading,
|
|
1882
1934
|
": ",
|
|
1883
|
-
|
|
1935
|
+
_.message
|
|
1884
1936
|
]
|
|
1885
1937
|
});
|
|
1886
|
-
if (!
|
|
1887
|
-
className: J("p-6 text-sm text-muted-foreground",
|
|
1888
|
-
children:
|
|
1938
|
+
if (!v) return /* @__PURE__ */ H("div", {
|
|
1939
|
+
className: J("p-6 text-sm text-muted-foreground", d),
|
|
1940
|
+
children: p.taskNotFound
|
|
1889
1941
|
});
|
|
1890
|
-
let
|
|
1891
|
-
return /* @__PURE__ */ H(
|
|
1892
|
-
className: J("shadow-sm",
|
|
1893
|
-
children: /* @__PURE__ */ U(
|
|
1942
|
+
let be = !t;
|
|
1943
|
+
return /* @__PURE__ */ H(W, {
|
|
1944
|
+
className: J("shadow-sm", d),
|
|
1945
|
+
children: /* @__PURE__ */ U(ee, {
|
|
1894
1946
|
className: "space-y-4 p-6",
|
|
1895
1947
|
children: [
|
|
1896
1948
|
!r && /* @__PURE__ */ U("div", {
|
|
1897
1949
|
className: "flex items-start justify-between gap-4",
|
|
1898
1950
|
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
1899
1951
|
className: "text-xs text-muted-foreground",
|
|
1900
|
-
children:
|
|
1952
|
+
children: v.key
|
|
1901
1953
|
}), /* @__PURE__ */ H("h2", {
|
|
1902
1954
|
className: "text-xl font-semibold text-foreground",
|
|
1903
|
-
children:
|
|
1904
|
-
})] }),
|
|
1955
|
+
children: v.title
|
|
1956
|
+
})] }), be && !w && /* @__PURE__ */ U("div", {
|
|
1905
1957
|
className: "flex shrink-0 items-center gap-2",
|
|
1906
|
-
children: [a && (
|
|
1958
|
+
children: [a && (E ? /* @__PURE__ */ U("span", {
|
|
1907
1959
|
className: "flex items-center gap-1 text-xs",
|
|
1908
1960
|
children: [
|
|
1909
1961
|
/* @__PURE__ */ H("span", {
|
|
1910
1962
|
className: "text-muted-foreground",
|
|
1911
|
-
children:
|
|
1963
|
+
children: p.deletePrompt
|
|
1912
1964
|
}),
|
|
1913
1965
|
/* @__PURE__ */ H("button", {
|
|
1914
1966
|
type: "button",
|
|
1915
|
-
disabled:
|
|
1916
|
-
onClick:
|
|
1967
|
+
disabled: me,
|
|
1968
|
+
onClick: _e,
|
|
1917
1969
|
className: "rounded bg-destructive px-2 py-1 font-medium text-destructive-foreground disabled:opacity-50",
|
|
1918
|
-
children:
|
|
1970
|
+
children: me ? "…" : p.yes
|
|
1919
1971
|
}),
|
|
1920
1972
|
/* @__PURE__ */ H("button", {
|
|
1921
1973
|
type: "button",
|
|
1922
|
-
onClick: () =>
|
|
1974
|
+
onClick: () => D(!1),
|
|
1923
1975
|
className: "rounded bg-muted px-2 py-1 text-muted-foreground",
|
|
1924
|
-
children:
|
|
1976
|
+
children: p.no
|
|
1925
1977
|
})
|
|
1926
1978
|
]
|
|
1927
1979
|
}) : /* @__PURE__ */ H("button", {
|
|
1928
1980
|
type: "button",
|
|
1929
|
-
onClick: () =>
|
|
1930
|
-
title:
|
|
1931
|
-
"aria-label":
|
|
1981
|
+
onClick: () => D(!0),
|
|
1982
|
+
title: p.del,
|
|
1983
|
+
"aria-label": p.del,
|
|
1932
1984
|
className: "rounded-md p-1.5 text-destructive hover:bg-destructive/10",
|
|
1933
1985
|
children: /* @__PURE__ */ H(B, { className: "h-4 w-4" })
|
|
1934
1986
|
})), /* @__PURE__ */ H("button", {
|
|
1935
1987
|
type: "button",
|
|
1936
|
-
onClick: () =>
|
|
1988
|
+
onClick: () => T(!0),
|
|
1937
1989
|
className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground",
|
|
1938
|
-
children:
|
|
1990
|
+
children: p.edit
|
|
1939
1991
|
})]
|
|
1940
1992
|
})]
|
|
1941
1993
|
}),
|
|
1942
|
-
|
|
1994
|
+
he && /* @__PURE__ */ U("p", {
|
|
1943
1995
|
className: "text-sm text-destructive",
|
|
1944
1996
|
children: [
|
|
1945
|
-
|
|
1997
|
+
p.failedToDelete,
|
|
1946
1998
|
": ",
|
|
1947
|
-
|
|
1999
|
+
he.message
|
|
1948
2000
|
]
|
|
1949
2001
|
}),
|
|
1950
|
-
|
|
1951
|
-
onSubmit:
|
|
2002
|
+
w ? /* @__PURE__ */ U("form", {
|
|
2003
|
+
onSubmit: ve,
|
|
1952
2004
|
className: "space-y-4",
|
|
1953
2005
|
children: [
|
|
1954
2006
|
/* @__PURE__ */ U("div", {
|
|
@@ -1956,96 +2008,96 @@ function St({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
1956
2008
|
children: [/* @__PURE__ */ H("label", {
|
|
1957
2009
|
htmlFor: "pm-detail-title",
|
|
1958
2010
|
className: $,
|
|
1959
|
-
children:
|
|
2011
|
+
children: p.title
|
|
1960
2012
|
}), /* @__PURE__ */ H("input", {
|
|
1961
2013
|
id: "pm-detail-title",
|
|
1962
2014
|
className: Q,
|
|
1963
|
-
value:
|
|
1964
|
-
onChange: (e) =>
|
|
2015
|
+
value: O,
|
|
2016
|
+
onChange: (e) => k(e.target.value),
|
|
1965
2017
|
required: !0
|
|
1966
2018
|
})]
|
|
1967
2019
|
}),
|
|
1968
|
-
!
|
|
2020
|
+
!m.has("description") && /* @__PURE__ */ U("div", {
|
|
1969
2021
|
className: "space-y-1",
|
|
1970
2022
|
children: [/* @__PURE__ */ H("label", {
|
|
1971
2023
|
htmlFor: "pm-detail-desc",
|
|
1972
2024
|
className: $,
|
|
1973
|
-
children:
|
|
2025
|
+
children: p.description
|
|
1974
2026
|
}), /* @__PURE__ */ H("textarea", {
|
|
1975
2027
|
id: "pm-detail-desc",
|
|
1976
2028
|
className: J(Q, "min-h-[80px]"),
|
|
1977
|
-
value:
|
|
1978
|
-
onChange: (e) =>
|
|
2029
|
+
value: A,
|
|
2030
|
+
onChange: (e) => j(e.target.value)
|
|
1979
2031
|
})]
|
|
1980
2032
|
}),
|
|
1981
2033
|
/* @__PURE__ */ U("div", {
|
|
1982
2034
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
1983
2035
|
children: [
|
|
1984
|
-
!
|
|
2036
|
+
!m.has("type") && /* @__PURE__ */ U("div", {
|
|
1985
2037
|
className: "space-y-1",
|
|
1986
2038
|
children: [/* @__PURE__ */ H("label", {
|
|
1987
2039
|
htmlFor: "pm-detail-type",
|
|
1988
2040
|
className: $,
|
|
1989
|
-
children:
|
|
2041
|
+
children: p.typeLabel
|
|
1990
2042
|
}), /* @__PURE__ */ H("select", {
|
|
1991
2043
|
id: "pm-detail-type",
|
|
1992
2044
|
className: J(Q, "capitalize"),
|
|
1993
|
-
value:
|
|
1994
|
-
onChange: (e) =>
|
|
1995
|
-
children:
|
|
2045
|
+
value: M,
|
|
2046
|
+
onChange: (e) => N(e.target.value),
|
|
2047
|
+
children: Me.map((e) => /* @__PURE__ */ H("option", {
|
|
1996
2048
|
value: e,
|
|
1997
|
-
children:
|
|
2049
|
+
children: p.type[e]
|
|
1998
2050
|
}, e))
|
|
1999
2051
|
})]
|
|
2000
2052
|
}),
|
|
2001
|
-
!
|
|
2053
|
+
!m.has("status") && /* @__PURE__ */ U("div", {
|
|
2002
2054
|
className: "space-y-1",
|
|
2003
2055
|
children: [/* @__PURE__ */ H("label", {
|
|
2004
2056
|
htmlFor: "pm-detail-status",
|
|
2005
2057
|
className: $,
|
|
2006
|
-
children:
|
|
2058
|
+
children: p.statusLabel
|
|
2007
2059
|
}), /* @__PURE__ */ H("select", {
|
|
2008
2060
|
id: "pm-detail-status",
|
|
2009
2061
|
className: J(Q, "capitalize"),
|
|
2010
|
-
value:
|
|
2011
|
-
onChange: (e) =>
|
|
2012
|
-
children:
|
|
2062
|
+
value: P,
|
|
2063
|
+
onChange: (e) => F(e.target.value),
|
|
2064
|
+
children: Ne.map((e) => /* @__PURE__ */ H("option", {
|
|
2013
2065
|
value: e,
|
|
2014
|
-
children:
|
|
2066
|
+
children: p.status[e]
|
|
2015
2067
|
}, e))
|
|
2016
2068
|
})]
|
|
2017
2069
|
}),
|
|
2018
|
-
!
|
|
2070
|
+
!m.has("priority") && /* @__PURE__ */ U("div", {
|
|
2019
2071
|
className: "space-y-1",
|
|
2020
2072
|
children: [/* @__PURE__ */ H("label", {
|
|
2021
2073
|
htmlFor: "pm-detail-priority",
|
|
2022
2074
|
className: $,
|
|
2023
|
-
children:
|
|
2075
|
+
children: p.priorityLabel
|
|
2024
2076
|
}), /* @__PURE__ */ H("select", {
|
|
2025
2077
|
id: "pm-detail-priority",
|
|
2026
2078
|
className: J(Q, "capitalize"),
|
|
2027
|
-
value:
|
|
2028
|
-
onChange: (e) =>
|
|
2029
|
-
children:
|
|
2079
|
+
value: I,
|
|
2080
|
+
onChange: (e) => L(e.target.value),
|
|
2081
|
+
children: je.map((e) => /* @__PURE__ */ H("option", {
|
|
2030
2082
|
value: e,
|
|
2031
|
-
children:
|
|
2083
|
+
children: p.priority[e]
|
|
2032
2084
|
}, e))
|
|
2033
2085
|
})]
|
|
2034
2086
|
}),
|
|
2035
|
-
!
|
|
2087
|
+
!m.has("assignee") && /* @__PURE__ */ U("div", {
|
|
2036
2088
|
className: "space-y-1",
|
|
2037
2089
|
children: [/* @__PURE__ */ H("label", {
|
|
2038
2090
|
htmlFor: "pm-detail-assignee",
|
|
2039
2091
|
className: $,
|
|
2040
|
-
children:
|
|
2092
|
+
children: p.assigneeLabel
|
|
2041
2093
|
}), c && c.length > 0 ? /* @__PURE__ */ U("select", {
|
|
2042
2094
|
id: "pm-detail-assignee",
|
|
2043
2095
|
className: Q,
|
|
2044
|
-
value:
|
|
2045
|
-
onChange: (e) =>
|
|
2096
|
+
value: R,
|
|
2097
|
+
onChange: (e) => z(e.target.value),
|
|
2046
2098
|
children: [/* @__PURE__ */ H("option", {
|
|
2047
2099
|
value: "",
|
|
2048
|
-
children:
|
|
2100
|
+
children: p.unassigned
|
|
2049
2101
|
}), c.map((e) => /* @__PURE__ */ H("option", {
|
|
2050
2102
|
value: e.id,
|
|
2051
2103
|
children: e.name
|
|
@@ -2053,159 +2105,184 @@ function St({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
2053
2105
|
}) : /* @__PURE__ */ H("input", {
|
|
2054
2106
|
id: "pm-detail-assignee",
|
|
2055
2107
|
className: Q,
|
|
2056
|
-
value:
|
|
2057
|
-
onChange: (e) =>
|
|
2058
|
-
placeholder:
|
|
2108
|
+
value: R,
|
|
2109
|
+
onChange: (e) => z(e.target.value),
|
|
2110
|
+
placeholder: p.assigneePlaceholder
|
|
2059
2111
|
})]
|
|
2060
2112
|
}),
|
|
2061
|
-
!
|
|
2113
|
+
!m.has("dueDate") && /* @__PURE__ */ U("div", {
|
|
2062
2114
|
className: "space-y-1",
|
|
2063
2115
|
children: [/* @__PURE__ */ H("label", {
|
|
2064
2116
|
htmlFor: "pm-detail-due",
|
|
2065
2117
|
className: $,
|
|
2066
|
-
children:
|
|
2118
|
+
children: p.dueDateLabel
|
|
2067
2119
|
}), /* @__PURE__ */ H("input", {
|
|
2068
2120
|
id: "pm-detail-due",
|
|
2069
2121
|
type: "date",
|
|
2070
2122
|
className: Q,
|
|
2071
|
-
value:
|
|
2072
|
-
onChange: (e) =>
|
|
2123
|
+
value: V,
|
|
2124
|
+
onChange: (e) => G(e.target.value)
|
|
2073
2125
|
})]
|
|
2074
2126
|
}),
|
|
2075
|
-
!
|
|
2127
|
+
!m.has("storyPoints") && /* @__PURE__ */ U("div", {
|
|
2076
2128
|
className: "space-y-1",
|
|
2077
2129
|
children: [/* @__PURE__ */ H("label", {
|
|
2078
2130
|
htmlFor: "pm-detail-points",
|
|
2079
2131
|
className: $,
|
|
2080
|
-
children:
|
|
2132
|
+
children: p.storyPointsLabel
|
|
2081
2133
|
}), /* @__PURE__ */ H("input", {
|
|
2082
2134
|
id: "pm-detail-points",
|
|
2083
2135
|
type: "number",
|
|
2084
2136
|
min: 0,
|
|
2085
2137
|
className: Q,
|
|
2086
|
-
value:
|
|
2087
|
-
onChange: (e) =>
|
|
2138
|
+
value: q,
|
|
2139
|
+
onChange: (e) => oe(e.target.value)
|
|
2088
2140
|
})]
|
|
2089
2141
|
})
|
|
2090
2142
|
]
|
|
2091
2143
|
}),
|
|
2092
|
-
!
|
|
2144
|
+
!m.has("labels") && /* @__PURE__ */ U("div", {
|
|
2093
2145
|
className: "space-y-1",
|
|
2094
2146
|
children: [/* @__PURE__ */ H("label", {
|
|
2095
2147
|
htmlFor: "pm-detail-labels",
|
|
2096
2148
|
className: $,
|
|
2097
|
-
children:
|
|
2149
|
+
children: p.labelsLabel
|
|
2098
2150
|
}), /* @__PURE__ */ H("input", {
|
|
2099
2151
|
id: "pm-detail-labels",
|
|
2100
2152
|
className: Q,
|
|
2101
|
-
value:
|
|
2102
|
-
onChange: (e) =>
|
|
2103
|
-
placeholder:
|
|
2153
|
+
value: re,
|
|
2154
|
+
onChange: (e) => ae(e.target.value),
|
|
2155
|
+
placeholder: p.labelsPlaceholder
|
|
2104
2156
|
})]
|
|
2105
2157
|
}),
|
|
2106
|
-
|
|
2158
|
+
de && /* @__PURE__ */ U("p", {
|
|
2107
2159
|
className: "text-sm text-destructive",
|
|
2108
2160
|
children: [
|
|
2109
|
-
|
|
2161
|
+
p.failedToSave,
|
|
2110
2162
|
": ",
|
|
2111
|
-
|
|
2163
|
+
de.message
|
|
2112
2164
|
]
|
|
2113
2165
|
}),
|
|
2114
2166
|
/* @__PURE__ */ U("div", {
|
|
2115
2167
|
className: "flex items-center justify-end gap-2",
|
|
2116
2168
|
children: [/* @__PURE__ */ H("button", {
|
|
2117
2169
|
type: "button",
|
|
2118
|
-
onClick: () =>
|
|
2170
|
+
onClick: () => T(!1),
|
|
2119
2171
|
className: "rounded-md bg-muted px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-muted/70",
|
|
2120
|
-
children:
|
|
2172
|
+
children: p.cancel
|
|
2121
2173
|
}), /* @__PURE__ */ H("button", {
|
|
2122
2174
|
type: "submit",
|
|
2123
|
-
disabled:
|
|
2124
|
-
className: J("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (
|
|
2125
|
-
children:
|
|
2175
|
+
disabled: ce || !O.trim(),
|
|
2176
|
+
className: J("rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", (ce || !O.trim()) && "cursor-not-allowed opacity-50"),
|
|
2177
|
+
children: ce ? p.saving : p.save
|
|
2126
2178
|
})]
|
|
2127
2179
|
})
|
|
2128
2180
|
]
|
|
2129
2181
|
}) : /* @__PURE__ */ U("dl", {
|
|
2130
2182
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
2131
2183
|
children: [
|
|
2132
|
-
!
|
|
2133
|
-
label:
|
|
2134
|
-
children: /* @__PURE__ */ H(
|
|
2184
|
+
!m.has("type") && /* @__PURE__ */ H(wt, {
|
|
2185
|
+
label: p.typeLabel,
|
|
2186
|
+
children: /* @__PURE__ */ H(we, {
|
|
2135
2187
|
variant: "secondary",
|
|
2136
|
-
children:
|
|
2188
|
+
children: p.type[v.type]
|
|
2137
2189
|
})
|
|
2138
2190
|
}),
|
|
2139
|
-
!
|
|
2140
|
-
label:
|
|
2191
|
+
!m.has("status") && /* @__PURE__ */ H(wt, {
|
|
2192
|
+
label: p.statusLabel,
|
|
2141
2193
|
children: /* @__PURE__ */ H("span", {
|
|
2142
2194
|
className: "capitalize text-foreground",
|
|
2143
|
-
children:
|
|
2195
|
+
children: p.status[v.status]
|
|
2144
2196
|
})
|
|
2145
2197
|
}),
|
|
2146
|
-
!
|
|
2147
|
-
label:
|
|
2148
|
-
children: /* @__PURE__ */ H(
|
|
2149
|
-
variant:
|
|
2150
|
-
children:
|
|
2198
|
+
!m.has("priority") && /* @__PURE__ */ H(wt, {
|
|
2199
|
+
label: p.priorityLabel,
|
|
2200
|
+
children: /* @__PURE__ */ H(we, {
|
|
2201
|
+
variant: St[v.priority],
|
|
2202
|
+
children: p.priority[v.priority]
|
|
2151
2203
|
})
|
|
2152
2204
|
}),
|
|
2153
|
-
!
|
|
2154
|
-
label:
|
|
2155
|
-
children:
|
|
2205
|
+
!m.has("assignee") && /* @__PURE__ */ H(wt, {
|
|
2206
|
+
label: p.assigneeLabel,
|
|
2207
|
+
children: v.assigneeId ? /* @__PURE__ */ U("span", {
|
|
2156
2208
|
className: "flex items-center gap-1.5",
|
|
2157
|
-
children: [/* @__PURE__ */ H(
|
|
2158
|
-
id:
|
|
2159
|
-
name: s?.(
|
|
2209
|
+
children: [/* @__PURE__ */ H(ke, {
|
|
2210
|
+
id: v.assigneeId,
|
|
2211
|
+
name: s?.(v.assigneeId)?.name,
|
|
2160
2212
|
size: "sm"
|
|
2161
2213
|
}), /* @__PURE__ */ H("span", {
|
|
2162
2214
|
className: "text-foreground",
|
|
2163
|
-
children: s?.(
|
|
2215
|
+
children: s?.(v.assigneeId)?.name ?? p.assigned
|
|
2164
2216
|
})]
|
|
2165
2217
|
}) : /* @__PURE__ */ H("span", {
|
|
2166
2218
|
className: "text-muted-foreground",
|
|
2167
|
-
children:
|
|
2219
|
+
children: p.unassigned
|
|
2168
2220
|
})
|
|
2169
2221
|
}),
|
|
2170
|
-
!
|
|
2171
|
-
label:
|
|
2222
|
+
!m.has("dueDate") && /* @__PURE__ */ H(wt, {
|
|
2223
|
+
label: p.dueDateLabel,
|
|
2172
2224
|
children: /* @__PURE__ */ H("span", {
|
|
2173
2225
|
className: "text-foreground",
|
|
2174
|
-
children:
|
|
2226
|
+
children: xe(v.dueDate) ?? "—"
|
|
2175
2227
|
})
|
|
2176
2228
|
}),
|
|
2177
|
-
!
|
|
2178
|
-
label:
|
|
2229
|
+
!m.has("storyPoints") && /* @__PURE__ */ H(wt, {
|
|
2230
|
+
label: p.storyPointsLabel,
|
|
2179
2231
|
children: /* @__PURE__ */ H("span", {
|
|
2180
2232
|
className: "text-foreground",
|
|
2181
|
-
children:
|
|
2233
|
+
children: v.storyPoints ?? 0
|
|
2182
2234
|
})
|
|
2183
2235
|
}),
|
|
2184
|
-
!
|
|
2236
|
+
!m.has("description") && /* @__PURE__ */ U("div", {
|
|
2185
2237
|
className: "sm:col-span-2",
|
|
2186
2238
|
children: [/* @__PURE__ */ H("dt", {
|
|
2187
2239
|
className: $,
|
|
2188
|
-
children:
|
|
2240
|
+
children: p.description
|
|
2189
2241
|
}), /* @__PURE__ */ H("dd", {
|
|
2190
2242
|
className: "mt-1 whitespace-pre-wrap text-sm text-foreground",
|
|
2191
|
-
children:
|
|
2243
|
+
children: v.description || "—"
|
|
2192
2244
|
})]
|
|
2193
2245
|
}),
|
|
2194
|
-
!
|
|
2246
|
+
!m.has("labels") && /* @__PURE__ */ U("div", {
|
|
2195
2247
|
className: "sm:col-span-2",
|
|
2196
2248
|
children: [/* @__PURE__ */ H("dt", {
|
|
2197
2249
|
className: $,
|
|
2198
|
-
children:
|
|
2250
|
+
children: p.labelsLabel
|
|
2199
2251
|
}), /* @__PURE__ */ H("dd", {
|
|
2200
2252
|
className: "mt-1 flex flex-wrap gap-1",
|
|
2201
|
-
children: (
|
|
2253
|
+
children: (v.labels ?? []).length === 0 ? /* @__PURE__ */ H("span", {
|
|
2202
2254
|
className: "text-sm text-muted-foreground",
|
|
2203
2255
|
children: "—"
|
|
2204
|
-
}) :
|
|
2256
|
+
}) : v.labels.map((e) => /* @__PURE__ */ H("span", {
|
|
2205
2257
|
className: "rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",
|
|
2206
2258
|
children: e
|
|
2207
2259
|
}, e))
|
|
2208
2260
|
})]
|
|
2261
|
+
}),
|
|
2262
|
+
C.length > 0 && /* @__PURE__ */ U("div", {
|
|
2263
|
+
className: "sm:col-span-2",
|
|
2264
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
2265
|
+
className: $,
|
|
2266
|
+
children: p.linkedRecordsLabel
|
|
2267
|
+
}), /* @__PURE__ */ H("dd", {
|
|
2268
|
+
className: "mt-1 flex flex-wrap gap-1.5",
|
|
2269
|
+
children: C.map((e) => /* @__PURE__ */ H(Fe, {
|
|
2270
|
+
link: e,
|
|
2271
|
+
renderIcon: u
|
|
2272
|
+
}, e.id))
|
|
2273
|
+
})]
|
|
2274
|
+
}),
|
|
2275
|
+
(v.createdAt || v.updatedAt) && /* @__PURE__ */ U("div", {
|
|
2276
|
+
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: [v.createdAt && /* @__PURE__ */ U("span", { children: [
|
|
2278
|
+
p.createdLabel,
|
|
2279
|
+
" ",
|
|
2280
|
+
xe(v.createdAt)
|
|
2281
|
+
] }), v.updatedAt && /* @__PURE__ */ U("span", { children: [
|
|
2282
|
+
p.updatedLabel,
|
|
2283
|
+
" ",
|
|
2284
|
+
xe(v.updatedAt)
|
|
2285
|
+
] })]
|
|
2209
2286
|
})
|
|
2210
2287
|
]
|
|
2211
2288
|
})
|
|
@@ -2213,7 +2290,7 @@ function St({ id: e, readonly: t, hiddenFields: n, hideHeader: r, onUpdated: i,
|
|
|
2213
2290
|
})
|
|
2214
2291
|
});
|
|
2215
2292
|
}
|
|
2216
|
-
function
|
|
2293
|
+
function wt({ label: e, children: t }) {
|
|
2217
2294
|
return /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("dt", {
|
|
2218
2295
|
className: $,
|
|
2219
2296
|
children: e
|
|
@@ -2222,48 +2299,50 @@ function Ct({ label: e, children: t }) {
|
|
|
2222
2299
|
children: t
|
|
2223
2300
|
})] });
|
|
2224
2301
|
}
|
|
2225
|
-
function
|
|
2226
|
-
let
|
|
2302
|
+
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 = q(), 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);
|
|
2227
2304
|
y(() => {
|
|
2228
|
-
|
|
2229
|
-
}, [
|
|
2230
|
-
let
|
|
2231
|
-
|
|
2232
|
-
}, [
|
|
2233
|
-
|
|
2305
|
+
h && V(h);
|
|
2306
|
+
}, [h]);
|
|
2307
|
+
let W = _(() => {
|
|
2308
|
+
E.refetchQueries({ include: [le] }).catch(() => {});
|
|
2309
|
+
}, [E]), ee = _((e) => {
|
|
2310
|
+
W(), z(!1), v?.({
|
|
2234
2311
|
workItem: e,
|
|
2235
2312
|
operation: "created"
|
|
2236
2313
|
});
|
|
2237
|
-
}, [
|
|
2238
|
-
|
|
2314
|
+
}, [W, v]), G = _((e) => {
|
|
2315
|
+
W(), v?.({
|
|
2239
2316
|
workItem: e,
|
|
2240
2317
|
operation: "updated"
|
|
2241
2318
|
});
|
|
2242
|
-
}, [
|
|
2243
|
-
|
|
2244
|
-
}, []),
|
|
2245
|
-
|
|
2246
|
-
}, []),
|
|
2247
|
-
if (!
|
|
2248
|
-
className: J("p-6 text-sm text-destructive",
|
|
2319
|
+
}, [W, v]), ne = _(() => {
|
|
2320
|
+
V(null);
|
|
2321
|
+
}, []), K = _((e) => {
|
|
2322
|
+
V(e.id);
|
|
2323
|
+
}, []), re = _((e) => V(e), []);
|
|
2324
|
+
if (!T) return /* @__PURE__ */ H("div", {
|
|
2325
|
+
className: J("p-6 text-sm text-destructive", C),
|
|
2249
2326
|
children: "TasksPage: no workspaceId provided (prop or PlanMagnetProvider)."
|
|
2250
2327
|
});
|
|
2251
|
-
let ie = !i && !!t, ae =
|
|
2252
|
-
workspaceId:
|
|
2328
|
+
let ie = !i && !!t, ae = R && b === "inline", oe = B != null && S === "inline", se = /* @__PURE__ */ H(it, {
|
|
2329
|
+
workspaceId: T,
|
|
2253
2330
|
projectId: t,
|
|
2254
|
-
assigneeOptions:
|
|
2331
|
+
assigneeOptions: f,
|
|
2255
2332
|
hiddenFields: a,
|
|
2256
2333
|
onCreated: ee,
|
|
2257
|
-
onCancel: () =>
|
|
2258
|
-
}),
|
|
2259
|
-
id:
|
|
2334
|
+
onCancel: () => z(!1)
|
|
2335
|
+
}), ce = B == null ? null : /* @__PURE__ */ H(Ct, {
|
|
2336
|
+
id: B,
|
|
2260
2337
|
readonly: i,
|
|
2261
2338
|
hiddenFields: a,
|
|
2262
|
-
resolveAssignee:
|
|
2263
|
-
assigneeOptions:
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2339
|
+
resolveAssignee: l,
|
|
2340
|
+
assigneeOptions: f,
|
|
2341
|
+
linkSourceProduct: u,
|
|
2342
|
+
renderLinkIcon: d,
|
|
2343
|
+
onUpdated: G,
|
|
2344
|
+
onDeleted: ne
|
|
2345
|
+
}), ue = M === "ALL" ? void 0 : M, de = P === "ALL" ? void 0 : P, fe = I && p ? p : void 0, pe = u ? [
|
|
2267
2346
|
"title",
|
|
2268
2347
|
"status",
|
|
2269
2348
|
"priority",
|
|
@@ -2271,81 +2350,82 @@ function wt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2271
2350
|
"dueDate",
|
|
2272
2351
|
"linkedRecord"
|
|
2273
2352
|
] : void 0;
|
|
2274
|
-
return /* @__PURE__ */ H(
|
|
2275
|
-
value:
|
|
2353
|
+
return /* @__PURE__ */ H(Re, {
|
|
2354
|
+
value: D,
|
|
2276
2355
|
children: /* @__PURE__ */ U("div", {
|
|
2277
|
-
className: J("space-y-4 p-6",
|
|
2356
|
+
className: J("space-y-4 p-6", C),
|
|
2278
2357
|
children: [
|
|
2279
|
-
|
|
2358
|
+
g && /* @__PURE__ */ H("div", {
|
|
2280
2359
|
className: "min-w-0",
|
|
2281
|
-
children: typeof
|
|
2360
|
+
children: typeof g == "string" ? /* @__PURE__ */ H("h1", {
|
|
2282
2361
|
className: "truncate text-2xl font-semibold text-foreground",
|
|
2283
|
-
children:
|
|
2284
|
-
}) :
|
|
2362
|
+
children: g
|
|
2363
|
+
}) : g
|
|
2285
2364
|
}),
|
|
2286
|
-
/* @__PURE__ */ H(
|
|
2287
|
-
view:
|
|
2288
|
-
onViewChange:
|
|
2365
|
+
/* @__PURE__ */ H(xt, {
|
|
2366
|
+
view: O,
|
|
2367
|
+
onViewChange: k,
|
|
2289
2368
|
views: o,
|
|
2290
|
-
search:
|
|
2291
|
-
onSearchChange:
|
|
2292
|
-
priority:
|
|
2293
|
-
onPriorityChange:
|
|
2294
|
-
type:
|
|
2295
|
-
onTypeChange:
|
|
2296
|
-
onNewTask: () =>
|
|
2369
|
+
search: A,
|
|
2370
|
+
onSearchChange: j,
|
|
2371
|
+
priority: M,
|
|
2372
|
+
onPriorityChange: N,
|
|
2373
|
+
type: P,
|
|
2374
|
+
onTypeChange: F,
|
|
2375
|
+
onNewTask: () => z(!0),
|
|
2297
2376
|
canCreate: ie,
|
|
2298
|
-
mine:
|
|
2299
|
-
onMineChange:
|
|
2377
|
+
mine: I,
|
|
2378
|
+
onMineChange: p ? L : void 0
|
|
2300
2379
|
}),
|
|
2301
2380
|
ae && /* @__PURE__ */ H("div", { children: se }),
|
|
2302
|
-
|
|
2303
|
-
workspaceId:
|
|
2381
|
+
O === "board" && /* @__PURE__ */ H(et, {
|
|
2382
|
+
workspaceId: T,
|
|
2304
2383
|
projectId: n,
|
|
2305
2384
|
columns: r,
|
|
2306
2385
|
readonly: i,
|
|
2386
|
+
confirmMove: c,
|
|
2307
2387
|
hideHeader: !0,
|
|
2308
|
-
priority:
|
|
2309
|
-
type:
|
|
2310
|
-
search:
|
|
2311
|
-
assigneeId:
|
|
2388
|
+
priority: M,
|
|
2389
|
+
type: P,
|
|
2390
|
+
search: A,
|
|
2391
|
+
assigneeId: fe,
|
|
2312
2392
|
hiddenFields: a,
|
|
2313
|
-
resolveAssignee:
|
|
2314
|
-
linkSourceProduct:
|
|
2315
|
-
renderLinkIcon:
|
|
2316
|
-
onTaskClick:
|
|
2393
|
+
resolveAssignee: l,
|
|
2394
|
+
linkSourceProduct: u,
|
|
2395
|
+
renderLinkIcon: d,
|
|
2396
|
+
onTaskClick: K
|
|
2317
2397
|
}),
|
|
2318
|
-
|
|
2319
|
-
workspaceId:
|
|
2398
|
+
O === "list" && /* @__PURE__ */ H(ut, {
|
|
2399
|
+
workspaceId: T,
|
|
2320
2400
|
projectId: n,
|
|
2321
|
-
priority:
|
|
2322
|
-
type:
|
|
2323
|
-
search:
|
|
2324
|
-
assigneeId:
|
|
2401
|
+
priority: ue,
|
|
2402
|
+
type: de,
|
|
2403
|
+
search: A || void 0,
|
|
2404
|
+
assigneeId: fe,
|
|
2325
2405
|
hideHeader: !0,
|
|
2326
|
-
resolveAssignee:
|
|
2327
|
-
linkSourceProduct:
|
|
2328
|
-
renderLinkIcon:
|
|
2329
|
-
columns:
|
|
2330
|
-
onSelect:
|
|
2406
|
+
resolveAssignee: l,
|
|
2407
|
+
linkSourceProduct: u,
|
|
2408
|
+
renderLinkIcon: d,
|
|
2409
|
+
columns: pe ? [...pe] : void 0,
|
|
2410
|
+
onSelect: re
|
|
2331
2411
|
}),
|
|
2332
|
-
|
|
2333
|
-
workspaceId:
|
|
2412
|
+
O === "timeline" && /* @__PURE__ */ H(gt, {
|
|
2413
|
+
workspaceId: T,
|
|
2334
2414
|
projectId: n,
|
|
2335
|
-
priority:
|
|
2336
|
-
type:
|
|
2337
|
-
search:
|
|
2338
|
-
assigneeId:
|
|
2339
|
-
resolveAssignee:
|
|
2340
|
-
onSelect:
|
|
2415
|
+
priority: M,
|
|
2416
|
+
type: P,
|
|
2417
|
+
search: A,
|
|
2418
|
+
assigneeId: fe,
|
|
2419
|
+
resolveAssignee: l,
|
|
2420
|
+
onSelect: re
|
|
2341
2421
|
}),
|
|
2342
2422
|
oe && /* @__PURE__ */ H("div", {
|
|
2343
2423
|
className: "pb-6",
|
|
2344
|
-
children:
|
|
2424
|
+
children: ce
|
|
2345
2425
|
}),
|
|
2346
|
-
|
|
2347
|
-
open:
|
|
2348
|
-
onClose: () =>
|
|
2426
|
+
b === "modal" && /* @__PURE__ */ H(Ye, {
|
|
2427
|
+
open: R,
|
|
2428
|
+
onClose: () => z(!1),
|
|
2349
2429
|
ariaLabel: "Create task",
|
|
2350
2430
|
className: "max-w-xl",
|
|
2351
2431
|
children: /* @__PURE__ */ H("div", {
|
|
@@ -2353,13 +2433,13 @@ function wt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2353
2433
|
children: se
|
|
2354
2434
|
})
|
|
2355
2435
|
}),
|
|
2356
|
-
|
|
2357
|
-
open:
|
|
2358
|
-
onClose: () =>
|
|
2436
|
+
S === "drawer" && /* @__PURE__ */ H(Xe, {
|
|
2437
|
+
open: B != null,
|
|
2438
|
+
onClose: () => V(null),
|
|
2359
2439
|
ariaLabel: "Task detail",
|
|
2360
2440
|
children: /* @__PURE__ */ H("div", {
|
|
2361
2441
|
className: "p-2 pt-8",
|
|
2362
|
-
children:
|
|
2442
|
+
children: ce
|
|
2363
2443
|
})
|
|
2364
2444
|
})
|
|
2365
2445
|
]
|
|
@@ -2367,6 +2447,6 @@ function wt({ workspaceId: e, projectId: t, boardProjectId: n, columns: r, reado
|
|
|
2367
2447
|
});
|
|
2368
2448
|
}
|
|
2369
2449
|
//#endregion
|
|
2370
|
-
export {
|
|
2450
|
+
export { it as CreateTaskCore, Tt as TasksPageCore };
|
|
2371
2451
|
|
|
2372
2452
|
//# sourceMappingURL=index.js.map
|