@burdenoff/microfe-planmagnet 2026.925.7 → 2026.925.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.
Files changed (26) hide show
  1. package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
  2. package/dist/planmagnet/board/ProjectBoard.js +159 -158
  3. package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
  4. package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
  5. package/dist/planmagnet/create/CreateDialogs.js +118 -117
  6. package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
  7. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.d.ts.map +1 -1
  8. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js.map +1 -1
  9. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
  10. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +322 -280
  11. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
  12. package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
  13. package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
  14. package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
  15. package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
  16. package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
  17. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +147 -126
  18. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
  19. package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
  20. package/dist/planmagnet/sprints/SprintControls.js +202 -201
  21. package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
  22. package/dist/planmagnet/utils/mutationResult.d.ts +16 -0
  23. package/dist/planmagnet/utils/mutationResult.d.ts.map +1 -0
  24. package/dist/planmagnet/utils/mutationResult.js +10 -0
  25. package/dist/planmagnet/utils/mutationResult.js.map +1 -0
  26. package/package.json +3 -2
@@ -1,12 +1,13 @@
1
1
  import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
2
- import { useDeferredValue as t, useState as n } from "react";
3
- import { CheckCircle2 as r, Play as i, Plus as a, X as o, XCircle as s } from "lucide-react";
4
- import { gql as c } from "@apollo/client";
5
- import { useMutation as l, useQuery as u } from "@apollo/client/react";
6
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { AlertDialog as p, AlertDialogAction as m, AlertDialogCancel as h, AlertDialogContent as g, AlertDialogDescription as _, AlertDialogFooter as v, AlertDialogHeader as y, AlertDialogTitle as b, AlertDialogTrigger as x, Badge as S, Button as C, Checkbox as w, Input as T, ResponsiveDialog as E, ResponsiveDialogContent as D, ResponsiveDialogDescription as O, ResponsiveDialogFooter as k, ResponsiveDialogHeader as A, ResponsiveDialogTitle as j, ResponsiveDialogTrigger as M } from "@burdenoff/fe-libs/ui";
2
+ import { throwOnError as t } from "../utils/mutationResult.js";
3
+ import { useDeferredValue as n, useState as r } from "react";
4
+ import { CheckCircle2 as i, Play as a, Plus as o, X as s, XCircle as c } from "lucide-react";
5
+ import { gql as l } from "@apollo/client";
6
+ import { useMutation as u, useQuery as d } from "@apollo/client/react";
7
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import { AlertDialog as m, AlertDialogAction as h, AlertDialogCancel as g, AlertDialogContent as _, AlertDialogDescription as v, AlertDialogFooter as y, AlertDialogHeader as b, AlertDialogTitle as x, AlertDialogTrigger as S, Badge as C, Button as w, Checkbox as T, Input as E, ResponsiveDialog as D, ResponsiveDialogContent as O, ResponsiveDialogDescription as k, ResponsiveDialogFooter as A, ResponsiveDialogHeader as j, ResponsiveDialogTitle as M, ResponsiveDialogTrigger as N } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/planmagnet/sprints/SprintControls.tsx
9
- var N = {
10
+ var P = {
10
11
  start: ["PLANNING"],
11
12
  complete: ["ACTIVE", "REVIEW"],
12
13
  cancel: [
@@ -15,32 +16,32 @@ var N = {
15
16
  "REVIEW"
16
17
  ]
17
18
  };
18
- function P(e) {
19
- return Object.keys(N).filter((t) => N[t].includes(e));
20
- }
21
19
  function F(e) {
20
+ return Object.keys(P).filter((t) => P[t].includes(e));
21
+ }
22
+ function I(e) {
22
23
  return e === "COMPLETED" || e === "CANCELLED";
23
24
  }
24
- var I = [
25
+ var L = [
25
26
  "GetSprints",
26
27
  "GetSprintDetail",
27
28
  "GetSprintForEdit",
28
29
  "GetDashboardData"
29
- ], L = c`
30
+ ], R = l`
30
31
  mutation SprintControlsStart($id: ID!) {
31
32
  planmagnetStartSprint(id: $id) {
32
33
  id
33
34
  status
34
35
  }
35
36
  }
36
- `, R = c`
37
+ `, z = l`
37
38
  mutation SprintControlsComplete($id: ID!) {
38
39
  planmagnetCompleteSprint(id: $id) {
39
40
  id
40
41
  status
41
42
  }
42
43
  }
43
- `, z = c`
44
+ `, B = l`
44
45
  mutation SprintControlsCancel($id: ID!) {
45
46
  planmagnetCancelSprint(id: $id) {
46
47
  id
@@ -48,91 +49,91 @@ var I = [
48
49
  }
49
50
  }
50
51
  `;
51
- function B({ message: e }) {
52
- return /* @__PURE__ */ d("p", {
52
+ function V({ message: e }) {
53
+ return /* @__PURE__ */ f("p", {
53
54
  role: "alert",
54
55
  className: "text-sm text-destructive",
55
56
  children: e
56
57
  });
57
58
  }
58
- function V({ sprintId: e, sprintName: t, status: a }) {
59
- let o = {
60
- refetchQueries: I,
59
+ function H({ sprintId: e, sprintName: n, status: o }) {
60
+ let s = {
61
+ refetchQueries: L,
61
62
  awaitRefetchQueries: !0
62
- }, [c, u] = l(L, o), [p, m] = l(R, o), [h, g] = l(z, o), [_, v] = n(null), y = u.loading || m.loading || g.loading, b = P(a);
63
- if (b.length === 0) return null;
64
- let x = async (t) => {
65
- v(null);
63
+ }, [l, d] = u(R, s), [m, h] = u(z, s), [g, _] = u(B, s), [v, y] = r(null), b = d.loading || h.loading || _.loading, x = F(o);
64
+ if (x.length === 0) return null;
65
+ let S = async (n) => {
66
+ y(null);
66
67
  try {
67
- await t({ variables: { id: e } });
68
+ await t(n({ variables: { id: e } }));
68
69
  } catch (e) {
69
- v(e instanceof Error ? e.message : "The sprint could not be updated.");
70
+ y(e instanceof Error ? e.message : "The sprint could not be updated.");
70
71
  }
71
72
  };
72
- return /* @__PURE__ */ f("div", {
73
+ return /* @__PURE__ */ p("div", {
73
74
  className: "flex flex-col items-end gap-2",
74
75
  "data-testid": "sprint-lifecycle-actions",
75
- children: [/* @__PURE__ */ f("div", {
76
+ children: [/* @__PURE__ */ p("div", {
76
77
  className: "flex gap-2",
77
78
  children: [
78
- b.includes("start") && /* @__PURE__ */ f(C, {
79
+ x.includes("start") && /* @__PURE__ */ p(w, {
79
80
  size: "sm",
80
- onClick: () => x(c),
81
- disabled: y,
82
- children: [/* @__PURE__ */ d(i, { className: "mr-1 h-4 w-4" }), "Start sprint"]
81
+ onClick: () => S(l),
82
+ disabled: b,
83
+ children: [/* @__PURE__ */ f(a, { className: "mr-1 h-4 w-4" }), "Start sprint"]
83
84
  }),
84
- b.includes("complete") && /* @__PURE__ */ d(H, {
85
+ x.includes("complete") && /* @__PURE__ */ f(U, {
85
86
  label: "Complete sprint",
86
- icon: /* @__PURE__ */ d(r, { className: "mr-1 h-4 w-4" }),
87
- title: `Complete ${t}?`,
87
+ icon: /* @__PURE__ */ f(i, { className: "mr-1 h-4 w-4" }),
88
+ title: `Complete ${n}?`,
88
89
  description: "The sprint is closed and its work items can no longer be changed from it. This cannot be undone.",
89
90
  confirmLabel: "Complete sprint",
90
- disabled: y,
91
- onConfirm: () => x(p)
91
+ disabled: b,
92
+ onConfirm: () => S(m)
92
93
  }),
93
- b.includes("cancel") && /* @__PURE__ */ d(H, {
94
+ x.includes("cancel") && /* @__PURE__ */ f(U, {
94
95
  label: "Cancel sprint",
95
96
  variant: "outline",
96
- icon: /* @__PURE__ */ d(s, { className: "mr-1 h-4 w-4" }),
97
- title: `Cancel ${t}?`,
97
+ icon: /* @__PURE__ */ f(c, { className: "mr-1 h-4 w-4" }),
98
+ title: `Cancel ${n}?`,
98
99
  description: "The sprint is abandoned and cannot be restarted. Its work items stay in it for the record. This cannot be undone.",
99
100
  confirmLabel: "Cancel sprint",
100
101
  destructive: !0,
101
- disabled: y,
102
- onConfirm: () => x(h)
102
+ disabled: b,
103
+ onConfirm: () => S(g)
103
104
  })
104
105
  ]
105
- }), _ && /* @__PURE__ */ d(B, { message: _ })]
106
+ }), v && /* @__PURE__ */ f(V, { message: v })]
106
107
  });
107
108
  }
108
- function H({ label: e, icon: t, title: n, description: r, confirmLabel: i, onConfirm: a, disabled: o, destructive: s = !1, variant: c = "default" }) {
109
- return /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(x, {
109
+ function U({ label: e, icon: t, title: n, description: r, confirmLabel: i, onConfirm: a, disabled: o, destructive: s = !1, variant: c = "default" }) {
110
+ return /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ f(S, {
110
111
  asChild: !0,
111
- children: /* @__PURE__ */ f(C, {
112
+ children: /* @__PURE__ */ p(w, {
112
113
  size: "sm",
113
114
  variant: c,
114
115
  disabled: o,
115
116
  children: [t, e]
116
117
  })
117
- }), /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ f(y, { children: [/* @__PURE__ */ d(b, { children: n }), /* @__PURE__ */ d(_, { children: r })] }), /* @__PURE__ */ f(v, { children: [/* @__PURE__ */ d(h, { children: "Keep it" }), /* @__PURE__ */ d(m, {
118
+ }), /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ p(b, { children: [/* @__PURE__ */ f(x, { children: n }), /* @__PURE__ */ f(v, { children: r })] }), /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ f(g, { children: "Keep it" }), /* @__PURE__ */ f(h, {
118
119
  onClick: a,
119
120
  className: s ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "",
120
121
  children: i
121
122
  })] })] })] });
122
123
  }
123
- var U = c`
124
+ var W = l`
124
125
  mutation SprintControlsAddItems($id: ID!, $input: PlanmagnetSprintWorkItemsInput!) {
125
126
  planmagnetAddWorkItemsToSprint(id: $id, input: $input) {
126
127
  id
127
128
  }
128
129
  }
129
- `, W = c`
130
+ `, G = l`
130
131
  mutation SprintControlsRemoveItems($id: ID!, $input: PlanmagnetSprintWorkItemsInput!) {
131
132
  planmagnetRemoveWorkItemsFromSprint(id: $id, input: $input) {
132
133
  id
133
134
  }
134
135
  }
135
- `, G = c`
136
+ `, K = l`
136
137
  query SprintControlsCandidates($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter) {
137
138
  planmagnetWorkItems(workspaceId: $workspaceId, filter: $filter, pagination: { first: 100 }) {
138
139
  totalCount
@@ -146,83 +147,83 @@ var U = c`
146
147
  }
147
148
  }
148
149
  }
149
- `, K = (e) => e.toLowerCase().replace(/_/g, " ");
150
- function q({ sprintId: e, projectId: t, status: r, items: i }) {
151
- let a = F(r), [s, c] = l(W, {
152
- refetchQueries: I,
150
+ `, q = (e) => e.toLowerCase().replace(/_/g, " ");
151
+ function J({ sprintId: e, projectId: n, status: i, items: a }) {
152
+ let o = I(i), [c, l] = u(G, {
153
+ refetchQueries: L,
153
154
  awaitRefetchQueries: !0
154
- }), [u, p] = n(null), [m, h] = n(null), g = async (t) => {
155
- p(null), h(t);
155
+ }), [d, m] = r(null), [h, g] = r(null), _ = async (n) => {
156
+ m(null), g(n);
156
157
  try {
157
- await s({ variables: {
158
+ await t(c({ variables: {
158
159
  id: e,
159
- input: { workItemIds: [t] }
160
- } });
160
+ input: { workItemIds: [n] }
161
+ } }));
161
162
  } catch (e) {
162
- p(e instanceof Error ? e.message : "The work item could not be removed.");
163
+ m(e instanceof Error ? e.message : "The work item could not be removed.");
163
164
  } finally {
164
- h(null);
165
+ g(null);
165
166
  }
166
167
  };
167
- return /* @__PURE__ */ f("div", {
168
+ return /* @__PURE__ */ p("div", {
168
169
  className: "space-y-3",
169
170
  "data-testid": "sprint-work-items",
170
171
  children: [
171
- /* @__PURE__ */ f("div", {
172
+ /* @__PURE__ */ p("div", {
172
173
  className: "flex items-center justify-between",
173
- children: [/* @__PURE__ */ f("p", {
174
+ children: [/* @__PURE__ */ p("p", {
174
175
  className: "text-sm text-muted-foreground",
175
176
  children: [
176
- i.length,
177
+ a.length,
177
178
  " work item",
178
- i.length === 1 ? "" : "s"
179
+ a.length === 1 ? "" : "s"
179
180
  ]
180
- }), !a && /* @__PURE__ */ d(J, {
181
+ }), !o && /* @__PURE__ */ f(Y, {
181
182
  sprintId: e,
182
- projectId: t
183
+ projectId: n
183
184
  })]
184
185
  }),
185
- a && /* @__PURE__ */ f("p", {
186
+ o && /* @__PURE__ */ p("p", {
186
187
  className: "text-xs text-muted-foreground",
187
188
  children: [
188
189
  "This sprint is ",
189
- K(r),
190
+ q(i),
190
191
  "; its work items can no longer be changed."
191
192
  ]
192
193
  }),
193
- u && /* @__PURE__ */ d(B, { message: u }),
194
- i.length === 0 ? /* @__PURE__ */ d("p", {
194
+ d && /* @__PURE__ */ f(V, { message: d }),
195
+ a.length === 0 ? /* @__PURE__ */ f("p", {
195
196
  className: "text-sm text-muted-foreground text-center py-4",
196
197
  children: "No work items in this sprint yet."
197
- }) : /* @__PURE__ */ d("ul", {
198
+ }) : /* @__PURE__ */ f("ul", {
198
199
  className: "space-y-1",
199
- children: i.map((e) => /* @__PURE__ */ f("li", {
200
+ children: a.map((e) => /* @__PURE__ */ p("li", {
200
201
  className: "flex items-center justify-between gap-2 border rounded-md p-2 text-sm",
201
- children: [/* @__PURE__ */ f("span", {
202
+ children: [/* @__PURE__ */ p("span", {
202
203
  className: "min-w-0 truncate",
203
- children: [/* @__PURE__ */ d("span", {
204
+ children: [/* @__PURE__ */ f("span", {
204
205
  className: "text-muted-foreground mr-2",
205
206
  children: e.key
206
207
  }), e.title]
207
- }), /* @__PURE__ */ f("span", {
208
+ }), /* @__PURE__ */ p("span", {
208
209
  className: "flex items-center gap-2 shrink-0",
209
210
  children: [
210
- /* @__PURE__ */ d(S, {
211
+ /* @__PURE__ */ f(C, {
211
212
  variant: "secondary",
212
213
  className: "text-xs capitalize",
213
- children: K(e.status)
214
+ children: q(e.status)
214
215
  }),
215
- /* @__PURE__ */ f("span", {
216
+ /* @__PURE__ */ p("span", {
216
217
  className: "text-xs text-muted-foreground",
217
218
  children: [e.storyPoints ?? 0, " pts"]
218
219
  }),
219
- !a && /* @__PURE__ */ d(C, {
220
+ !o && /* @__PURE__ */ f(w, {
220
221
  size: "sm",
221
222
  variant: "ghost",
222
223
  "aria-label": `Remove ${e.key} from sprint`,
223
- disabled: c.loading,
224
- onClick: () => g(e.id),
225
- children: m === e.id ? "…" : /* @__PURE__ */ d(o, { className: "h-4 w-4" })
224
+ disabled: l.loading,
225
+ onClick: () => _(e.id),
226
+ children: h === e.id ? "…" : /* @__PURE__ */ f(s, { className: "h-4 w-4" })
226
227
  })
227
228
  ]
228
229
  })]
@@ -231,128 +232,128 @@ function q({ sprintId: e, projectId: t, status: r, items: i }) {
231
232
  ]
232
233
  });
233
234
  }
234
- function J({ sprintId: r, projectId: i }) {
235
- let { workspaceId: o } = e(), [s, c] = n(!1), [p, m] = n(""), h = t(p.trim()), [g, _] = n(/* @__PURE__ */ new Set()), [v, y] = n(null), { data: b, loading: x } = u(G, {
235
+ function Y({ sprintId: i, projectId: a }) {
236
+ let { workspaceId: s } = e(), [c, l] = r(!1), [m, h] = r(""), g = n(m.trim()), [_, v] = r(/* @__PURE__ */ new Set()), [y, b] = r(null), { data: x, loading: S } = d(K, {
236
237
  variables: {
237
- workspaceId: o ?? "",
238
+ workspaceId: s ?? "",
238
239
  filter: {
239
- projectId: i,
240
- ...h ? { search: h } : {}
240
+ projectId: a,
241
+ ...g ? { search: g } : {}
241
242
  }
242
243
  },
243
- skip: !s || !o,
244
+ skip: !c || !s,
244
245
  fetchPolicy: "network-only"
245
- }), [N, P] = l(U, {
246
- refetchQueries: I,
246
+ }), [P, F] = u(W, {
247
+ refetchQueries: L,
247
248
  awaitRefetchQueries: !0
248
- }), F = (b?.planmagnetWorkItems.items ?? []).filter((e) => e.sprintId !== r), L = b?.planmagnetWorkItems.totalCount ?? 0, R = (e, t) => _((n) => {
249
+ }), I = (x?.planmagnetWorkItems.items ?? []).filter((e) => e.sprintId !== i), R = x?.planmagnetWorkItems.totalCount ?? 0, z = (e, t) => v((n) => {
249
250
  let r = new Set(n);
250
251
  return t ? r.add(e) : r.delete(e), r;
251
- }), z = () => {
252
- _(/* @__PURE__ */ new Set()), m(""), y(null);
252
+ }), B = () => {
253
+ v(/* @__PURE__ */ new Set()), h(""), b(null);
253
254
  };
254
- return /* @__PURE__ */ f(E, {
255
- open: s,
255
+ return /* @__PURE__ */ p(D, {
256
+ open: c,
256
257
  onOpenChange: (e) => {
257
- c(e), e || z();
258
+ l(e), e || B();
258
259
  },
259
- children: [/* @__PURE__ */ d(M, {
260
+ children: [/* @__PURE__ */ f(N, {
260
261
  asChild: !0,
261
- children: /* @__PURE__ */ f(C, {
262
+ children: /* @__PURE__ */ p(w, {
262
263
  size: "sm",
263
264
  variant: "outline",
264
- children: [/* @__PURE__ */ d(a, { className: "mr-1 h-4 w-4" }), "Add work items"]
265
+ children: [/* @__PURE__ */ f(o, { className: "mr-1 h-4 w-4" }), "Add work items"]
265
266
  })
266
- }), /* @__PURE__ */ f(D, {
267
+ }), /* @__PURE__ */ p(O, {
267
268
  className: "max-w-lg",
268
269
  children: [
269
- /* @__PURE__ */ f(A, { children: [/* @__PURE__ */ d(j, { children: "Add work items" }), /* @__PURE__ */ d(O, { children: "Work items from this sprint's project. An item already in another sprint moves here." })] }),
270
- /* @__PURE__ */ d(T, {
271
- value: p,
272
- onChange: (e) => m(e.target.value),
270
+ /* @__PURE__ */ p(j, { children: [/* @__PURE__ */ f(M, { children: "Add work items" }), /* @__PURE__ */ f(k, { children: "Work items from this sprint's project. An item already in another sprint moves here." })] }),
271
+ /* @__PURE__ */ f(E, {
272
+ value: m,
273
+ onChange: (e) => h(e.target.value),
273
274
  placeholder: "Search by title",
274
275
  "aria-label": "Search work items"
275
276
  }),
276
- /* @__PURE__ */ f("div", {
277
+ /* @__PURE__ */ p("div", {
277
278
  className: "max-h-80 overflow-y-auto space-y-1",
278
279
  "data-testid": "sprint-add-candidates",
279
280
  children: [
280
- x && /* @__PURE__ */ d("p", {
281
+ S && /* @__PURE__ */ f("p", {
281
282
  className: "text-sm text-muted-foreground py-4 text-center",
282
283
  children: "Loading…"
283
284
  }),
284
- !x && F.length === 0 && /* @__PURE__ */ d("p", {
285
+ !S && I.length === 0 && /* @__PURE__ */ f("p", {
285
286
  className: "text-sm text-muted-foreground py-4 text-center",
286
- children: h ? "No matching work items." : "Every work item in this project is already in this sprint."
287
+ children: g ? "No matching work items." : "Every work item in this project is already in this sprint."
287
288
  }),
288
- F.map((e) => {
289
+ I.map((e) => {
289
290
  let t = `sprint-add-${e.id}`;
290
- return /* @__PURE__ */ f("label", {
291
+ return /* @__PURE__ */ p("label", {
291
292
  htmlFor: t,
292
293
  className: "flex items-center gap-3 border rounded-md p-2 text-sm cursor-pointer hover:bg-muted",
293
294
  children: [
294
- /* @__PURE__ */ d(w, {
295
+ /* @__PURE__ */ f(T, {
295
296
  id: t,
296
- checked: g.has(e.id),
297
- onCheckedChange: (t) => R(e.id, t === !0)
297
+ checked: _.has(e.id),
298
+ onCheckedChange: (t) => z(e.id, t === !0)
298
299
  }),
299
- /* @__PURE__ */ f("span", {
300
+ /* @__PURE__ */ p("span", {
300
301
  className: "min-w-0 flex-1 truncate",
301
- children: [/* @__PURE__ */ d("span", {
302
+ children: [/* @__PURE__ */ f("span", {
302
303
  className: "text-muted-foreground mr-2",
303
304
  children: e.key
304
305
  }), e.title]
305
306
  }),
306
- e.sprintId && /* @__PURE__ */ d("span", {
307
+ e.sprintId && /* @__PURE__ */ f("span", {
307
308
  className: "text-xs text-muted-foreground shrink-0",
308
309
  children: "in another sprint"
309
310
  }),
310
- /* @__PURE__ */ d(S, {
311
+ /* @__PURE__ */ f(C, {
311
312
  variant: "secondary",
312
313
  className: "text-xs capitalize shrink-0",
313
- children: K(e.status)
314
+ children: q(e.status)
314
315
  })
315
316
  ]
316
317
  }, e.id);
317
318
  }),
318
- L > 100 && /* @__PURE__ */ f("p", {
319
+ R > 100 && /* @__PURE__ */ p("p", {
319
320
  className: "text-xs text-muted-foreground pt-2",
320
321
  children: [
321
322
  "Showing the first 100 of ",
322
- L,
323
+ R,
323
324
  ". Search to narrow the list."
324
325
  ]
325
326
  })
326
327
  ]
327
328
  }),
328
- v && /* @__PURE__ */ d(B, { message: v }),
329
- /* @__PURE__ */ d(k, { children: /* @__PURE__ */ d(C, {
329
+ y && /* @__PURE__ */ f(V, { message: y }),
330
+ /* @__PURE__ */ f(A, { children: /* @__PURE__ */ f(w, {
330
331
  onClick: async () => {
331
- y(null);
332
+ b(null);
332
333
  try {
333
- await N({ variables: {
334
- id: r,
335
- input: { workItemIds: [...g] }
336
- } }), z(), c(!1);
334
+ await t(P({ variables: {
335
+ id: i,
336
+ input: { workItemIds: [..._] }
337
+ } })), B(), l(!1);
337
338
  } catch (e) {
338
- y(e instanceof Error ? e.message : "The work items could not be added.");
339
+ b(e instanceof Error ? e.message : "The work items could not be added.");
339
340
  }
340
341
  },
341
- disabled: g.size === 0 || P.loading,
342
+ disabled: _.size === 0 || F.loading,
342
343
  "data-testid": "sprint-add-confirm",
343
- children: P.loading ? "Adding…" : `Add ${g.size} work item${g.size === 1 ? "" : "s"}`
344
+ children: F.loading ? "Adding…" : `Add ${_.size} work item${_.size === 1 ? "" : "s"}`
344
345
  }) })
345
346
  ]
346
347
  })]
347
348
  });
348
349
  }
349
- var Y = c`
350
+ var X = l`
350
351
  mutation SprintControlsCreate($input: PlanmagnetCreateSprintInput!) {
351
352
  planmagnetCreateSprint(input: $input) {
352
353
  id
353
354
  }
354
355
  }
355
- `, X = c`
356
+ `, Z = l`
356
357
  query SprintControlsProjects($workspaceId: ID!) {
357
358
  planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {
358
359
  items {
@@ -361,7 +362,7 @@ var Y = c`
361
362
  }
362
363
  }
363
364
  }
364
- `, Z = {
365
+ `, Q = {
365
366
  name: "",
366
367
  projectId: "",
367
368
  startDate: "",
@@ -369,154 +370,154 @@ var Y = c`
369
370
  goal: "",
370
371
  capacity: ""
371
372
  };
372
- function Q({ onCreated: t }) {
373
- let { workspaceId: r } = e(), [i, o] = n(!1), [s, c] = n(Z), [p, m] = n(null), { data: h } = u(X, {
374
- variables: { workspaceId: r ?? "" },
375
- skip: !i || !r
376
- }), g = h?.planmagnetProjects.items ?? [], _ = s.projectId || g[0]?.id || "", [v, { loading: y }] = l(Y, {
377
- refetchQueries: I,
373
+ function $({ onCreated: n }) {
374
+ let { workspaceId: i } = e(), [a, s] = r(!1), [c, l] = r(Q), [m, h] = r(null), { data: g } = d(Z, {
375
+ variables: { workspaceId: i ?? "" },
376
+ skip: !a || !i
377
+ }), _ = g?.planmagnetProjects.items ?? [], v = c.projectId || _[0]?.id || "", [y, { loading: b }] = u(X, {
378
+ refetchQueries: L,
378
379
  awaitRefetchQueries: !0
379
- }), b = s.capacity.trim() === "" ? void 0 : Number(s.capacity), x = b !== void 0 && (!Number.isInteger(b) || b < 0), S = !!(s.startDate && s.endDate && s.endDate < s.startDate), w = s.name.trim() !== "" && _ !== "" && !x && !S && !y;
380
- return /* @__PURE__ */ f(E, {
381
- open: i,
380
+ }), x = c.capacity.trim() === "" ? void 0 : Number(c.capacity), S = x !== void 0 && (!Number.isInteger(x) || x < 0), C = !!(c.startDate && c.endDate && c.endDate < c.startDate), T = c.name.trim() !== "" && v !== "" && !S && !C && !b;
381
+ return /* @__PURE__ */ p(D, {
382
+ open: a,
382
383
  onOpenChange: (e) => {
383
- o(e), e || m(null);
384
+ s(e), e || h(null);
384
385
  },
385
- children: [/* @__PURE__ */ d(M, {
386
+ children: [/* @__PURE__ */ f(N, {
386
387
  asChild: !0,
387
- children: /* @__PURE__ */ f(C, {
388
+ children: /* @__PURE__ */ p(w, {
388
389
  size: "sm",
389
- children: [/* @__PURE__ */ d(a, { className: "mr-1 h-4 w-4" }), "New sprint"]
390
+ children: [/* @__PURE__ */ f(o, { className: "mr-1 h-4 w-4" }), "New sprint"]
390
391
  })
391
- }), /* @__PURE__ */ f(D, {
392
+ }), /* @__PURE__ */ p(O, {
392
393
  className: "max-w-lg",
393
394
  children: [
394
- /* @__PURE__ */ f(A, { children: [/* @__PURE__ */ d(j, { children: "New sprint" }), /* @__PURE__ */ d(O, { children: "The sprint starts in Planning. Start it when it is ready." })] }),
395
- /* @__PURE__ */ f("div", {
395
+ /* @__PURE__ */ p(j, { children: [/* @__PURE__ */ f(M, { children: "New sprint" }), /* @__PURE__ */ f(k, { children: "The sprint starts in Planning. Start it when it is ready." })] }),
396
+ /* @__PURE__ */ p("div", {
396
397
  className: "space-y-3",
397
398
  children: [
398
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
399
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
399
400
  htmlFor: "new-sprint-name",
400
401
  className: "text-sm font-medium",
401
402
  children: "Name"
402
- }), /* @__PURE__ */ d(T, {
403
+ }), /* @__PURE__ */ f(E, {
403
404
  id: "new-sprint-name",
404
405
  className: "mt-1",
405
- value: s.name,
406
- onChange: (e) => c({
407
- ...s,
406
+ value: c.name,
407
+ onChange: (e) => l({
408
+ ...c,
408
409
  name: e.target.value
409
410
  })
410
411
  })] }),
411
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
412
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
412
413
  htmlFor: "new-sprint-project",
413
414
  className: "text-sm font-medium",
414
415
  children: "Project"
415
- }), /* @__PURE__ */ f("select", {
416
+ }), /* @__PURE__ */ p("select", {
416
417
  id: "new-sprint-project",
417
418
  className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
418
- value: _,
419
- onChange: (e) => c({
420
- ...s,
419
+ value: v,
420
+ onChange: (e) => l({
421
+ ...c,
421
422
  projectId: e.target.value
422
423
  }),
423
- children: [g.length === 0 && /* @__PURE__ */ d("option", {
424
+ children: [_.length === 0 && /* @__PURE__ */ f("option", {
424
425
  value: "",
425
426
  children: "No projects"
426
- }), g.map((e) => /* @__PURE__ */ d("option", {
427
+ }), _.map((e) => /* @__PURE__ */ f("option", {
427
428
  value: e.id,
428
429
  children: e.name
429
430
  }, e.id))]
430
431
  })] }),
431
- /* @__PURE__ */ f("div", {
432
+ /* @__PURE__ */ p("div", {
432
433
  className: "grid grid-cols-2 gap-3",
433
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
434
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
434
435
  htmlFor: "new-sprint-start",
435
436
  className: "text-sm font-medium",
436
437
  children: "Start date"
437
- }), /* @__PURE__ */ d(T, {
438
+ }), /* @__PURE__ */ f(E, {
438
439
  id: "new-sprint-start",
439
440
  type: "date",
440
441
  className: "mt-1",
441
- value: s.startDate,
442
- onChange: (e) => c({
443
- ...s,
442
+ value: c.startDate,
443
+ onChange: (e) => l({
444
+ ...c,
444
445
  startDate: e.target.value
445
446
  })
446
- })] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
447
+ })] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
447
448
  htmlFor: "new-sprint-end",
448
449
  className: "text-sm font-medium",
449
450
  children: "End date"
450
- }), /* @__PURE__ */ d(T, {
451
+ }), /* @__PURE__ */ f(E, {
451
452
  id: "new-sprint-end",
452
453
  type: "date",
453
454
  className: "mt-1",
454
- value: s.endDate,
455
- onChange: (e) => c({
456
- ...s,
455
+ value: c.endDate,
456
+ onChange: (e) => l({
457
+ ...c,
457
458
  endDate: e.target.value
458
459
  })
459
460
  })] })]
460
461
  }),
461
- S && /* @__PURE__ */ d(B, { message: "The end date is before the start date." }),
462
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
462
+ C && /* @__PURE__ */ f(V, { message: "The end date is before the start date." }),
463
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
463
464
  htmlFor: "new-sprint-capacity",
464
465
  className: "text-sm font-medium",
465
466
  children: "Capacity (story points)"
466
- }), /* @__PURE__ */ d(T, {
467
+ }), /* @__PURE__ */ f(E, {
467
468
  id: "new-sprint-capacity",
468
469
  type: "number",
469
470
  min: 0,
470
471
  className: "mt-1",
471
- value: s.capacity,
472
- onChange: (e) => c({
473
- ...s,
472
+ value: c.capacity,
473
+ onChange: (e) => l({
474
+ ...c,
474
475
  capacity: e.target.value
475
476
  })
476
477
  })] }),
477
- x && /* @__PURE__ */ d(B, { message: "Capacity must be a whole number, 0 or more." }),
478
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
478
+ S && /* @__PURE__ */ f(V, { message: "Capacity must be a whole number, 0 or more." }),
479
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
479
480
  htmlFor: "new-sprint-goal",
480
481
  className: "text-sm font-medium",
481
482
  children: "Goal"
482
- }), /* @__PURE__ */ d(T, {
483
+ }), /* @__PURE__ */ f(E, {
483
484
  id: "new-sprint-goal",
484
485
  className: "mt-1",
485
- value: s.goal,
486
- onChange: (e) => c({
487
- ...s,
486
+ value: c.goal,
487
+ onChange: (e) => l({
488
+ ...c,
488
489
  goal: e.target.value
489
490
  })
490
491
  })] })
491
492
  ]
492
493
  }),
493
- p && /* @__PURE__ */ d(B, { message: p }),
494
- /* @__PURE__ */ d(k, { children: /* @__PURE__ */ d(C, {
494
+ m && /* @__PURE__ */ f(V, { message: m }),
495
+ /* @__PURE__ */ f(A, { children: /* @__PURE__ */ f(w, {
495
496
  onClick: async () => {
496
- m(null);
497
+ h(null);
497
498
  try {
498
- let e = (await v({ variables: { input: {
499
- name: s.name.trim(),
500
- projectId: _,
501
- startDate: s.startDate || void 0,
502
- endDate: s.endDate || void 0,
503
- goal: s.goal.trim() || void 0,
504
- capacity: b
505
- } } })).data?.planmagnetCreateSprint.id;
506
- c(Z), o(!1), e && t(e);
499
+ let e = (await t(y({ variables: { input: {
500
+ name: c.name.trim(),
501
+ projectId: v,
502
+ startDate: c.startDate || void 0,
503
+ endDate: c.endDate || void 0,
504
+ goal: c.goal.trim() || void 0,
505
+ capacity: x
506
+ } } }))).data?.planmagnetCreateSprint.id;
507
+ l(Q), s(!1), e && n(e);
507
508
  } catch (e) {
508
- m(e instanceof Error ? e.message : "The sprint could not be created.");
509
+ h(e instanceof Error ? e.message : "The sprint could not be created.");
509
510
  }
510
511
  },
511
- disabled: !w,
512
+ disabled: !T,
512
513
  "data-testid": "new-sprint-submit",
513
- children: y ? "Creating…" : "Create sprint"
514
+ children: b ? "Creating…" : "Create sprint"
514
515
  }) })
515
516
  ]
516
517
  })]
517
518
  });
518
519
  }
519
520
  //#endregion
520
- export { Q as NewSprintDialog, V as SprintLifecycleActions, q as SprintWorkItemsPanel };
521
+ export { $ as NewSprintDialog, H as SprintLifecycleActions, J as SprintWorkItemsPanel };
521
522
 
522
523
  //# sourceMappingURL=SprintControls.js.map