@burdenoff/microfe-planmagnet 2026.927.6 → 2026.928.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +58 -54
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +313 -306
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.js +47 -40
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -1
- package/dist/planmagnet/controls/WorkItemControls.d.ts +9 -0
- package/dist/planmagnet/controls/WorkItemControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/WorkItemControls.js +87 -59
- package/dist/planmagnet/controls/WorkItemControls.js.map +1 -1
- package/dist/planmagnet/hooks/useProjectWorkflow.d.ts +32 -0
- package/dist/planmagnet/hooks/useProjectWorkflow.d.ts.map +1 -0
- package/dist/planmagnet/hooks/useProjectWorkflow.js +44 -0
- package/dist/planmagnet/hooks/useProjectWorkflow.js.map +1 -0
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js +261 -0
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js.map +1 -0
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +8 -9
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { PersonName as n } from "../people/People.js";
|
|
3
3
|
import { throwOnError as r } from "../utils/mutationResult.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { allowedTargets as i, useProjectWorkflow as a, workflowLabel as o } from "../hooks/useProjectWorkflow.js";
|
|
5
|
+
import { createContext as s, useContext as c, useState as l } from "react";
|
|
6
|
+
import { ChevronLeft as u, ChevronRight as d, LayoutGrid as f, Pencil as p, Plus as m } from "lucide-react";
|
|
7
|
+
import { gql as h } from "@apollo/client";
|
|
8
|
+
import { useApolloClient as g, useMutation as _, useQuery as v } from "@apollo/client/react";
|
|
9
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
|
+
import { AlertDialog as x, AlertDialogAction as S, AlertDialogCancel as ee, AlertDialogContent as C, AlertDialogDescription as w, AlertDialogFooter as te, AlertDialogHeader as T, AlertDialogTitle as E, AlertDialogTrigger as D, Button as O, Card as k, CardContent as ne, Input as A, ResponsiveDialog as re, ResponsiveDialogContent as ie, ResponsiveDialogDescription as j, ResponsiveDialogFooter as M, ResponsiveDialogHeader as N, ResponsiveDialogTitle as P, ResponsiveDialogTrigger as F } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/planmagnet/board/ProjectBoard.tsx
|
|
11
|
-
var
|
|
12
|
+
var I = [
|
|
12
13
|
"BACKLOG",
|
|
13
14
|
"TODO",
|
|
14
15
|
"IN_PROGRESS",
|
|
@@ -16,7 +17,10 @@ var M = [
|
|
|
16
17
|
"TESTING",
|
|
17
18
|
"DONE",
|
|
18
19
|
"CANCELLED"
|
|
19
|
-
],
|
|
20
|
+
], L = s(null), R = () => {
|
|
21
|
+
let e = c(L);
|
|
22
|
+
return (t) => o(e, t);
|
|
23
|
+
}, z = (e) => e.charAt(0) + e.slice(1).toLowerCase().replace(/_/g, " "), B = 100, V = h`
|
|
20
24
|
query ProjectBoards($workspaceId: ID!, $projectId: String) {
|
|
21
25
|
planmagnetBoards(
|
|
22
26
|
workspaceId: $workspaceId
|
|
@@ -30,7 +34,7 @@ var M = [
|
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
|
-
`,
|
|
37
|
+
`, H = h`
|
|
34
38
|
query ProjectBoardColumnPage($boardId: ID!, $columnId: ID!, $after: String) {
|
|
35
39
|
planmagnetBoardColumnCards(
|
|
36
40
|
boardId: $boardId
|
|
@@ -53,7 +57,7 @@ var M = [
|
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
|
-
`,
|
|
60
|
+
`, U = h`
|
|
57
61
|
query ProjectBoard($id: ID!) {
|
|
58
62
|
planmagnetBoard(id: $id) {
|
|
59
63
|
id
|
|
@@ -85,110 +89,110 @@ var M = [
|
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
|
-
`,
|
|
92
|
+
`, W = h`
|
|
89
93
|
mutation ProjectBoardMoveCard($boardId: ID!, $input: PlanmagnetMoveCardInput!) {
|
|
90
94
|
planmagnetMoveCard(boardId: $boardId, input: $input) {
|
|
91
95
|
id
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
|
-
`,
|
|
98
|
+
`, G = h`
|
|
95
99
|
mutation ProjectBoardCreate($input: PlanmagnetCreateBoardInput!) {
|
|
96
100
|
planmagnetCreateBoard(input: $input) {
|
|
97
101
|
id
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
|
-
`,
|
|
104
|
+
`, K = h`
|
|
101
105
|
mutation ProjectBoardCreateColumn($input: PlanmagnetCreateBoardColumnInput!) {
|
|
102
106
|
planmagnetCreateBoardColumn(input: $input) {
|
|
103
107
|
id
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
|
-
`,
|
|
110
|
+
`, q = h`
|
|
107
111
|
mutation ProjectBoardUpdateColumn($id: ID!, $input: PlanmagnetUpdateBoardColumnInput!) {
|
|
108
112
|
planmagnetUpdateBoardColumn(id: $id, input: $input) {
|
|
109
113
|
id
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
|
-
`,
|
|
116
|
+
`, ae = h`
|
|
113
117
|
mutation ProjectBoardDeleteColumn($id: ID!) {
|
|
114
118
|
planmagnetDeleteBoardColumn(id: $id)
|
|
115
119
|
}
|
|
116
|
-
`,
|
|
120
|
+
`, oe = h`
|
|
117
121
|
mutation ProjectBoardReorder($boardId: ID!, $input: PlanmagnetReorderColumnsInput!) {
|
|
118
122
|
planmagnetReorderColumns(boardId: $boardId, input: $input) {
|
|
119
123
|
id
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
|
-
`,
|
|
126
|
+
`, J = [
|
|
123
127
|
"ProjectBoard",
|
|
124
128
|
"ProjectBoards",
|
|
125
129
|
"GetWorkItems",
|
|
126
130
|
"GetWorkItemCounts",
|
|
127
131
|
"GetDashboardData"
|
|
128
|
-
],
|
|
132
|
+
], Y = [
|
|
129
133
|
"CRITICAL",
|
|
130
134
|
"HIGH",
|
|
131
135
|
"MEDIUM",
|
|
132
136
|
"LOW",
|
|
133
137
|
"NONE"
|
|
134
|
-
],
|
|
135
|
-
function
|
|
136
|
-
return e ? Math.max(0, Math.floor((t - new Date(e).getTime()) /
|
|
138
|
+
], se = 864e5;
|
|
139
|
+
function X(e, t) {
|
|
140
|
+
return e ? Math.max(0, Math.floor((t - new Date(e).getTime()) / se)) : null;
|
|
137
141
|
}
|
|
138
|
-
function
|
|
142
|
+
function ce(e) {
|
|
139
143
|
return e >= 14 ? "text-destructive font-medium" : e >= 7 ? "text-status-warning-text" : "text-muted-foreground";
|
|
140
144
|
}
|
|
141
|
-
function
|
|
145
|
+
function Z(e, t) {
|
|
142
146
|
return t === "assignee" ? e.assigneeId ?? "" : t === "priority" ? e.priority || "NONE" : "";
|
|
143
147
|
}
|
|
144
|
-
var
|
|
145
|
-
function
|
|
146
|
-
return /* @__PURE__ */
|
|
148
|
+
var Q = (e, t) => e instanceof Error ? e.message : t;
|
|
149
|
+
function $({ message: e }) {
|
|
150
|
+
return /* @__PURE__ */ y("p", {
|
|
147
151
|
role: "alert",
|
|
148
152
|
className: "text-sm text-destructive",
|
|
149
153
|
children: e
|
|
150
154
|
});
|
|
151
155
|
}
|
|
152
|
-
function
|
|
153
|
-
let { workspaceId:
|
|
156
|
+
function le({ projectId: t, projectName: n }) {
|
|
157
|
+
let { workspaceId: i } = e(), o = g(), [s, c] = l(null), [u, d] = l(null), [p] = l(() => Date.now()), [h, x] = l("none"), [S, ee] = l({
|
|
154
158
|
key: null,
|
|
155
159
|
byColumn: {}
|
|
156
|
-
}), [
|
|
160
|
+
}), [C, w] = l(null), te = a(t), { data: T, loading: E } = v(V, {
|
|
157
161
|
variables: {
|
|
158
|
-
workspaceId:
|
|
162
|
+
workspaceId: i,
|
|
159
163
|
projectId: t
|
|
160
164
|
},
|
|
161
|
-
skip: !
|
|
162
|
-
}),
|
|
163
|
-
variables: { id:
|
|
164
|
-
skip: !
|
|
165
|
-
}),
|
|
166
|
-
let t =
|
|
165
|
+
skip: !i
|
|
166
|
+
}), D = T?.planmagnetBoards.items ?? [], A = (s && D.some((e) => e.id === s) ? s : null) ?? D.find((e) => e.isDefault)?.id ?? D[0]?.id ?? null, { data: re, loading: ie } = v(U, {
|
|
167
|
+
variables: { id: A },
|
|
168
|
+
skip: !A
|
|
169
|
+
}), j = re?.planmagnetBoard ?? null, M = S.key === j ? S.byColumn : {}, N = (e) => {
|
|
170
|
+
let t = M[e.id];
|
|
167
171
|
return {
|
|
168
172
|
items: t ? [...e.cards.items, ...t.items] : e.cards.items,
|
|
169
173
|
pageInfo: t ? t.pageInfo : e.cards.pageInfo,
|
|
170
174
|
totalCount: e.cards.totalCount
|
|
171
175
|
};
|
|
172
|
-
},
|
|
173
|
-
let t =
|
|
174
|
-
if (!(!
|
|
175
|
-
|
|
176
|
+
}, P = async (e) => {
|
|
177
|
+
let t = N(e).pageInfo.endCursor;
|
|
178
|
+
if (!(!j || !t)) {
|
|
179
|
+
d(null), w(e.id);
|
|
176
180
|
try {
|
|
177
181
|
let n = await o.query({
|
|
178
|
-
query:
|
|
182
|
+
query: H,
|
|
179
183
|
variables: {
|
|
180
|
-
boardId:
|
|
184
|
+
boardId: j.id,
|
|
181
185
|
columnId: e.id,
|
|
182
186
|
after: t
|
|
183
187
|
},
|
|
184
188
|
fetchPolicy: "network-only"
|
|
185
189
|
}), r = n.data?.planmagnetBoardColumnCards;
|
|
186
190
|
if (!r) throw Error(n.error?.message ?? "The next cards could not be loaded.");
|
|
187
|
-
let i =
|
|
191
|
+
let i = M[e.id]?.items ?? [];
|
|
188
192
|
ee({
|
|
189
|
-
key:
|
|
193
|
+
key: j,
|
|
190
194
|
byColumn: {
|
|
191
|
-
...
|
|
195
|
+
...M,
|
|
192
196
|
[e.id]: {
|
|
193
197
|
items: [...i, ...r.items],
|
|
194
198
|
pageInfo: r.pageInfo
|
|
@@ -196,172 +200,175 @@ function ae({ projectId: t, projectName: n }) {
|
|
|
196
200
|
}
|
|
197
201
|
});
|
|
198
202
|
} catch (e) {
|
|
199
|
-
|
|
203
|
+
d(Q(e, "The next cards could not be loaded."));
|
|
200
204
|
} finally {
|
|
201
|
-
|
|
205
|
+
w(null);
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
|
-
}, [
|
|
205
|
-
refetchQueries:
|
|
208
|
+
}, [F, I] = _(G, {
|
|
209
|
+
refetchQueries: J,
|
|
206
210
|
awaitRefetchQueries: !0
|
|
207
|
-
}), [
|
|
208
|
-
refetchQueries:
|
|
211
|
+
}), [R, z] = _(W, {
|
|
212
|
+
refetchQueries: J,
|
|
209
213
|
awaitRefetchQueries: !0
|
|
210
|
-
}), [
|
|
211
|
-
refetchQueries:
|
|
214
|
+
}), [B] = _(oe, {
|
|
215
|
+
refetchQueries: J,
|
|
212
216
|
awaitRefetchQueries: !0
|
|
213
|
-
}),
|
|
214
|
-
|
|
217
|
+
}), K = async (e, t) => {
|
|
218
|
+
d(null);
|
|
215
219
|
try {
|
|
216
220
|
await r(e());
|
|
217
221
|
} catch (e) {
|
|
218
|
-
|
|
222
|
+
d(Q(e, t));
|
|
219
223
|
}
|
|
220
|
-
},
|
|
221
|
-
boardId:
|
|
224
|
+
}, q = (e, t) => K(() => R({ variables: {
|
|
225
|
+
boardId: A,
|
|
222
226
|
input: {
|
|
223
227
|
workItemId: e,
|
|
224
228
|
targetColumnId: t
|
|
225
229
|
}
|
|
226
|
-
} }), "The card could not be moved."),
|
|
227
|
-
if (!
|
|
228
|
-
let n =
|
|
229
|
-
if (!(r < 0 || r >= n.length)) return [n[e], n[r]] = [n[r], n[e]],
|
|
230
|
-
boardId:
|
|
230
|
+
} }), "The card could not be moved."), ae = (e, t) => {
|
|
231
|
+
if (!j) return;
|
|
232
|
+
let n = j.columns.map((e) => e.id), r = e + t;
|
|
233
|
+
if (!(r < 0 || r >= n.length)) return [n[e], n[r]] = [n[r], n[e]], K(() => B({ variables: {
|
|
234
|
+
boardId: A,
|
|
231
235
|
input: { columnIds: n }
|
|
232
236
|
} }), "The columns could not be reordered.");
|
|
233
237
|
};
|
|
234
|
-
return
|
|
238
|
+
return E && !T ? /* @__PURE__ */ y("p", {
|
|
235
239
|
className: "text-sm text-muted-foreground p-4",
|
|
236
240
|
children: "Loading board…"
|
|
237
|
-
}) :
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
onChange: (e) => u(e.target.value),
|
|
249
|
-
children: O.map((e) => /* @__PURE__ */ m("option", {
|
|
250
|
-
value: e.id,
|
|
251
|
-
children: e.name
|
|
252
|
-
}, e.id))
|
|
253
|
-
}),
|
|
254
|
-
A && /* @__PURE__ */ h("label", {
|
|
255
|
-
className: "flex items-center gap-1 text-sm",
|
|
256
|
-
children: [/* @__PURE__ */ m("span", {
|
|
257
|
-
className: "text-muted-foreground",
|
|
258
|
-
children: "Swimlanes"
|
|
259
|
-
}), /* @__PURE__ */ h("select", {
|
|
260
|
-
"aria-label": "Swimlanes",
|
|
261
|
-
"data-testid": "board-lanes",
|
|
241
|
+
}) : A ? /* @__PURE__ */ y(L.Provider, {
|
|
242
|
+
value: te,
|
|
243
|
+
children: /* @__PURE__ */ b("div", {
|
|
244
|
+
className: "space-y-3",
|
|
245
|
+
"data-testid": "project-board",
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ b("div", {
|
|
248
|
+
className: "flex flex-wrap items-center gap-3",
|
|
249
|
+
children: [
|
|
250
|
+
D.length > 1 && /* @__PURE__ */ y("select", {
|
|
251
|
+
"aria-label": "Board",
|
|
262
252
|
className: "rounded-md border border-input bg-background px-2 py-1 text-sm",
|
|
263
|
-
value:
|
|
264
|
-
onChange: (e) =>
|
|
253
|
+
value: A,
|
|
254
|
+
onChange: (e) => c(e.target.value),
|
|
255
|
+
children: D.map((e) => /* @__PURE__ */ y("option", {
|
|
256
|
+
value: e.id,
|
|
257
|
+
children: e.name
|
|
258
|
+
}, e.id))
|
|
259
|
+
}),
|
|
260
|
+
j && /* @__PURE__ */ b("label", {
|
|
261
|
+
className: "flex items-center gap-1 text-sm",
|
|
262
|
+
children: [/* @__PURE__ */ y("span", {
|
|
263
|
+
className: "text-muted-foreground",
|
|
264
|
+
children: "Swimlanes"
|
|
265
|
+
}), /* @__PURE__ */ b("select", {
|
|
266
|
+
"aria-label": "Swimlanes",
|
|
267
|
+
"data-testid": "board-lanes",
|
|
268
|
+
className: "rounded-md border border-input bg-background px-2 py-1 text-sm",
|
|
269
|
+
value: h,
|
|
270
|
+
onChange: (e) => x(e.target.value),
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ y("option", {
|
|
273
|
+
value: "none",
|
|
274
|
+
children: "None"
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ y("option", {
|
|
277
|
+
value: "assignee",
|
|
278
|
+
children: "By assignee"
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ y("option", {
|
|
281
|
+
value: "priority",
|
|
282
|
+
children: "By priority"
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
})]
|
|
286
|
+
}),
|
|
287
|
+
j && j.unplacedCount > 0 && /* @__PURE__ */ b("p", {
|
|
288
|
+
className: "text-xs text-muted-foreground",
|
|
289
|
+
"data-testid": "board-unplaced",
|
|
265
290
|
children: [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
children: "By assignee"
|
|
273
|
-
}),
|
|
274
|
-
/* @__PURE__ */ m("option", {
|
|
275
|
-
value: "priority",
|
|
276
|
-
children: "By priority"
|
|
277
|
-
})
|
|
291
|
+
j.unplacedCount,
|
|
292
|
+
" work item",
|
|
293
|
+
j.unplacedCount === 1 ? " is" : "s are",
|
|
294
|
+
" not on this board: ",
|
|
295
|
+
j.unplacedCount === 1 ? "its status has" : "their status has",
|
|
296
|
+
" no column."
|
|
278
297
|
]
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
" not on this board: ",
|
|
289
|
-
A.unplacedCount === 1 ? "its status has" : "their status has",
|
|
290
|
-
" no column."
|
|
291
|
-
]
|
|
292
|
-
}),
|
|
293
|
-
A && /* @__PURE__ */ m("div", {
|
|
294
|
-
className: "ml-auto",
|
|
295
|
-
children: /* @__PURE__ */ m(ce, { boardId: A.id })
|
|
296
|
-
})
|
|
297
|
-
]
|
|
298
|
-
}),
|
|
299
|
-
g && /* @__PURE__ */ m(X, { message: g }),
|
|
300
|
-
re && !A ? /* @__PURE__ */ m("p", {
|
|
301
|
-
className: "text-sm text-muted-foreground p-4",
|
|
302
|
-
children: "Loading board…"
|
|
303
|
-
}) : A && y !== "none" ? /* @__PURE__ */ m(oe, {
|
|
304
|
-
board: A,
|
|
305
|
-
laneBy: y,
|
|
306
|
-
cardsOf: M,
|
|
307
|
-
now: v,
|
|
308
|
-
busy: V.loading,
|
|
309
|
-
loadingMore: S,
|
|
310
|
-
onLoadMore: (e) => void N(e),
|
|
311
|
-
onMove: K
|
|
312
|
-
}) : /* @__PURE__ */ h("div", {
|
|
313
|
-
className: "flex gap-3 overflow-x-auto pb-2",
|
|
314
|
-
children: [A?.columns.map((e, t) => /* @__PURE__ */ m(se, {
|
|
315
|
-
boardId: A.id,
|
|
316
|
-
column: e,
|
|
317
|
-
columns: A.columns,
|
|
318
|
-
cards: M(e),
|
|
319
|
-
isFirst: t === 0,
|
|
320
|
-
isLast: t === A.columns.length - 1,
|
|
321
|
-
busy: V.loading,
|
|
322
|
-
now: v,
|
|
323
|
-
loadingMore: S === e.id,
|
|
324
|
-
onLoadMore: () => void N(e),
|
|
325
|
-
onMove: K,
|
|
326
|
-
onShift: (e) => q(t, e)
|
|
327
|
-
}, e.id)), A && A.columns.length === 0 && /* @__PURE__ */ m("p", {
|
|
298
|
+
}),
|
|
299
|
+
j && /* @__PURE__ */ y("div", {
|
|
300
|
+
className: "ml-auto",
|
|
301
|
+
children: /* @__PURE__ */ y(he, { boardId: j.id })
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
}),
|
|
305
|
+
u && /* @__PURE__ */ y($, { message: u }),
|
|
306
|
+
ie && !j ? /* @__PURE__ */ y("p", {
|
|
328
307
|
className: "text-sm text-muted-foreground p-4",
|
|
329
|
-
children: "
|
|
330
|
-
})
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
308
|
+
children: "Loading board…"
|
|
309
|
+
}) : j && h !== "none" ? /* @__PURE__ */ y(pe, {
|
|
310
|
+
board: j,
|
|
311
|
+
laneBy: h,
|
|
312
|
+
cardsOf: N,
|
|
313
|
+
now: p,
|
|
314
|
+
busy: z.loading,
|
|
315
|
+
loadingMore: C,
|
|
316
|
+
onLoadMore: (e) => void P(e),
|
|
317
|
+
onMove: q
|
|
318
|
+
}) : /* @__PURE__ */ b("div", {
|
|
319
|
+
className: "flex gap-3 overflow-x-auto pb-2",
|
|
320
|
+
children: [j?.columns.map((e, t) => /* @__PURE__ */ y(me, {
|
|
321
|
+
boardId: j.id,
|
|
322
|
+
column: e,
|
|
323
|
+
columns: j.columns,
|
|
324
|
+
cards: N(e),
|
|
325
|
+
isFirst: t === 0,
|
|
326
|
+
isLast: t === j.columns.length - 1,
|
|
327
|
+
busy: z.loading,
|
|
328
|
+
now: p,
|
|
329
|
+
loadingMore: C === e.id,
|
|
330
|
+
onLoadMore: () => void P(e),
|
|
331
|
+
onMove: q,
|
|
332
|
+
onShift: (e) => ae(t, e)
|
|
333
|
+
}, e.id)), j && j.columns.length === 0 && /* @__PURE__ */ y("p", {
|
|
334
|
+
className: "text-sm text-muted-foreground p-4",
|
|
335
|
+
children: "This board has no columns. Add one to start placing work."
|
|
336
|
+
})]
|
|
337
|
+
})
|
|
338
|
+
]
|
|
339
|
+
})
|
|
340
|
+
}) : /* @__PURE__ */ y(k, { children: /* @__PURE__ */ b(ne, {
|
|
334
341
|
className: "p-8 text-center space-y-3",
|
|
335
342
|
"data-testid": "board-empty",
|
|
336
343
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ y(f, { className: "h-8 w-8 mx-auto text-muted-foreground" }),
|
|
345
|
+
/* @__PURE__ */ b("p", {
|
|
339
346
|
className: "text-sm text-muted-foreground",
|
|
340
347
|
children: [n, " has no board yet."]
|
|
341
348
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ b(O, {
|
|
343
350
|
size: "sm",
|
|
344
|
-
disabled:
|
|
345
|
-
onClick: () =>
|
|
351
|
+
disabled: I.loading,
|
|
352
|
+
onClick: () => K(() => F({ variables: { input: {
|
|
346
353
|
projectId: t,
|
|
347
354
|
name: `${n} board`,
|
|
348
355
|
type: "KANBAN",
|
|
349
356
|
isDefault: !0,
|
|
350
357
|
withDefaultColumns: !0
|
|
351
358
|
} } }), "The board could not be created."),
|
|
352
|
-
children: [/* @__PURE__ */ m
|
|
359
|
+
children: [/* @__PURE__ */ y(m, { className: "mr-1 h-4 w-4" }), I.loading ? "Creating…" : "Create board"]
|
|
353
360
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ y("p", {
|
|
355
362
|
className: "text-xs text-muted-foreground",
|
|
356
363
|
children: "Starts with one column per status: Backlog, To Do, In Progress, In Review, Testing, Done."
|
|
357
364
|
}),
|
|
358
|
-
|
|
365
|
+
u && /* @__PURE__ */ y($, { message: u })
|
|
359
366
|
]
|
|
360
367
|
}) });
|
|
361
368
|
}
|
|
362
|
-
function
|
|
363
|
-
let
|
|
364
|
-
return /* @__PURE__ */
|
|
369
|
+
function ue({ card: e, column: r, columns: a, busy: s, now: l, onMove: u }) {
|
|
370
|
+
let d = t(), f = c(L), p = X(e.statusSince, l), m = i(f, e.status, I), h = a.filter((e) => e.id !== r.id && (!e.mappedStatus || m.includes(e.mappedStatus)));
|
|
371
|
+
return /* @__PURE__ */ b("li", {
|
|
365
372
|
draggable: !0,
|
|
366
373
|
onDragStart: (t) => {
|
|
367
374
|
t.dataTransfer.setData("text/plain", e.id), t.dataTransfer.effectAllowed = "move";
|
|
@@ -369,40 +376,40 @@ function Z({ card: e, column: r, columns: i, busy: a, now: o, onMove: s }) {
|
|
|
369
376
|
className: "rounded-md border bg-background p-2 space-y-1 cursor-grab",
|
|
370
377
|
"data-testid": "board-card",
|
|
371
378
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ y("button", {
|
|
373
380
|
type: "button",
|
|
374
381
|
className: "text-left text-sm font-medium leading-tight hover:underline",
|
|
375
|
-
onClick: () =>
|
|
382
|
+
onClick: () => d(`/tasks/task-detail-page?taskId=${encodeURIComponent(e.id)}`),
|
|
376
383
|
children: e.title
|
|
377
384
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ b("div", {
|
|
379
386
|
className: "flex items-center justify-between text-[11px] text-muted-foreground",
|
|
380
387
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
388
|
+
/* @__PURE__ */ y("span", { children: e.key }),
|
|
389
|
+
p !== null && /* @__PURE__ */ y("span", {
|
|
383
390
|
"data-testid": "card-age",
|
|
384
|
-
className:
|
|
385
|
-
title: `In ${
|
|
386
|
-
children:
|
|
391
|
+
className: ce(p),
|
|
392
|
+
title: `In ${o(f, e.status)} since ${new Date(e.statusSince ?? "").toLocaleDateString()}`,
|
|
393
|
+
children: p === 0 ? "today" : `${p}d in status`
|
|
387
394
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ b("span", { children: [e.storyPoints ?? 0, " pts"] })
|
|
389
396
|
]
|
|
390
397
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ b("div", {
|
|
392
399
|
className: "flex items-center justify-between gap-1 text-[11px] text-muted-foreground",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ y("span", {
|
|
394
401
|
className: "truncate",
|
|
395
|
-
children: e.assigneeId ? /* @__PURE__ */
|
|
396
|
-
}), /* @__PURE__ */
|
|
402
|
+
children: e.assigneeId ? /* @__PURE__ */ y(n, { id: e.assigneeId }) : "Unassigned"
|
|
403
|
+
}), /* @__PURE__ */ b("select", {
|
|
397
404
|
"aria-label": `Move ${e.key} to column`,
|
|
398
405
|
className: "rounded border border-input bg-background px-1 py-0.5 text-[11px]",
|
|
399
406
|
value: "",
|
|
400
|
-
disabled:
|
|
401
|
-
onChange: (t) => t.target.value &&
|
|
402
|
-
children: [/* @__PURE__ */
|
|
407
|
+
disabled: s,
|
|
408
|
+
onChange: (t) => t.target.value && u(e.id, t.target.value),
|
|
409
|
+
children: [/* @__PURE__ */ y("option", {
|
|
403
410
|
value: "",
|
|
404
411
|
children: "Move…"
|
|
405
|
-
}),
|
|
412
|
+
}), h.map((e) => /* @__PURE__ */ y("option", {
|
|
406
413
|
value: e.id,
|
|
407
414
|
children: e.name
|
|
408
415
|
}, e.id))]
|
|
@@ -411,28 +418,28 @@ function Z({ card: e, column: r, columns: i, busy: a, now: o, onMove: s }) {
|
|
|
411
418
|
]
|
|
412
419
|
});
|
|
413
420
|
}
|
|
414
|
-
function
|
|
415
|
-
let [
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
-
"aria-label":
|
|
418
|
-
className: `${n} ${
|
|
421
|
+
function de({ column: e, onMove: t, className: n, children: r, label: i }) {
|
|
422
|
+
let [a, o] = l(!1);
|
|
423
|
+
return /* @__PURE__ */ y("section", {
|
|
424
|
+
"aria-label": i,
|
|
425
|
+
className: `${n} ${a ? "ring-2 ring-primary" : ""}`,
|
|
419
426
|
onDragOver: (e) => {
|
|
420
|
-
e.preventDefault(),
|
|
427
|
+
e.preventDefault(), o(!0);
|
|
421
428
|
},
|
|
422
|
-
onDragLeave: () =>
|
|
429
|
+
onDragLeave: () => o(!1),
|
|
423
430
|
onDrop: (n) => {
|
|
424
|
-
n.preventDefault(),
|
|
431
|
+
n.preventDefault(), o(!1);
|
|
425
432
|
let r = n.dataTransfer.getData("text/plain");
|
|
426
433
|
r && t(r, e.id);
|
|
427
434
|
},
|
|
428
435
|
children: r
|
|
429
436
|
});
|
|
430
437
|
}
|
|
431
|
-
function
|
|
438
|
+
function fe({ cards: e, loading: t, onLoadMore: n }) {
|
|
432
439
|
let r = e.totalCount - e.items.length;
|
|
433
|
-
return r <= 0 || !e.pageInfo.hasNextPage ? null : /* @__PURE__ */
|
|
440
|
+
return r <= 0 || !e.pageInfo.hasNextPage ? null : /* @__PURE__ */ b("div", {
|
|
434
441
|
className: "px-2 pb-2 space-y-1",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ b("p", {
|
|
436
443
|
className: "text-xs text-muted-foreground",
|
|
437
444
|
children: [
|
|
438
445
|
"Showing ",
|
|
@@ -440,27 +447,27 @@ function $({ cards: e, loading: t, onLoadMore: n }) {
|
|
|
440
447
|
" of ",
|
|
441
448
|
e.totalCount
|
|
442
449
|
]
|
|
443
|
-
}), /* @__PURE__ */
|
|
450
|
+
}), /* @__PURE__ */ y(O, {
|
|
444
451
|
size: "sm",
|
|
445
452
|
variant: "outline",
|
|
446
453
|
className: "w-full",
|
|
447
454
|
"data-testid": "board-column-more",
|
|
448
455
|
disabled: t,
|
|
449
456
|
onClick: n,
|
|
450
|
-
children: t ? "Loading…" : `Show ${Math.min(r,
|
|
457
|
+
children: t ? "Loading…" : `Show ${Math.min(r, B)} more`
|
|
451
458
|
})]
|
|
452
459
|
});
|
|
453
460
|
}
|
|
454
|
-
function
|
|
461
|
+
function pe({ board: e, laneBy: t, cardsOf: r, now: i, busy: a, loadingMore: o, onLoadMore: s, onMove: c }) {
|
|
455
462
|
let l = e.columns.map((e) => ({
|
|
456
463
|
column: e,
|
|
457
464
|
cards: r(e)
|
|
458
|
-
})), u = [...new Set(l.flatMap(({ cards: e }) => e.items.map((e) =>
|
|
459
|
-
return /* @__PURE__ */
|
|
465
|
+
})), u = [...new Set(l.flatMap(({ cards: e }) => e.items.map((e) => Z(e, t))))].sort((e, n) => t === "priority" ? Y.indexOf(e) - Y.indexOf(n) : e === "" ? 1 : n === "" ? -1 : e.localeCompare(n)), d = (e) => t === "priority" ? z(e) : e ? /* @__PURE__ */ y(n, { id: e }) : "Unassigned";
|
|
466
|
+
return /* @__PURE__ */ b("div", {
|
|
460
467
|
className: "overflow-x-auto pb-2 space-y-3",
|
|
461
468
|
"data-testid": "board-swimlanes",
|
|
462
469
|
children: [
|
|
463
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ b("p", {
|
|
464
471
|
className: "text-xs text-muted-foreground",
|
|
465
472
|
children: [
|
|
466
473
|
"Dragging moves a card between columns. Its lane follows its",
|
|
@@ -469,16 +476,16 @@ function oe({ board: e, laneBy: t, cardsOf: r, now: i, busy: a, loadingMore: o,
|
|
|
469
476
|
"."
|
|
470
477
|
]
|
|
471
478
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ y("div", {
|
|
473
480
|
className: "flex gap-3",
|
|
474
|
-
children: l.map(({ column: e, cards: t }) => /* @__PURE__ */
|
|
481
|
+
children: l.map(({ column: e, cards: t }) => /* @__PURE__ */ y("div", {
|
|
475
482
|
className: "min-w-[240px] w-[240px] shrink-0 px-2",
|
|
476
|
-
children: /* @__PURE__ */
|
|
483
|
+
children: /* @__PURE__ */ b("h3", {
|
|
477
484
|
className: "text-sm font-medium truncate",
|
|
478
485
|
children: [
|
|
479
486
|
e.name,
|
|
480
487
|
" ",
|
|
481
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ y("span", {
|
|
482
489
|
className: "text-xs text-muted-foreground",
|
|
483
490
|
children: e.wipLimit ? `${t.totalCount} / ${e.wipLimit}` : t.totalCount
|
|
484
491
|
})
|
|
@@ -486,37 +493,37 @@ function oe({ board: e, laneBy: t, cardsOf: r, now: i, busy: a, loadingMore: o,
|
|
|
486
493
|
})
|
|
487
494
|
}, e.id))
|
|
488
495
|
}),
|
|
489
|
-
u.length === 0 && /* @__PURE__ */
|
|
496
|
+
u.length === 0 && /* @__PURE__ */ y("p", {
|
|
490
497
|
className: "text-sm text-muted-foreground p-4",
|
|
491
498
|
children: "No cards on this board yet."
|
|
492
499
|
}),
|
|
493
|
-
u.map((n) => /* @__PURE__ */
|
|
500
|
+
u.map((n) => /* @__PURE__ */ b("div", {
|
|
494
501
|
"data-testid": "board-lane",
|
|
495
502
|
className: "space-y-1",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ b("p", {
|
|
497
504
|
className: "text-xs font-medium",
|
|
498
505
|
children: [
|
|
499
506
|
d(n),
|
|
500
507
|
" ",
|
|
501
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ b("span", {
|
|
502
509
|
className: "text-muted-foreground",
|
|
503
510
|
children: [
|
|
504
511
|
"(",
|
|
505
|
-
l.reduce((e, { cards: r }) => e + r.items.filter((e) =>
|
|
512
|
+
l.reduce((e, { cards: r }) => e + r.items.filter((e) => Z(e, t) === n).length, 0),
|
|
506
513
|
")"
|
|
507
514
|
]
|
|
508
515
|
})
|
|
509
516
|
]
|
|
510
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ y("div", {
|
|
511
518
|
className: "flex gap-3",
|
|
512
|
-
children: l.map(({ column: r, cards: o }) => /* @__PURE__ */
|
|
519
|
+
children: l.map(({ column: r, cards: o }) => /* @__PURE__ */ y(de, {
|
|
513
520
|
column: r,
|
|
514
521
|
onMove: c,
|
|
515
522
|
label: `${r.name} column`,
|
|
516
523
|
className: "min-w-[240px] w-[240px] shrink-0 rounded-md border bg-muted/30",
|
|
517
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ y("ul", {
|
|
518
525
|
className: "p-2 space-y-2 min-h-[48px]",
|
|
519
|
-
children: o.items.filter((e) =>
|
|
526
|
+
children: o.items.filter((e) => Z(e, t) === n).map((t) => /* @__PURE__ */ y(ue, {
|
|
520
527
|
card: t,
|
|
521
528
|
column: r,
|
|
522
529
|
columns: e.columns,
|
|
@@ -528,11 +535,11 @@ function oe({ board: e, laneBy: t, cardsOf: r, now: i, busy: a, loadingMore: o,
|
|
|
528
535
|
}, r.id))
|
|
529
536
|
})]
|
|
530
537
|
}, n || "none")),
|
|
531
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ y("div", {
|
|
532
539
|
className: "flex gap-3",
|
|
533
|
-
children: l.map(({ column: e, cards: t }) => /* @__PURE__ */
|
|
540
|
+
children: l.map(({ column: e, cards: t }) => /* @__PURE__ */ y("div", {
|
|
534
541
|
className: "min-w-[240px] w-[240px] shrink-0",
|
|
535
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ y(fe, {
|
|
536
543
|
cards: t,
|
|
537
544
|
loading: o === e.id,
|
|
538
545
|
onLoadMore: () => s(e)
|
|
@@ -542,56 +549,56 @@ function oe({ board: e, laneBy: t, cardsOf: r, now: i, busy: a, loadingMore: o,
|
|
|
542
549
|
]
|
|
543
550
|
});
|
|
544
551
|
}
|
|
545
|
-
function
|
|
546
|
-
let
|
|
547
|
-
return /* @__PURE__ */
|
|
552
|
+
function me({ boardId: e, column: t, columns: n, cards: r, isFirst: i, isLast: a, busy: o, now: s, loadingMore: c, onLoadMore: l, onMove: f, onShift: p }) {
|
|
553
|
+
let m = r.totalCount, h = t.wipLimit != null && t.wipLimit > 0 && m >= t.wipLimit, g = R();
|
|
554
|
+
return /* @__PURE__ */ y(de, {
|
|
548
555
|
column: t,
|
|
549
556
|
onMove: f,
|
|
550
557
|
label: `${t.name} column`,
|
|
551
558
|
className: "min-w-[240px] w-[240px] shrink-0 rounded-md border bg-muted/30",
|
|
552
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ b("div", {
|
|
553
560
|
"data-testid": `board-column-${t.name}`,
|
|
554
561
|
children: [
|
|
555
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ b("header", {
|
|
556
563
|
className: "p-2 border-b space-y-1",
|
|
557
|
-
children: [/* @__PURE__ */
|
|
564
|
+
children: [/* @__PURE__ */ b("div", {
|
|
558
565
|
className: "flex items-center justify-between gap-1",
|
|
559
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
560
567
|
className: "text-sm font-medium truncate",
|
|
561
568
|
children: t.name
|
|
562
|
-
}), /* @__PURE__ */
|
|
569
|
+
}), /* @__PURE__ */ y("span", {
|
|
563
570
|
"data-testid": `board-column-count-${t.name}`,
|
|
564
|
-
className: `text-xs rounded-full px-1.5 ${
|
|
571
|
+
className: `text-xs rounded-full px-1.5 ${h ? "bg-status-warning-subtle text-status-warning" : "bg-muted"}`,
|
|
565
572
|
title: t.wipLimit ? `WIP limit ${t.wipLimit}` : void 0,
|
|
566
|
-
children: t.wipLimit ? `${
|
|
573
|
+
children: t.wipLimit ? `${m} / ${t.wipLimit}` : m
|
|
567
574
|
})]
|
|
568
|
-
}), /* @__PURE__ */
|
|
575
|
+
}), /* @__PURE__ */ b("div", {
|
|
569
576
|
className: "flex items-center justify-between gap-1",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
577
|
+
children: [/* @__PURE__ */ y("span", {
|
|
571
578
|
className: "text-[11px] text-muted-foreground",
|
|
572
|
-
children: t.mappedStatus ? `Sets status: ${
|
|
573
|
-
}), /* @__PURE__ */
|
|
579
|
+
children: t.mappedStatus ? `Sets status: ${g(t.mappedStatus)}` : "No status"
|
|
580
|
+
}), /* @__PURE__ */ b("span", {
|
|
574
581
|
className: "flex",
|
|
575
582
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ y(O, {
|
|
577
584
|
size: "icon",
|
|
578
585
|
variant: "ghost",
|
|
579
586
|
className: "h-6 w-6",
|
|
580
587
|
"aria-label": `Move ${t.name} column left`,
|
|
581
588
|
disabled: i,
|
|
582
589
|
onClick: () => p(-1),
|
|
583
|
-
children: /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ y(u, { className: "h-3.5 w-3.5" })
|
|
584
591
|
}),
|
|
585
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ y(O, {
|
|
586
593
|
size: "icon",
|
|
587
594
|
variant: "ghost",
|
|
588
595
|
className: "h-6 w-6",
|
|
589
596
|
"aria-label": `Move ${t.name} column right`,
|
|
590
|
-
disabled:
|
|
597
|
+
disabled: a,
|
|
591
598
|
onClick: () => p(1),
|
|
592
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ y(d, { className: "h-3.5 w-3.5" })
|
|
593
600
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ y(he, {
|
|
595
602
|
boardId: e,
|
|
596
603
|
column: t
|
|
597
604
|
})
|
|
@@ -599,154 +606,154 @@ function se({ boardId: e, column: t, columns: n, cards: r, isFirst: i, isLast: s
|
|
|
599
606
|
})]
|
|
600
607
|
})]
|
|
601
608
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ b("ul", {
|
|
603
610
|
className: "p-2 space-y-2 min-h-[80px]",
|
|
604
|
-
children: [r.items.map((e) => /* @__PURE__ */
|
|
611
|
+
children: [r.items.map((e) => /* @__PURE__ */ y(ue, {
|
|
605
612
|
card: e,
|
|
606
613
|
column: t,
|
|
607
614
|
columns: n,
|
|
608
|
-
busy:
|
|
609
|
-
now:
|
|
615
|
+
busy: o,
|
|
616
|
+
now: s,
|
|
610
617
|
onMove: f
|
|
611
|
-
}, e.id)),
|
|
618
|
+
}, e.id)), m === 0 && /* @__PURE__ */ y("li", {
|
|
612
619
|
className: "text-xs text-muted-foreground text-center py-4",
|
|
613
620
|
children: "Empty"
|
|
614
621
|
})]
|
|
615
622
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
623
|
+
/* @__PURE__ */ y(fe, {
|
|
617
624
|
cards: r,
|
|
618
|
-
loading:
|
|
619
|
-
onLoadMore:
|
|
625
|
+
loading: c,
|
|
626
|
+
onLoadMore: l
|
|
620
627
|
})
|
|
621
628
|
]
|
|
622
629
|
})
|
|
623
630
|
});
|
|
624
631
|
}
|
|
625
|
-
function
|
|
626
|
-
let n = t !== void 0, [a, o] =
|
|
627
|
-
refetchQueries:
|
|
632
|
+
function he({ boardId: e, column: t }) {
|
|
633
|
+
let n = t !== void 0, i = R(), [a, o] = l(!1), [s, c] = l(t?.name ?? ""), [u, d] = l(t?.mappedStatus ?? ""), [f, h] = l(t?.wipLimit ? String(t.wipLimit) : ""), [g, v] = l(null), k = {
|
|
634
|
+
refetchQueries: J,
|
|
628
635
|
awaitRefetchQueries: !0
|
|
629
|
-
}, [
|
|
630
|
-
|
|
631
|
-
},
|
|
632
|
-
|
|
636
|
+
}, [ne, L] = _(K, k), [z, B] = _(q, k), [V, H] = _(ae, k), U = L.loading || B.loading || H.loading, W = f.trim() === "" ? null : Number(f), G = W !== null && (!Number.isInteger(W) || W < 1), oe = s.trim() !== "" && !G && !U, Y = () => {
|
|
637
|
+
c(t?.name ?? ""), d(t?.mappedStatus ?? ""), h(t?.wipLimit ? String(t.wipLimit) : ""), v(null);
|
|
638
|
+
}, se = async () => {
|
|
639
|
+
v(null);
|
|
633
640
|
let i = {
|
|
634
641
|
name: s.trim(),
|
|
635
|
-
mappedStatus:
|
|
636
|
-
wipLimit:
|
|
642
|
+
mappedStatus: u || null,
|
|
643
|
+
wipLimit: W
|
|
637
644
|
};
|
|
638
645
|
try {
|
|
639
|
-
n ? await r(
|
|
646
|
+
n ? await r(z({ variables: {
|
|
640
647
|
id: t.id,
|
|
641
648
|
input: i
|
|
642
|
-
} })) : await r(
|
|
649
|
+
} })) : await r(ne({ variables: { input: {
|
|
643
650
|
boardId: e,
|
|
644
651
|
type: "CUSTOM",
|
|
645
652
|
...i
|
|
646
653
|
} } })), o(!1);
|
|
647
654
|
} catch (e) {
|
|
648
|
-
|
|
655
|
+
v(Q(e, "The column could not be saved."));
|
|
649
656
|
}
|
|
650
|
-
},
|
|
651
|
-
return /* @__PURE__ */
|
|
657
|
+
}, X = n ? `column-${t.id}` : "new-column";
|
|
658
|
+
return /* @__PURE__ */ b(re, {
|
|
652
659
|
open: a,
|
|
653
660
|
onOpenChange: (e) => {
|
|
654
|
-
o(e), e &&
|
|
661
|
+
o(e), e && Y();
|
|
655
662
|
},
|
|
656
|
-
children: [/* @__PURE__ */
|
|
663
|
+
children: [/* @__PURE__ */ y(F, {
|
|
657
664
|
asChild: !0,
|
|
658
|
-
children: n ? /* @__PURE__ */
|
|
665
|
+
children: n ? /* @__PURE__ */ y(O, {
|
|
659
666
|
size: "icon",
|
|
660
667
|
variant: "ghost",
|
|
661
668
|
className: "h-6 w-6",
|
|
662
669
|
"aria-label": `Edit ${t.name} column`,
|
|
663
|
-
children: /* @__PURE__ */
|
|
664
|
-
}) : /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ y(p, { className: "h-3.5 w-3.5" })
|
|
671
|
+
}) : /* @__PURE__ */ b(O, {
|
|
665
672
|
size: "sm",
|
|
666
673
|
variant: "outline",
|
|
667
|
-
children: [/* @__PURE__ */ m
|
|
674
|
+
children: [/* @__PURE__ */ y(m, { className: "mr-1 h-4 w-4" }), "Add column"]
|
|
668
675
|
})
|
|
669
|
-
}), /* @__PURE__ */
|
|
676
|
+
}), /* @__PURE__ */ b(ie, {
|
|
670
677
|
className: "max-w-md",
|
|
671
678
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ b(N, { children: [/* @__PURE__ */ y(P, { children: n ? `Edit ${t.name}` : "Add column" }), /* @__PURE__ */ y(j, { children: "Moving a card into a column that sets a status changes the work item's status." })] }),
|
|
680
|
+
/* @__PURE__ */ b("div", {
|
|
674
681
|
className: "space-y-3",
|
|
675
682
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
htmlFor: `${
|
|
683
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
684
|
+
htmlFor: `${X}-name`,
|
|
678
685
|
className: "text-sm font-medium",
|
|
679
686
|
children: "Name"
|
|
680
|
-
}), /* @__PURE__ */
|
|
681
|
-
id: `${
|
|
687
|
+
}), /* @__PURE__ */ y(A, {
|
|
688
|
+
id: `${X}-name`,
|
|
682
689
|
className: "mt-1",
|
|
683
690
|
value: s,
|
|
684
|
-
onChange: (e) =>
|
|
691
|
+
onChange: (e) => c(e.target.value)
|
|
685
692
|
})] }),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
htmlFor: `${
|
|
693
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
694
|
+
htmlFor: `${X}-status`,
|
|
688
695
|
className: "text-sm font-medium",
|
|
689
696
|
children: "Sets status"
|
|
690
|
-
}), /* @__PURE__ */
|
|
691
|
-
id: `${
|
|
697
|
+
}), /* @__PURE__ */ b("select", {
|
|
698
|
+
id: `${X}-status`,
|
|
692
699
|
className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
693
|
-
value:
|
|
694
|
-
onChange: (e) =>
|
|
695
|
-
children: [/* @__PURE__ */
|
|
700
|
+
value: u,
|
|
701
|
+
onChange: (e) => d(e.target.value),
|
|
702
|
+
children: [/* @__PURE__ */ y("option", {
|
|
696
703
|
value: "",
|
|
697
704
|
children: "No status (cards keep theirs)"
|
|
698
|
-
}),
|
|
705
|
+
}), I.map((e) => /* @__PURE__ */ y("option", {
|
|
699
706
|
value: e,
|
|
700
|
-
children:
|
|
707
|
+
children: i(e)
|
|
701
708
|
}, e))]
|
|
702
709
|
})] }),
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
htmlFor: `${
|
|
710
|
+
/* @__PURE__ */ b("div", { children: [
|
|
711
|
+
/* @__PURE__ */ y("label", {
|
|
712
|
+
htmlFor: `${X}-wip`,
|
|
706
713
|
className: "text-sm font-medium",
|
|
707
714
|
children: "WIP limit (blank for none)"
|
|
708
715
|
}),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
id: `${
|
|
716
|
+
/* @__PURE__ */ y(A, {
|
|
717
|
+
id: `${X}-wip`,
|
|
711
718
|
type: "number",
|
|
712
719
|
min: 1,
|
|
713
720
|
className: "mt-1",
|
|
714
|
-
value:
|
|
715
|
-
onChange: (e) =>
|
|
721
|
+
value: f,
|
|
722
|
+
onChange: (e) => h(e.target.value)
|
|
716
723
|
}),
|
|
717
|
-
|
|
724
|
+
G && /* @__PURE__ */ y($, { message: "The WIP limit must be a whole number, 1 or more." })
|
|
718
725
|
] })
|
|
719
726
|
]
|
|
720
727
|
}),
|
|
721
|
-
|
|
722
|
-
/* @__PURE__ */
|
|
728
|
+
g && /* @__PURE__ */ y($, { message: g }),
|
|
729
|
+
/* @__PURE__ */ b(M, {
|
|
723
730
|
className: "gap-2",
|
|
724
|
-
children: [n && /* @__PURE__ */
|
|
731
|
+
children: [n && /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y(D, {
|
|
725
732
|
asChild: !0,
|
|
726
|
-
children: /* @__PURE__ */
|
|
733
|
+
children: /* @__PURE__ */ y(O, {
|
|
727
734
|
variant: "outline",
|
|
728
|
-
disabled:
|
|
735
|
+
disabled: U,
|
|
729
736
|
children: "Delete column"
|
|
730
737
|
})
|
|
731
|
-
}), /* @__PURE__ */
|
|
738
|
+
}), /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(T, { children: [/* @__PURE__ */ b(E, { children: [
|
|
732
739
|
"Delete ",
|
|
733
740
|
t.name,
|
|
734
741
|
"?"
|
|
735
|
-
] }), /* @__PURE__ */
|
|
742
|
+
] }), /* @__PURE__ */ y(w, { children: "Its cards are not deleted: each goes back to the column for its status, or off the board if no column sets that status." })] }), /* @__PURE__ */ b(te, { children: [/* @__PURE__ */ y(ee, { children: "Keep it" }), /* @__PURE__ */ y(S, {
|
|
736
743
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
737
744
|
onClick: async () => {
|
|
738
745
|
try {
|
|
739
|
-
await r(
|
|
746
|
+
await r(V({ variables: { id: t.id } })), o(!1);
|
|
740
747
|
} catch (e) {
|
|
741
|
-
|
|
748
|
+
v(Q(e, "The column could not be deleted."));
|
|
742
749
|
}
|
|
743
750
|
},
|
|
744
751
|
children: "Delete column"
|
|
745
|
-
})] })] })] }), /* @__PURE__ */
|
|
746
|
-
onClick:
|
|
747
|
-
disabled: !
|
|
748
|
-
"data-testid": `${
|
|
749
|
-
children:
|
|
752
|
+
})] })] })] }), /* @__PURE__ */ y(O, {
|
|
753
|
+
onClick: se,
|
|
754
|
+
disabled: !oe,
|
|
755
|
+
"data-testid": `${X}-save`,
|
|
756
|
+
children: U ? "Saving…" : n ? "Save" : "Add column"
|
|
750
757
|
})]
|
|
751
758
|
})
|
|
752
759
|
]
|
|
@@ -754,6 +761,6 @@ function ce({ boardId: e, column: t }) {
|
|
|
754
761
|
});
|
|
755
762
|
}
|
|
756
763
|
//#endregion
|
|
757
|
-
export {
|
|
764
|
+
export { le as ProjectBoard };
|
|
758
765
|
|
|
759
766
|
//# sourceMappingURL=ProjectBoard.js.map
|