@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.
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.d.ts.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +128 -124
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js.map +1 -1
- package/dist/planmagnet/controls/ConfirmButton.d.ts +25 -0
- package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -0
- package/dist/planmagnet/controls/ConfirmButton.js +30 -0
- package/dist/planmagnet/controls/ConfirmButton.js.map +1 -0
- package/dist/planmagnet/controls/ProjectControls.d.ts +13 -0
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/ProjectControls.js +104 -0
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -0
- package/dist/planmagnet/controls/WorkItemControls.d.ts +52 -0
- package/dist/planmagnet/controls/WorkItemControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/WorkItemControls.js +198 -0
- package/dist/planmagnet/controls/WorkItemControls.js.map +1 -0
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DocsDocsPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +97 -90
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +150 -111
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +114 -91
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +134 -132
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +6 -5
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js +167 -111
- package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +147 -147
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js.map +1 -1
- package/dist/planmagnet/people/People.js +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts +34 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js +301 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js.map +1 -0
- package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.js +194 -215
- package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
- 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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
|
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
|
|
20
|
-
return Object.keys(
|
|
20
|
+
function O(e) {
|
|
21
|
+
return Object.keys(D).filter((t) => D[t].includes(e));
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function k(e) {
|
|
23
24
|
return e === "COMPLETED" || e === "CANCELLED";
|
|
24
25
|
}
|
|
25
|
-
var
|
|
26
|
+
var A = [
|
|
26
27
|
"GetSprints",
|
|
27
28
|
"GetSprintDetail",
|
|
28
29
|
"GetSprintForEdit",
|
|
29
30
|
"GetDashboardData"
|
|
30
|
-
],
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
}, [
|
|
64
|
-
if (
|
|
65
|
-
let
|
|
66
|
-
|
|
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
|
-
|
|
64
|
+
S(e instanceof Error ? e.message : "The sprint could not be updated.");
|
|
71
65
|
}
|
|
72
66
|
};
|
|
73
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
70
|
+
children: [/* @__PURE__ */ h("div", {
|
|
77
71
|
className: "flex gap-2",
|
|
78
72
|
children: [
|
|
79
|
-
|
|
73
|
+
w.includes("start") && /* @__PURE__ */ h(_, {
|
|
80
74
|
size: "sm",
|
|
81
|
-
onClick: () =>
|
|
82
|
-
disabled:
|
|
83
|
-
children: [/* @__PURE__ */
|
|
75
|
+
onClick: () => T(d),
|
|
76
|
+
disabled: C,
|
|
77
|
+
children: [/* @__PURE__ */ m(s, { className: "mr-1 h-4 w-4" }), "Start sprint"]
|
|
84
78
|
}),
|
|
85
|
-
|
|
79
|
+
w.includes("complete") && /* @__PURE__ */ m(n, {
|
|
86
80
|
label: "Complete sprint",
|
|
87
|
-
icon: /* @__PURE__ */
|
|
88
|
-
title: `Complete ${
|
|
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:
|
|
92
|
-
onConfirm: () =>
|
|
85
|
+
disabled: C,
|
|
86
|
+
onConfirm: () => T(g)
|
|
93
87
|
}),
|
|
94
|
-
|
|
88
|
+
w.includes("cancel") && /* @__PURE__ */ m(n, {
|
|
95
89
|
label: "Cancel sprint",
|
|
96
90
|
variant: "outline",
|
|
97
|
-
icon: /* @__PURE__ */
|
|
98
|
-
title: `Cancel ${
|
|
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:
|
|
103
|
-
onConfirm: () =>
|
|
96
|
+
disabled: C,
|
|
97
|
+
onConfirm: () => T(y)
|
|
104
98
|
})
|
|
105
99
|
]
|
|
106
|
-
}),
|
|
100
|
+
}), x && /* @__PURE__ */ m(r, { message: x })]
|
|
107
101
|
});
|
|
108
102
|
}
|
|
109
|
-
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
151
|
-
function
|
|
152
|
-
let
|
|
153
|
-
refetchQueries:
|
|
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,
|
|
156
|
-
|
|
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
|
-
|
|
142
|
+
p(e instanceof Error ? e.message : "The work item could not be removed.");
|
|
164
143
|
} finally {
|
|
165
|
-
|
|
144
|
+
y(null);
|
|
166
145
|
}
|
|
167
146
|
};
|
|
168
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ h("div", {
|
|
169
148
|
className: "space-y-3",
|
|
170
149
|
"data-testid": "sprint-work-items",
|
|
171
150
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ h("div", {
|
|
173
152
|
className: "flex items-center justify-between",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ h("p", {
|
|
175
154
|
className: "text-sm text-muted-foreground",
|
|
176
155
|
children: [
|
|
177
|
-
|
|
156
|
+
o.length,
|
|
178
157
|
" work item",
|
|
179
|
-
|
|
158
|
+
o.length === 1 ? "" : "s"
|
|
180
159
|
]
|
|
181
|
-
}), !
|
|
160
|
+
}), !s && /* @__PURE__ */ m(B, {
|
|
182
161
|
sprintId: e,
|
|
183
162
|
projectId: n
|
|
184
163
|
})]
|
|
185
164
|
}),
|
|
186
|
-
|
|
165
|
+
s && /* @__PURE__ */ h("p", {
|
|
187
166
|
className: "text-xs text-muted-foreground",
|
|
188
167
|
children: [
|
|
189
168
|
"This sprint is ",
|
|
190
|
-
|
|
169
|
+
R(i),
|
|
191
170
|
"; its work items can no longer be changed."
|
|
192
171
|
]
|
|
193
172
|
}),
|
|
194
|
-
d && /* @__PURE__ */
|
|
195
|
-
|
|
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__ */
|
|
177
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
199
178
|
className: "space-y-1",
|
|
200
|
-
children:
|
|
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__ */
|
|
181
|
+
children: [/* @__PURE__ */ h("span", {
|
|
203
182
|
className: "min-w-0 truncate",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ m("span", {
|
|
205
184
|
className: "text-muted-foreground mr-2",
|
|
206
185
|
children: e.key
|
|
207
186
|
}), e.title]
|
|
208
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ h("span", {
|
|
209
188
|
className: "flex items-center gap-2 shrink-0",
|
|
210
189
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ m(g, {
|
|
212
191
|
variant: "secondary",
|
|
213
192
|
className: "text-xs capitalize",
|
|
214
|
-
children:
|
|
193
|
+
children: R(e.status)
|
|
215
194
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ h("span", {
|
|
217
196
|
className: "text-xs text-muted-foreground",
|
|
218
197
|
children: [e.storyPoints ?? 0, " pts"]
|
|
219
198
|
}),
|
|
220
|
-
!
|
|
199
|
+
!s && /* @__PURE__ */ m(_, {
|
|
221
200
|
size: "sm",
|
|
222
201
|
variant: "ghost",
|
|
223
202
|
"aria-label": `Remove ${e.key} from sprint`,
|
|
224
|
-
disabled:
|
|
225
|
-
onClick: () =>
|
|
226
|
-
children:
|
|
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
|
|
236
|
-
let { workspaceId: s } = e(), [
|
|
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:
|
|
241
|
-
...
|
|
219
|
+
projectId: o,
|
|
220
|
+
...O ? { search: O } : {}
|
|
242
221
|
}
|
|
243
222
|
},
|
|
244
|
-
skip: !
|
|
223
|
+
skip: !l || !s,
|
|
245
224
|
fetchPolicy: "network-only"
|
|
246
|
-
}), [
|
|
247
|
-
refetchQueries:
|
|
225
|
+
}), [z, B] = f(F, {
|
|
226
|
+
refetchQueries: A,
|
|
248
227
|
awaitRefetchQueries: !0
|
|
249
|
-
}),
|
|
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
|
-
}),
|
|
253
|
-
|
|
231
|
+
}), W = () => {
|
|
232
|
+
j(/* @__PURE__ */ new Set()), D(""), N(null);
|
|
254
233
|
};
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
open:
|
|
234
|
+
return /* @__PURE__ */ h(b, {
|
|
235
|
+
open: l,
|
|
257
236
|
onOpenChange: (e) => {
|
|
258
|
-
|
|
237
|
+
u(e), e || W();
|
|
259
238
|
},
|
|
260
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ m(E, {
|
|
261
240
|
asChild: !0,
|
|
262
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ h(_, {
|
|
263
242
|
size: "sm",
|
|
264
243
|
variant: "outline",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ m(c, { className: "mr-1 h-4 w-4" }), "Add work items"]
|
|
266
245
|
})
|
|
267
|
-
}), /* @__PURE__ */
|
|
246
|
+
}), /* @__PURE__ */ h(x, {
|
|
268
247
|
className: "max-w-lg",
|
|
269
248
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
value:
|
|
273
|
-
onChange: (e) =>
|
|
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__ */
|
|
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
|
-
|
|
260
|
+
I && /* @__PURE__ */ m("p", {
|
|
282
261
|
className: "text-sm text-muted-foreground py-4 text-center",
|
|
283
262
|
children: "Loading…"
|
|
284
263
|
}),
|
|
285
|
-
!
|
|
264
|
+
!I && V.length === 0 && /* @__PURE__ */ m("p", {
|
|
286
265
|
className: "text-sm text-muted-foreground py-4 text-center",
|
|
287
|
-
children:
|
|
266
|
+
children: O ? "No matching work items." : "Every work item in this project is already in this sprint."
|
|
288
267
|
}),
|
|
289
|
-
|
|
268
|
+
V.map((e) => {
|
|
290
269
|
let t = `sprint-add-${e.id}`;
|
|
291
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
274
|
+
/* @__PURE__ */ m(v, {
|
|
296
275
|
id: t,
|
|
297
|
-
checked:
|
|
298
|
-
onCheckedChange: (t) =>
|
|
276
|
+
checked: k.has(e.id),
|
|
277
|
+
onCheckedChange: (t) => U(e.id, t === !0)
|
|
299
278
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ h("span", {
|
|
301
280
|
className: "min-w-0 flex-1 truncate",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
290
|
+
/* @__PURE__ */ m(g, {
|
|
312
291
|
variant: "secondary",
|
|
313
292
|
className: "text-xs capitalize shrink-0",
|
|
314
|
-
children:
|
|
293
|
+
children: R(e.status)
|
|
315
294
|
})
|
|
316
295
|
]
|
|
317
296
|
}, e.id);
|
|
318
297
|
}),
|
|
319
|
-
|
|
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
|
-
|
|
302
|
+
H,
|
|
324
303
|
". Search to narrow the list."
|
|
325
304
|
]
|
|
326
305
|
})
|
|
327
306
|
]
|
|
328
307
|
}),
|
|
329
|
-
|
|
330
|
-
/* @__PURE__ */
|
|
308
|
+
M && /* @__PURE__ */ m(r, { message: M }),
|
|
309
|
+
/* @__PURE__ */ m(C, { children: /* @__PURE__ */ m(_, {
|
|
331
310
|
onClick: async () => {
|
|
332
|
-
|
|
311
|
+
N(null);
|
|
333
312
|
try {
|
|
334
|
-
await t(
|
|
335
|
-
id:
|
|
336
|
-
input: { workItemIds: [...
|
|
337
|
-
} })),
|
|
313
|
+
await t(z({ variables: {
|
|
314
|
+
id: n,
|
|
315
|
+
input: { workItemIds: [...k] }
|
|
316
|
+
} })), W(), u(!1);
|
|
338
317
|
} catch (e) {
|
|
339
|
-
|
|
318
|
+
N(e instanceof Error ? e.message : "The work items could not be added.");
|
|
340
319
|
}
|
|
341
320
|
},
|
|
342
|
-
disabled:
|
|
321
|
+
disabled: k.size === 0 || B.loading,
|
|
343
322
|
"data-testid": "sprint-add-confirm",
|
|
344
|
-
children:
|
|
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
|
|
329
|
+
var V = d`
|
|
351
330
|
mutation SprintControlsCreate($input: PlanmagnetCreateSprintInput!) {
|
|
352
331
|
planmagnetCreateSprint(input: $input) {
|
|
353
332
|
id
|
|
354
333
|
}
|
|
355
334
|
}
|
|
356
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
374
|
-
let { workspaceId: i } = e(), [
|
|
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: !
|
|
377
|
-
}),
|
|
378
|
-
refetchQueries:
|
|
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
|
-
}),
|
|
381
|
-
return /* @__PURE__ */
|
|
382
|
-
open:
|
|
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 ||
|
|
363
|
+
s(e), e || g(null);
|
|
385
364
|
},
|
|
386
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ m(E, {
|
|
387
366
|
asChild: !0,
|
|
388
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ h(_, {
|
|
389
368
|
size: "sm",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ m(c, { className: "mr-1 h-4 w-4" }), "New sprint"]
|
|
391
370
|
})
|
|
392
|
-
}), /* @__PURE__ */
|
|
371
|
+
}), /* @__PURE__ */ h(x, {
|
|
393
372
|
className: "max-w-lg",
|
|
394
373
|
children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
382
|
+
}), /* @__PURE__ */ m(y, {
|
|
404
383
|
id: "new-sprint-name",
|
|
405
384
|
className: "mt-1",
|
|
406
|
-
value:
|
|
407
|
-
onChange: (e) =>
|
|
408
|
-
...
|
|
385
|
+
value: l.name,
|
|
386
|
+
onChange: (e) => u({
|
|
387
|
+
...l,
|
|
409
388
|
name: e.target.value
|
|
410
389
|
})
|
|
411
390
|
})] }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
422
|
-
onChange: (e) =>
|
|
423
|
-
...
|
|
400
|
+
value: M,
|
|
401
|
+
onChange: (e) => u({
|
|
402
|
+
...l,
|
|
424
403
|
projectId: e.target.value
|
|
425
404
|
}),
|
|
426
|
-
children: [
|
|
405
|
+
children: [j.length === 0 && /* @__PURE__ */ m("option", {
|
|
427
406
|
value: "",
|
|
428
|
-
children:
|
|
429
|
-
}),
|
|
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
|
-
|
|
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: [
|
|
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
|
|
421
|
+
onClick: () => void k(),
|
|
443
422
|
children: "Retry"
|
|
444
423
|
})]
|
|
445
424
|
}),
|
|
446
|
-
!
|
|
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__ */
|
|
430
|
+
/* @__PURE__ */ h("div", {
|
|
452
431
|
className: "grid grid-cols-2 gap-3",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
436
|
+
}), /* @__PURE__ */ m(y, {
|
|
458
437
|
id: "new-sprint-start",
|
|
459
438
|
type: "date",
|
|
460
439
|
className: "mt-1",
|
|
461
|
-
value:
|
|
462
|
-
onChange: (e) =>
|
|
463
|
-
...
|
|
440
|
+
value: l.startDate,
|
|
441
|
+
onChange: (e) => u({
|
|
442
|
+
...l,
|
|
464
443
|
startDate: e.target.value
|
|
465
444
|
})
|
|
466
|
-
})] }), /* @__PURE__ */
|
|
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__ */
|
|
449
|
+
}), /* @__PURE__ */ m(y, {
|
|
471
450
|
id: "new-sprint-end",
|
|
472
451
|
type: "date",
|
|
473
452
|
className: "mt-1",
|
|
474
|
-
value:
|
|
475
|
-
onChange: (e) =>
|
|
476
|
-
...
|
|
453
|
+
value: l.endDate,
|
|
454
|
+
onChange: (e) => u({
|
|
455
|
+
...l,
|
|
477
456
|
endDate: e.target.value
|
|
478
457
|
})
|
|
479
458
|
})] })]
|
|
480
459
|
}),
|
|
481
|
-
|
|
482
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
492
|
-
onChange: (e) =>
|
|
493
|
-
...
|
|
470
|
+
value: l.capacity,
|
|
471
|
+
onChange: (e) => u({
|
|
472
|
+
...l,
|
|
494
473
|
capacity: e.target.value
|
|
495
474
|
})
|
|
496
475
|
})] }),
|
|
497
|
-
|
|
498
|
-
/* @__PURE__ */
|
|
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__ */
|
|
481
|
+
}), /* @__PURE__ */ m(y, {
|
|
503
482
|
id: "new-sprint-goal",
|
|
504
483
|
className: "mt-1",
|
|
505
|
-
value:
|
|
506
|
-
onChange: (e) =>
|
|
507
|
-
...
|
|
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
|
-
|
|
514
|
-
/* @__PURE__ */
|
|
492
|
+
d && /* @__PURE__ */ m(r, { message: d }),
|
|
493
|
+
/* @__PURE__ */ m(C, { children: /* @__PURE__ */ m(_, {
|
|
515
494
|
onClick: async () => {
|
|
516
|
-
|
|
495
|
+
g(null);
|
|
517
496
|
try {
|
|
518
|
-
let e = (await t(
|
|
519
|
-
name:
|
|
520
|
-
projectId:
|
|
521
|
-
startDate:
|
|
522
|
-
endDate:
|
|
523
|
-
goal:
|
|
524
|
-
capacity:
|
|
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
|
-
|
|
505
|
+
u(U), s(!1), e && n(e);
|
|
527
506
|
} catch (e) {
|
|
528
|
-
|
|
507
|
+
g(e instanceof Error ? e.message : "The sprint could not be created.");
|
|
529
508
|
}
|
|
530
509
|
},
|
|
531
|
-
disabled: !
|
|
510
|
+
disabled: !R,
|
|
532
511
|
"data-testid": "new-sprint-submit",
|
|
533
|
-
children:
|
|
512
|
+
children: P ? "Creating…" : "Create sprint"
|
|
534
513
|
}) })
|
|
535
514
|
]
|
|
536
515
|
})]
|
|
537
516
|
});
|
|
538
517
|
}
|
|
539
518
|
//#endregion
|
|
540
|
-
export {
|
|
519
|
+
export { W as NewSprintDialog, P as SprintLifecycleActions, z as SprintWorkItemsPanel };
|
|
541
520
|
|
|
542
521
|
//# sourceMappingURL=SprintControls.js.map
|