@burdenoff/microfe-planmagnet 2026.927.2 → 2026.927.3

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