@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.
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +159 -158
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
- package/dist/planmagnet/create/CreateDialogs.js +118 -117
- package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
- package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +322 -280
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +147 -126
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.js +202 -201
- package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
- package/dist/planmagnet/utils/mutationResult.d.ts +16 -0
- package/dist/planmagnet/utils/mutationResult.d.ts.map +1 -0
- package/dist/planmagnet/utils/mutationResult.js +10 -0
- package/dist/planmagnet/utils/mutationResult.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
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
|
|
25
|
+
var L = [
|
|
25
26
|
"GetSprints",
|
|
26
27
|
"GetSprintDetail",
|
|
27
28
|
"GetSprintForEdit",
|
|
28
29
|
"GetDashboardData"
|
|
29
|
-
],
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
52
|
-
return /* @__PURE__ */
|
|
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
|
|
59
|
-
let
|
|
60
|
-
refetchQueries:
|
|
59
|
+
function H({ sprintId: e, sprintName: n, status: o }) {
|
|
60
|
+
let s = {
|
|
61
|
+
refetchQueries: L,
|
|
61
62
|
awaitRefetchQueries: !0
|
|
62
|
-
}, [
|
|
63
|
-
if (
|
|
64
|
-
let
|
|
65
|
-
|
|
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
|
-
|
|
70
|
+
y(e instanceof Error ? e.message : "The sprint could not be updated.");
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
76
|
+
children: [/* @__PURE__ */ p("div", {
|
|
76
77
|
className: "flex gap-2",
|
|
77
78
|
children: [
|
|
78
|
-
|
|
79
|
+
x.includes("start") && /* @__PURE__ */ p(w, {
|
|
79
80
|
size: "sm",
|
|
80
|
-
onClick: () =>
|
|
81
|
-
disabled:
|
|
82
|
-
children: [/* @__PURE__ */
|
|
81
|
+
onClick: () => S(l),
|
|
82
|
+
disabled: b,
|
|
83
|
+
children: [/* @__PURE__ */ f(a, { className: "mr-1 h-4 w-4" }), "Start sprint"]
|
|
83
84
|
}),
|
|
84
|
-
|
|
85
|
+
x.includes("complete") && /* @__PURE__ */ f(U, {
|
|
85
86
|
label: "Complete sprint",
|
|
86
|
-
icon: /* @__PURE__ */
|
|
87
|
-
title: `Complete ${
|
|
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:
|
|
91
|
-
onConfirm: () =>
|
|
91
|
+
disabled: b,
|
|
92
|
+
onConfirm: () => S(m)
|
|
92
93
|
}),
|
|
93
|
-
|
|
94
|
+
x.includes("cancel") && /* @__PURE__ */ f(U, {
|
|
94
95
|
label: "Cancel sprint",
|
|
95
96
|
variant: "outline",
|
|
96
|
-
icon: /* @__PURE__ */
|
|
97
|
-
title: `Cancel ${
|
|
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:
|
|
102
|
-
onConfirm: () =>
|
|
102
|
+
disabled: b,
|
|
103
|
+
onConfirm: () => S(g)
|
|
103
104
|
})
|
|
104
105
|
]
|
|
105
|
-
}),
|
|
106
|
+
}), v && /* @__PURE__ */ f(V, { message: v })]
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
150
|
-
function
|
|
151
|
-
let
|
|
152
|
-
refetchQueries:
|
|
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
|
-
}), [
|
|
155
|
-
|
|
155
|
+
}), [d, m] = r(null), [h, g] = r(null), _ = async (n) => {
|
|
156
|
+
m(null), g(n);
|
|
156
157
|
try {
|
|
157
|
-
await
|
|
158
|
+
await t(c({ variables: {
|
|
158
159
|
id: e,
|
|
159
|
-
input: { workItemIds: [
|
|
160
|
-
} });
|
|
160
|
+
input: { workItemIds: [n] }
|
|
161
|
+
} }));
|
|
161
162
|
} catch (e) {
|
|
162
|
-
|
|
163
|
+
m(e instanceof Error ? e.message : "The work item could not be removed.");
|
|
163
164
|
} finally {
|
|
164
|
-
|
|
165
|
+
g(null);
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ p("div", {
|
|
168
169
|
className: "space-y-3",
|
|
169
170
|
"data-testid": "sprint-work-items",
|
|
170
171
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ p("div", {
|
|
172
173
|
className: "flex items-center justify-between",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ p("p", {
|
|
174
175
|
className: "text-sm text-muted-foreground",
|
|
175
176
|
children: [
|
|
176
|
-
|
|
177
|
+
a.length,
|
|
177
178
|
" work item",
|
|
178
|
-
|
|
179
|
+
a.length === 1 ? "" : "s"
|
|
179
180
|
]
|
|
180
|
-
}), !
|
|
181
|
+
}), !o && /* @__PURE__ */ f(Y, {
|
|
181
182
|
sprintId: e,
|
|
182
|
-
projectId:
|
|
183
|
+
projectId: n
|
|
183
184
|
})]
|
|
184
185
|
}),
|
|
185
|
-
|
|
186
|
+
o && /* @__PURE__ */ p("p", {
|
|
186
187
|
className: "text-xs text-muted-foreground",
|
|
187
188
|
children: [
|
|
188
189
|
"This sprint is ",
|
|
189
|
-
|
|
190
|
+
q(i),
|
|
190
191
|
"; its work items can no longer be changed."
|
|
191
192
|
]
|
|
192
193
|
}),
|
|
193
|
-
|
|
194
|
-
|
|
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__ */
|
|
198
|
+
}) : /* @__PURE__ */ f("ul", {
|
|
198
199
|
className: "space-y-1",
|
|
199
|
-
children:
|
|
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__ */
|
|
202
|
+
children: [/* @__PURE__ */ p("span", {
|
|
202
203
|
className: "min-w-0 truncate",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ f("span", {
|
|
204
205
|
className: "text-muted-foreground mr-2",
|
|
205
206
|
children: e.key
|
|
206
207
|
}), e.title]
|
|
207
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ p("span", {
|
|
208
209
|
className: "flex items-center gap-2 shrink-0",
|
|
209
210
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ f(C, {
|
|
211
212
|
variant: "secondary",
|
|
212
213
|
className: "text-xs capitalize",
|
|
213
|
-
children:
|
|
214
|
+
children: q(e.status)
|
|
214
215
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ p("span", {
|
|
216
217
|
className: "text-xs text-muted-foreground",
|
|
217
218
|
children: [e.storyPoints ?? 0, " pts"]
|
|
218
219
|
}),
|
|
219
|
-
!
|
|
220
|
+
!o && /* @__PURE__ */ f(w, {
|
|
220
221
|
size: "sm",
|
|
221
222
|
variant: "ghost",
|
|
222
223
|
"aria-label": `Remove ${e.key} from sprint`,
|
|
223
|
-
disabled:
|
|
224
|
-
onClick: () =>
|
|
225
|
-
children:
|
|
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
|
|
235
|
-
let { workspaceId:
|
|
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:
|
|
238
|
+
workspaceId: s ?? "",
|
|
238
239
|
filter: {
|
|
239
|
-
projectId:
|
|
240
|
-
...
|
|
240
|
+
projectId: a,
|
|
241
|
+
...g ? { search: g } : {}
|
|
241
242
|
}
|
|
242
243
|
},
|
|
243
|
-
skip: !
|
|
244
|
+
skip: !c || !s,
|
|
244
245
|
fetchPolicy: "network-only"
|
|
245
|
-
}), [
|
|
246
|
-
refetchQueries:
|
|
246
|
+
}), [P, F] = u(W, {
|
|
247
|
+
refetchQueries: L,
|
|
247
248
|
awaitRefetchQueries: !0
|
|
248
|
-
}),
|
|
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
|
-
}),
|
|
252
|
-
|
|
252
|
+
}), B = () => {
|
|
253
|
+
v(/* @__PURE__ */ new Set()), h(""), b(null);
|
|
253
254
|
};
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
open:
|
|
255
|
+
return /* @__PURE__ */ p(D, {
|
|
256
|
+
open: c,
|
|
256
257
|
onOpenChange: (e) => {
|
|
257
|
-
|
|
258
|
+
l(e), e || B();
|
|
258
259
|
},
|
|
259
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ f(N, {
|
|
260
261
|
asChild: !0,
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ p(w, {
|
|
262
263
|
size: "sm",
|
|
263
264
|
variant: "outline",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ f(o, { className: "mr-1 h-4 w-4" }), "Add work items"]
|
|
265
266
|
})
|
|
266
|
-
}), /* @__PURE__ */
|
|
267
|
+
}), /* @__PURE__ */ p(O, {
|
|
267
268
|
className: "max-w-lg",
|
|
268
269
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
value:
|
|
272
|
-
onChange: (e) =>
|
|
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__ */
|
|
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
|
-
|
|
281
|
+
S && /* @__PURE__ */ f("p", {
|
|
281
282
|
className: "text-sm text-muted-foreground py-4 text-center",
|
|
282
283
|
children: "Loading…"
|
|
283
284
|
}),
|
|
284
|
-
!
|
|
285
|
+
!S && I.length === 0 && /* @__PURE__ */ f("p", {
|
|
285
286
|
className: "text-sm text-muted-foreground py-4 text-center",
|
|
286
|
-
children:
|
|
287
|
+
children: g ? "No matching work items." : "Every work item in this project is already in this sprint."
|
|
287
288
|
}),
|
|
288
|
-
|
|
289
|
+
I.map((e) => {
|
|
289
290
|
let t = `sprint-add-${e.id}`;
|
|
290
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
295
|
+
/* @__PURE__ */ f(T, {
|
|
295
296
|
id: t,
|
|
296
|
-
checked:
|
|
297
|
-
onCheckedChange: (t) =>
|
|
297
|
+
checked: _.has(e.id),
|
|
298
|
+
onCheckedChange: (t) => z(e.id, t === !0)
|
|
298
299
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ p("span", {
|
|
300
301
|
className: "min-w-0 flex-1 truncate",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
311
|
+
/* @__PURE__ */ f(C, {
|
|
311
312
|
variant: "secondary",
|
|
312
313
|
className: "text-xs capitalize shrink-0",
|
|
313
|
-
children:
|
|
314
|
+
children: q(e.status)
|
|
314
315
|
})
|
|
315
316
|
]
|
|
316
317
|
}, e.id);
|
|
317
318
|
}),
|
|
318
|
-
|
|
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
|
-
|
|
323
|
+
R,
|
|
323
324
|
". Search to narrow the list."
|
|
324
325
|
]
|
|
325
326
|
})
|
|
326
327
|
]
|
|
327
328
|
}),
|
|
328
|
-
|
|
329
|
-
/* @__PURE__ */
|
|
329
|
+
y && /* @__PURE__ */ f(V, { message: y }),
|
|
330
|
+
/* @__PURE__ */ f(A, { children: /* @__PURE__ */ f(w, {
|
|
330
331
|
onClick: async () => {
|
|
331
|
-
|
|
332
|
+
b(null);
|
|
332
333
|
try {
|
|
333
|
-
await
|
|
334
|
-
id:
|
|
335
|
-
input: { workItemIds: [...
|
|
336
|
-
} }),
|
|
334
|
+
await t(P({ variables: {
|
|
335
|
+
id: i,
|
|
336
|
+
input: { workItemIds: [..._] }
|
|
337
|
+
} })), B(), l(!1);
|
|
337
338
|
} catch (e) {
|
|
338
|
-
|
|
339
|
+
b(e instanceof Error ? e.message : "The work items could not be added.");
|
|
339
340
|
}
|
|
340
341
|
},
|
|
341
|
-
disabled:
|
|
342
|
+
disabled: _.size === 0 || F.loading,
|
|
342
343
|
"data-testid": "sprint-add-confirm",
|
|
343
|
-
children:
|
|
344
|
+
children: F.loading ? "Adding…" : `Add ${_.size} work item${_.size === 1 ? "" : "s"}`
|
|
344
345
|
}) })
|
|
345
346
|
]
|
|
346
347
|
})]
|
|
347
348
|
});
|
|
348
349
|
}
|
|
349
|
-
var
|
|
350
|
+
var X = l`
|
|
350
351
|
mutation SprintControlsCreate($input: PlanmagnetCreateSprintInput!) {
|
|
351
352
|
planmagnetCreateSprint(input: $input) {
|
|
352
353
|
id
|
|
353
354
|
}
|
|
354
355
|
}
|
|
355
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
373
|
-
let { workspaceId:
|
|
374
|
-
variables: { workspaceId:
|
|
375
|
-
skip: !
|
|
376
|
-
}),
|
|
377
|
-
refetchQueries:
|
|
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
|
-
}),
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
open:
|
|
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
|
-
|
|
384
|
+
s(e), e || h(null);
|
|
384
385
|
},
|
|
385
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ f(N, {
|
|
386
387
|
asChild: !0,
|
|
387
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ p(w, {
|
|
388
389
|
size: "sm",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ f(o, { className: "mr-1 h-4 w-4" }), "New sprint"]
|
|
390
391
|
})
|
|
391
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ p(O, {
|
|
392
393
|
className: "max-w-lg",
|
|
393
394
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
403
|
+
}), /* @__PURE__ */ f(E, {
|
|
403
404
|
id: "new-sprint-name",
|
|
404
405
|
className: "mt-1",
|
|
405
|
-
value:
|
|
406
|
-
onChange: (e) =>
|
|
407
|
-
...
|
|
406
|
+
value: c.name,
|
|
407
|
+
onChange: (e) => l({
|
|
408
|
+
...c,
|
|
408
409
|
name: e.target.value
|
|
409
410
|
})
|
|
410
411
|
})] }),
|
|
411
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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) =>
|
|
420
|
-
...
|
|
419
|
+
value: v,
|
|
420
|
+
onChange: (e) => l({
|
|
421
|
+
...c,
|
|
421
422
|
projectId: e.target.value
|
|
422
423
|
}),
|
|
423
|
-
children: [
|
|
424
|
+
children: [_.length === 0 && /* @__PURE__ */ f("option", {
|
|
424
425
|
value: "",
|
|
425
426
|
children: "No projects"
|
|
426
|
-
}),
|
|
427
|
+
}), _.map((e) => /* @__PURE__ */ f("option", {
|
|
427
428
|
value: e.id,
|
|
428
429
|
children: e.name
|
|
429
430
|
}, e.id))]
|
|
430
431
|
})] }),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ p("div", {
|
|
432
433
|
className: "grid grid-cols-2 gap-3",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
438
|
+
}), /* @__PURE__ */ f(E, {
|
|
438
439
|
id: "new-sprint-start",
|
|
439
440
|
type: "date",
|
|
440
441
|
className: "mt-1",
|
|
441
|
-
value:
|
|
442
|
-
onChange: (e) =>
|
|
443
|
-
...
|
|
442
|
+
value: c.startDate,
|
|
443
|
+
onChange: (e) => l({
|
|
444
|
+
...c,
|
|
444
445
|
startDate: e.target.value
|
|
445
446
|
})
|
|
446
|
-
})] }), /* @__PURE__ */
|
|
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__ */
|
|
451
|
+
}), /* @__PURE__ */ f(E, {
|
|
451
452
|
id: "new-sprint-end",
|
|
452
453
|
type: "date",
|
|
453
454
|
className: "mt-1",
|
|
454
|
-
value:
|
|
455
|
-
onChange: (e) =>
|
|
456
|
-
...
|
|
455
|
+
value: c.endDate,
|
|
456
|
+
onChange: (e) => l({
|
|
457
|
+
...c,
|
|
457
458
|
endDate: e.target.value
|
|
458
459
|
})
|
|
459
460
|
})] })]
|
|
460
461
|
}),
|
|
461
|
-
|
|
462
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
472
|
-
onChange: (e) =>
|
|
473
|
-
...
|
|
472
|
+
value: c.capacity,
|
|
473
|
+
onChange: (e) => l({
|
|
474
|
+
...c,
|
|
474
475
|
capacity: e.target.value
|
|
475
476
|
})
|
|
476
477
|
})] }),
|
|
477
|
-
|
|
478
|
-
/* @__PURE__ */
|
|
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__ */
|
|
483
|
+
}), /* @__PURE__ */ f(E, {
|
|
483
484
|
id: "new-sprint-goal",
|
|
484
485
|
className: "mt-1",
|
|
485
|
-
value:
|
|
486
|
-
onChange: (e) =>
|
|
487
|
-
...
|
|
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
|
-
|
|
494
|
-
/* @__PURE__ */
|
|
494
|
+
m && /* @__PURE__ */ f(V, { message: m }),
|
|
495
|
+
/* @__PURE__ */ f(A, { children: /* @__PURE__ */ f(w, {
|
|
495
496
|
onClick: async () => {
|
|
496
|
-
|
|
497
|
+
h(null);
|
|
497
498
|
try {
|
|
498
|
-
let e = (await
|
|
499
|
-
name:
|
|
500
|
-
projectId:
|
|
501
|
-
startDate:
|
|
502
|
-
endDate:
|
|
503
|
-
goal:
|
|
504
|
-
capacity:
|
|
505
|
-
} } })).data?.planmagnetCreateSprint.id;
|
|
506
|
-
|
|
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
|
-
|
|
509
|
+
h(e instanceof Error ? e.message : "The sprint could not be created.");
|
|
509
510
|
}
|
|
510
511
|
},
|
|
511
|
-
disabled: !
|
|
512
|
+
disabled: !T,
|
|
512
513
|
"data-testid": "new-sprint-submit",
|
|
513
|
-
children:
|
|
514
|
+
children: b ? "Creating…" : "Create sprint"
|
|
514
515
|
}) })
|
|
515
516
|
]
|
|
516
517
|
})]
|
|
517
518
|
});
|
|
518
519
|
}
|
|
519
520
|
//#endregion
|
|
520
|
-
export {
|
|
521
|
+
export { $ as NewSprintDialog, H as SprintLifecycleActions, J as SprintWorkItemsPanel };
|
|
521
522
|
|
|
522
523
|
//# sourceMappingURL=SprintControls.js.map
|