@burdenoff/microfe-planmagnet 2026.930.7 → 2026.930.8

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