@burdenoff/microfe-planmagnet 2026.930.6 → 2026.930.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +132 -108
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +24 -12
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/board/BoardViewBar.d.ts +27 -0
- package/dist/planmagnet/board/BoardViewBar.d.ts.map +1 -0
- package/dist/planmagnet/board/BoardViewBar.js +684 -0
- package/dist/planmagnet/board/BoardViewBar.js.map +1 -0
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +440 -345
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/board/boardViewConfig.d.ts +144 -0
- package/dist/planmagnet/board/boardViewConfig.d.ts.map +1 -0
- package/dist/planmagnet/board/boardViewConfig.js +265 -0
- package/dist/planmagnet/board/boardViewConfig.js.map +1 -0
- package/dist/planmagnet/controls/ConfirmButton.d.ts +3 -1
- package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -1
- package/dist/planmagnet/controls/ConfirmButton.js +2 -1
- package/dist/planmagnet/controls/ConfirmButton.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +25 -25
- package/dist/planmagnet/controls/Pickers.d.ts +2 -1
- package/dist/planmagnet/controls/Pickers.d.ts.map +1 -1
- package/dist/planmagnet/controls/Pickers.js +133 -102
- package/dist/planmagnet/controls/Pickers.js.map +1 -1
- package/dist/planmagnet/controls/QualityGateControls.d.ts +64 -0
- package/dist/planmagnet/controls/QualityGateControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/QualityGateControls.js +390 -0
- package/dist/planmagnet/controls/QualityGateControls.js.map +1 -0
- package/dist/planmagnet/create/CreateDialogs.d.ts +8 -0
- package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
- package/dist/planmagnet/create/CreateDialogs.js +344 -206
- package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
- package/dist/planmagnet/milestones/MilestoneControls.js +1 -1
- package/dist/planmagnet/pages/AiActivityPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/AiActivityPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/AiActivityPagePage.js +249 -0
- package/dist/planmagnet/pages/AiActivityPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AiPlanPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/AiPlanPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/AiPlanPagePage.js +381 -0
- package/dist/planmagnet/pages/AiPlanPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +5 -5
- package/dist/planmagnet/pages/ProductsEditRoadmapPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProgramsEditProgramPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +11 -11
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +209 -199
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +236 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js.map +1 -0
- package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +5 -5
- package/dist/planmagnet/pages/TasksTimesheetDetailPagePage.js +6 -6
- package/dist/planmagnet/pages/TeamCreateTeamPagePage.js +4 -4
- package/dist/planmagnet/pages/TeamTeamEditPagePage.js +8 -8
- package/dist/planmagnet/pages/TemplatesEditTemplatePagePage.js +7 -7
- package/dist/planmagnet/releases/useReleaseOptions.d.ts +21 -0
- package/dist/planmagnet/releases/useReleaseOptions.d.ts.map +1 -0
- package/dist/planmagnet/releases/useReleaseOptions.js +75 -0
- package/dist/planmagnet/releases/useReleaseOptions.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js +13 -13
- package/dist/planmagnet/utils/qualityGateCriteria.d.ts +33 -0
- package/dist/planmagnet/utils/qualityGateCriteria.d.ts.map +1 -0
- package/dist/planmagnet/utils/qualityGateCriteria.js +58 -0
- package/dist/planmagnet/utils/qualityGateCriteria.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,14 +2,17 @@ import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/Pla
|
|
|
2
2
|
import { throwOnError as n } from "../utils/mutationResult.js";
|
|
3
3
|
import { AssigneeSelect as r, enumLabel as i } from "../controls/WorkItemControls.js";
|
|
4
4
|
import { RISK_SEVERITIES as a } from "../controls/RiskControls.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { useReleaseOptions as o } from "../releases/useReleaseOptions.js";
|
|
6
|
+
import { criteriaItemsToJson as s } from "../utils/qualityGateCriteria.js";
|
|
7
|
+
import { CriteriaRowsEditor as c } from "../controls/QualityGateControls.js";
|
|
8
|
+
import { useState as l } from "react";
|
|
9
|
+
import { Plus as u } from "lucide-react";
|
|
10
|
+
import { gql as d } from "@apollo/client";
|
|
11
|
+
import { useMutation as f, useQuery as p } from "@apollo/client/react";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import { Button as g, Input as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C, ResponsiveDialogTrigger as w } from "@burdenoff/fe-libs/ui";
|
|
11
14
|
//#region src/planmagnet/create/CreateDialogs.tsx
|
|
12
|
-
var
|
|
15
|
+
var T = d`
|
|
13
16
|
query CreateDialogProjects($workspaceId: ID!) {
|
|
14
17
|
planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {
|
|
15
18
|
items {
|
|
@@ -18,16 +21,16 @@ var S = c`
|
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
|
-
`,
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
`, E = "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm";
|
|
25
|
+
function D({ message: e }) {
|
|
26
|
+
return /* @__PURE__ */ m("p", {
|
|
24
27
|
role: "alert",
|
|
25
28
|
className: "text-sm text-destructive",
|
|
26
29
|
children: e
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
|
-
function
|
|
30
|
-
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } =
|
|
32
|
+
function O(t) {
|
|
33
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = p(T, {
|
|
31
34
|
variables: { workspaceId: n ?? "" },
|
|
32
35
|
skip: !t || !n
|
|
33
36
|
});
|
|
@@ -38,31 +41,31 @@ function T(t) {
|
|
|
38
41
|
retry: () => void o()
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
|
-
function
|
|
44
|
+
function k({ id: e, value: n, onChange: r, state: i }) {
|
|
42
45
|
let a = t(), { projects: o, loading: s, error: c, retry: l } = i, u = !s && !c && o.length === 0;
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ h("div", { children: [
|
|
47
|
+
/* @__PURE__ */ m("label", {
|
|
45
48
|
htmlFor: e,
|
|
46
49
|
className: "text-sm font-medium",
|
|
47
50
|
children: "Project"
|
|
48
51
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ h("select", {
|
|
50
53
|
id: e,
|
|
51
|
-
className:
|
|
54
|
+
className: E,
|
|
52
55
|
value: n,
|
|
53
56
|
onChange: (e) => r(e.target.value),
|
|
54
|
-
children: [o.length === 0 && /* @__PURE__ */
|
|
57
|
+
children: [o.length === 0 && /* @__PURE__ */ m("option", {
|
|
55
58
|
value: "",
|
|
56
59
|
children: s ? "Loading projects…" : c ? "Projects could not be loaded" : "No projects yet"
|
|
57
|
-
}), o.map((e) => /* @__PURE__ */
|
|
60
|
+
}), o.map((e) => /* @__PURE__ */ m("option", {
|
|
58
61
|
value: e.id,
|
|
59
62
|
children: e.name
|
|
60
63
|
}, e.id))]
|
|
61
64
|
}),
|
|
62
|
-
c && /* @__PURE__ */
|
|
65
|
+
c && /* @__PURE__ */ h("p", {
|
|
63
66
|
role: "alert",
|
|
64
67
|
className: "mt-1 flex items-center gap-2 text-xs text-destructive",
|
|
65
|
-
children: [c, /* @__PURE__ */
|
|
68
|
+
children: [c, /* @__PURE__ */ m(g, {
|
|
66
69
|
type: "button",
|
|
67
70
|
size: "sm",
|
|
68
71
|
variant: "ghost",
|
|
@@ -71,9 +74,9 @@ function E({ id: e, value: n, onChange: r, state: i }) {
|
|
|
71
74
|
children: "Retry"
|
|
72
75
|
})]
|
|
73
76
|
}),
|
|
74
|
-
u && /* @__PURE__ */
|
|
77
|
+
u && /* @__PURE__ */ m("p", {
|
|
75
78
|
className: "mt-1 text-xs text-muted-foreground",
|
|
76
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ m("button", {
|
|
77
80
|
type: "button",
|
|
78
81
|
className: "underline",
|
|
79
82
|
onClick: () => a("/projects/create-project-page"),
|
|
@@ -82,12 +85,12 @@ function E({ id: e, value: n, onChange: r, state: i }) {
|
|
|
82
85
|
})
|
|
83
86
|
] });
|
|
84
87
|
}
|
|
85
|
-
function
|
|
86
|
-
return /* @__PURE__ */
|
|
88
|
+
function A({ id: e, label: t, value: n, onChange: r, type: i = "text", placeholder: a }) {
|
|
89
|
+
return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
87
90
|
htmlFor: e,
|
|
88
91
|
className: "text-sm font-medium",
|
|
89
92
|
children: t
|
|
90
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ m(_, {
|
|
91
94
|
id: e,
|
|
92
95
|
type: i,
|
|
93
96
|
className: "mt-1",
|
|
@@ -96,43 +99,43 @@ function D({ id: e, label: t, value: n, onChange: r, type: i = "text", placehold
|
|
|
96
99
|
onChange: (e) => r(e.target.value)
|
|
97
100
|
})] });
|
|
98
101
|
}
|
|
99
|
-
var
|
|
102
|
+
var j = (e, t) => e instanceof Error ? e.message : t, M = d`
|
|
100
103
|
mutation CreateDialogRelease($input: PlanmagnetCreateReleaseInput!) {
|
|
101
104
|
planmagnetCreateRelease(input: $input) {
|
|
102
105
|
id
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
`,
|
|
108
|
+
`, N = {
|
|
106
109
|
name: "",
|
|
107
110
|
version: "",
|
|
108
111
|
projectId: "",
|
|
109
112
|
plannedDate: "",
|
|
110
113
|
description: ""
|
|
111
114
|
};
|
|
112
|
-
function
|
|
113
|
-
let [t, r] =
|
|
115
|
+
function P({ onCreated: e }) {
|
|
116
|
+
let [t, r] = l(!1), [i, a] = l(N), [o, s] = l(null), c = O(t), { projects: d } = c, p = i.projectId || d[0]?.id || "", [_, { loading: T }] = f(M, {
|
|
114
117
|
refetchQueries: ["ListReleases"],
|
|
115
118
|
awaitRefetchQueries: !0
|
|
116
|
-
}),
|
|
117
|
-
return /* @__PURE__ */
|
|
119
|
+
}), E = i.name.trim() !== "" && i.version.trim() !== "" && p !== "" && !T;
|
|
120
|
+
return /* @__PURE__ */ h(v, {
|
|
118
121
|
open: t,
|
|
119
122
|
onOpenChange: (e) => {
|
|
120
|
-
r(e), e ||
|
|
123
|
+
r(e), e || s(null);
|
|
121
124
|
},
|
|
122
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ m(w, {
|
|
123
126
|
asChild: !0,
|
|
124
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ h(g, {
|
|
125
128
|
size: "sm",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "New Release"]
|
|
127
130
|
})
|
|
128
|
-
}), /* @__PURE__ */
|
|
131
|
+
}), /* @__PURE__ */ h(y, {
|
|
129
132
|
className: "max-w-lg",
|
|
130
133
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, { children: "New release" }), /* @__PURE__ */ m(b, { children: "The release starts in Planning." })] }),
|
|
135
|
+
/* @__PURE__ */ h("div", {
|
|
133
136
|
className: "space-y-3",
|
|
134
137
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ m(A, {
|
|
136
139
|
id: "new-release-name",
|
|
137
140
|
label: "Name",
|
|
138
141
|
value: i.name,
|
|
@@ -141,7 +144,7 @@ function j({ onCreated: e }) {
|
|
|
141
144
|
name: e
|
|
142
145
|
})
|
|
143
146
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ m(A, {
|
|
145
148
|
id: "new-release-version",
|
|
146
149
|
label: "Version",
|
|
147
150
|
placeholder: "e.g. 1.4.0",
|
|
@@ -151,16 +154,16 @@ function j({ onCreated: e }) {
|
|
|
151
154
|
version: e
|
|
152
155
|
})
|
|
153
156
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ m(k, {
|
|
155
158
|
id: "new-release-project",
|
|
156
|
-
value:
|
|
159
|
+
value: p,
|
|
157
160
|
onChange: (e) => a({
|
|
158
161
|
...i,
|
|
159
162
|
projectId: e
|
|
160
163
|
}),
|
|
161
|
-
state:
|
|
164
|
+
state: c
|
|
162
165
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ m(A, {
|
|
164
167
|
id: "new-release-date",
|
|
165
168
|
label: "Planned date",
|
|
166
169
|
type: "date",
|
|
@@ -170,7 +173,7 @@ function j({ onCreated: e }) {
|
|
|
170
173
|
plannedDate: e
|
|
171
174
|
})
|
|
172
175
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ m(A, {
|
|
174
177
|
id: "new-release-description",
|
|
175
178
|
label: "Description",
|
|
176
179
|
value: i.description,
|
|
@@ -181,67 +184,67 @@ function j({ onCreated: e }) {
|
|
|
181
184
|
})
|
|
182
185
|
]
|
|
183
186
|
}),
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */
|
|
187
|
+
o && /* @__PURE__ */ m(D, { message: o }),
|
|
188
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
186
189
|
onClick: async () => {
|
|
187
|
-
|
|
190
|
+
s(null);
|
|
188
191
|
try {
|
|
189
|
-
let t = (await n(
|
|
192
|
+
let t = (await n(_({ variables: { input: {
|
|
190
193
|
name: i.name.trim(),
|
|
191
194
|
version: i.version.trim(),
|
|
192
|
-
projectId:
|
|
195
|
+
projectId: p,
|
|
193
196
|
plannedDate: i.plannedDate || void 0,
|
|
194
197
|
description: i.description.trim() || void 0
|
|
195
198
|
} } }))).data?.planmagnetCreateRelease.id;
|
|
196
|
-
a(
|
|
199
|
+
a(N), r(!1), t && e(t);
|
|
197
200
|
} catch (e) {
|
|
198
|
-
|
|
201
|
+
s(j(e, "The release could not be created."));
|
|
199
202
|
}
|
|
200
203
|
},
|
|
201
|
-
disabled: !
|
|
204
|
+
disabled: !E,
|
|
202
205
|
"data-testid": "new-release-submit",
|
|
203
|
-
children:
|
|
206
|
+
children: T ? "Creating…" : "Create release"
|
|
204
207
|
}) })
|
|
205
208
|
]
|
|
206
209
|
})]
|
|
207
210
|
});
|
|
208
211
|
}
|
|
209
|
-
var
|
|
212
|
+
var F = d`
|
|
210
213
|
mutation CreateDialogMilestone($input: PlanmagnetCreateMilestoneInput!) {
|
|
211
214
|
planmagnetCreateMilestone(input: $input) {
|
|
212
215
|
id
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
|
-
`,
|
|
218
|
+
`, I = {
|
|
216
219
|
name: "",
|
|
217
220
|
projectId: "",
|
|
218
221
|
dueDate: "",
|
|
219
222
|
description: ""
|
|
220
223
|
};
|
|
221
|
-
function
|
|
222
|
-
let [t, r] =
|
|
224
|
+
function L({ onCreated: e }) {
|
|
225
|
+
let [t, r] = l(!1), [i, a] = l(I), [o, s] = l(null), c = O(t), { projects: d } = c, p = i.projectId || d[0]?.id || "", [_, { loading: T }] = f(F, {
|
|
223
226
|
refetchQueries: ["GetMilestones"],
|
|
224
227
|
awaitRefetchQueries: !0
|
|
225
|
-
}),
|
|
226
|
-
return /* @__PURE__ */
|
|
228
|
+
}), E = i.name.trim() !== "" && p !== "" && !T;
|
|
229
|
+
return /* @__PURE__ */ h(v, {
|
|
227
230
|
open: t,
|
|
228
231
|
onOpenChange: (e) => {
|
|
229
|
-
r(e), e ||
|
|
232
|
+
r(e), e || s(null);
|
|
230
233
|
},
|
|
231
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ m(w, {
|
|
232
235
|
asChild: !0,
|
|
233
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ h(g, {
|
|
234
237
|
size: "sm",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "New Milestone"]
|
|
236
239
|
})
|
|
237
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), /* @__PURE__ */ h(y, {
|
|
238
241
|
className: "max-w-lg",
|
|
239
242
|
children: [
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, { children: "New milestone" }), /* @__PURE__ */ m(b, { children: "The milestone starts as Pending." })] }),
|
|
244
|
+
/* @__PURE__ */ h("div", {
|
|
242
245
|
className: "space-y-3",
|
|
243
246
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ m(A, {
|
|
245
248
|
id: "new-milestone-name",
|
|
246
249
|
label: "Name",
|
|
247
250
|
value: i.name,
|
|
@@ -250,16 +253,16 @@ function P({ onCreated: e }) {
|
|
|
250
253
|
name: e
|
|
251
254
|
})
|
|
252
255
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ m(k, {
|
|
254
257
|
id: "new-milestone-project",
|
|
255
|
-
value:
|
|
258
|
+
value: p,
|
|
256
259
|
onChange: (e) => a({
|
|
257
260
|
...i,
|
|
258
261
|
projectId: e
|
|
259
262
|
}),
|
|
260
|
-
state:
|
|
263
|
+
state: c
|
|
261
264
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ m(A, {
|
|
263
266
|
id: "new-milestone-due",
|
|
264
267
|
label: "Due date",
|
|
265
268
|
type: "date",
|
|
@@ -269,7 +272,7 @@ function P({ onCreated: e }) {
|
|
|
269
272
|
dueDate: e
|
|
270
273
|
})
|
|
271
274
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ m(A, {
|
|
273
276
|
id: "new-milestone-description",
|
|
274
277
|
label: "Description",
|
|
275
278
|
value: i.description,
|
|
@@ -280,31 +283,31 @@ function P({ onCreated: e }) {
|
|
|
280
283
|
})
|
|
281
284
|
]
|
|
282
285
|
}),
|
|
283
|
-
|
|
284
|
-
/* @__PURE__ */
|
|
286
|
+
o && /* @__PURE__ */ m(D, { message: o }),
|
|
287
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
285
288
|
onClick: async () => {
|
|
286
|
-
|
|
289
|
+
s(null);
|
|
287
290
|
try {
|
|
288
|
-
let t = (await n(
|
|
291
|
+
let t = (await n(_({ variables: { input: {
|
|
289
292
|
name: i.name.trim(),
|
|
290
|
-
projectId:
|
|
293
|
+
projectId: p,
|
|
291
294
|
dueDate: i.dueDate || void 0,
|
|
292
295
|
description: i.description.trim() || void 0
|
|
293
296
|
} } }))).data?.planmagnetCreateMilestone.id;
|
|
294
|
-
a(
|
|
297
|
+
a(I), r(!1), t && e(t);
|
|
295
298
|
} catch (e) {
|
|
296
|
-
|
|
299
|
+
s(j(e, "The milestone could not be created."));
|
|
297
300
|
}
|
|
298
301
|
},
|
|
299
|
-
disabled: !
|
|
302
|
+
disabled: !E,
|
|
300
303
|
"data-testid": "new-milestone-submit",
|
|
301
|
-
children:
|
|
304
|
+
children: T ? "Creating…" : "Create milestone"
|
|
302
305
|
}) })
|
|
303
306
|
]
|
|
304
307
|
})]
|
|
305
308
|
});
|
|
306
309
|
}
|
|
307
|
-
var
|
|
310
|
+
var R = d`
|
|
308
311
|
mutation CreateDialogTemplateFromProject($projectId: ID!, $name: String!, $description: String) {
|
|
309
312
|
planmagnetCreateTemplateFromProject(
|
|
310
313
|
projectId: $projectId
|
|
@@ -315,74 +318,74 @@ var F = c`
|
|
|
315
318
|
}
|
|
316
319
|
}
|
|
317
320
|
`;
|
|
318
|
-
function
|
|
319
|
-
let [a,
|
|
321
|
+
function z({ projectId: e, projectName: t, onCreated: r, trigger: i }) {
|
|
322
|
+
let [a, o] = l(!1), [s, c] = l(t ? `${t} template` : ""), [d, p] = l(""), [_, T] = l(e ?? ""), [E, M] = l(null), N = O(a && !e), { projects: P } = N, F = e ?? (_ || P[0]?.id || ""), [I, { loading: L }] = f(R, {
|
|
320
323
|
refetchQueries: ["TemplatesList"],
|
|
321
324
|
awaitRefetchQueries: !0
|
|
322
|
-
}), z =
|
|
323
|
-
return /* @__PURE__ */
|
|
325
|
+
}), z = s.trim() !== "" && F !== "" && !L;
|
|
326
|
+
return /* @__PURE__ */ h(v, {
|
|
324
327
|
open: a,
|
|
325
328
|
onOpenChange: (e) => {
|
|
326
|
-
|
|
329
|
+
o(e), e || M(null);
|
|
327
330
|
},
|
|
328
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ m(w, {
|
|
329
332
|
asChild: !0,
|
|
330
|
-
children: i ?? /* @__PURE__ */
|
|
333
|
+
children: i ?? /* @__PURE__ */ h(g, {
|
|
331
334
|
size: "sm",
|
|
332
335
|
"data-testid": "new-template-trigger",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "New template"]
|
|
334
337
|
})
|
|
335
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ h(y, {
|
|
336
339
|
className: "max-w-lg",
|
|
337
340
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, { children: "New template from project" }), /* @__PURE__ */ m(b, { children: "Captures this project's methodology and status as a reusable template. The project itself is unchanged." })] }),
|
|
342
|
+
/* @__PURE__ */ h("div", {
|
|
340
343
|
className: "space-y-3",
|
|
341
344
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ m(A, {
|
|
343
346
|
id: "new-template-name",
|
|
344
347
|
label: "Template name",
|
|
345
|
-
value:
|
|
346
|
-
onChange:
|
|
348
|
+
value: s,
|
|
349
|
+
onChange: c
|
|
347
350
|
}),
|
|
348
|
-
!e && /* @__PURE__ */
|
|
351
|
+
!e && /* @__PURE__ */ m(k, {
|
|
349
352
|
id: "new-template-project",
|
|
350
|
-
value:
|
|
351
|
-
onChange:
|
|
353
|
+
value: F,
|
|
354
|
+
onChange: T,
|
|
352
355
|
state: N
|
|
353
356
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ m(A, {
|
|
355
358
|
id: "new-template-description",
|
|
356
359
|
label: "Description",
|
|
357
|
-
value:
|
|
358
|
-
onChange:
|
|
360
|
+
value: d,
|
|
361
|
+
onChange: p
|
|
359
362
|
})
|
|
360
363
|
]
|
|
361
364
|
}),
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */
|
|
365
|
+
E && /* @__PURE__ */ m(D, { message: E }),
|
|
366
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
364
367
|
onClick: async () => {
|
|
365
368
|
M(null);
|
|
366
369
|
try {
|
|
367
|
-
let e = (await n(
|
|
368
|
-
projectId:
|
|
369
|
-
name:
|
|
370
|
-
description:
|
|
370
|
+
let e = (await n(I({ variables: {
|
|
371
|
+
projectId: F,
|
|
372
|
+
name: s.trim(),
|
|
373
|
+
description: d.trim() || void 0
|
|
371
374
|
} }))).data?.planmagnetCreateTemplateFromProject.id;
|
|
372
|
-
|
|
375
|
+
c(""), p(""), o(!1), e && r(e);
|
|
373
376
|
} catch (e) {
|
|
374
|
-
M(
|
|
377
|
+
M(j(e, "The template could not be created."));
|
|
375
378
|
}
|
|
376
379
|
},
|
|
377
380
|
disabled: !z,
|
|
378
381
|
"data-testid": "new-template-submit",
|
|
379
|
-
children:
|
|
382
|
+
children: L ? "Creating…" : "Create template"
|
|
380
383
|
}) })
|
|
381
384
|
]
|
|
382
385
|
})]
|
|
383
386
|
});
|
|
384
387
|
}
|
|
385
|
-
var
|
|
388
|
+
var B = d`
|
|
386
389
|
mutation CreateDialogApplyTemplate($input: PlanmagnetApplyTemplateInput!) {
|
|
387
390
|
planmagnetApplyTemplate(input: $input) {
|
|
388
391
|
id
|
|
@@ -390,79 +393,79 @@ var L = c`
|
|
|
390
393
|
}
|
|
391
394
|
}
|
|
392
395
|
`;
|
|
393
|
-
function
|
|
394
|
-
let { currentUser:
|
|
396
|
+
function V({ templateId: t, templateName: i, onApplied: a }) {
|
|
397
|
+
let { currentUser: o } = e(), [s, c] = l(!1), [d, p] = l(""), [_, T] = l(""), [E, O] = l(""), [k, M] = l(null), [N, { loading: P }] = f(B, {
|
|
395
398
|
refetchQueries: [
|
|
396
399
|
"GetProjects",
|
|
397
400
|
"GetActiveProjects",
|
|
398
401
|
"GetDashboardData"
|
|
399
402
|
],
|
|
400
403
|
awaitRefetchQueries: !0
|
|
401
|
-
}), F =
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
open:
|
|
404
|
+
}), F = E || o?.id || "", I = d.trim() !== "" && F !== "" && !P;
|
|
405
|
+
return /* @__PURE__ */ h(v, {
|
|
406
|
+
open: s,
|
|
404
407
|
onOpenChange: (e) => {
|
|
405
|
-
|
|
408
|
+
c(e), e ? O(o?.id ?? "") : M(null);
|
|
406
409
|
},
|
|
407
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ m(w, {
|
|
408
411
|
asChild: !0,
|
|
409
|
-
children: /* @__PURE__ */
|
|
412
|
+
children: /* @__PURE__ */ h(g, {
|
|
410
413
|
size: "sm",
|
|
411
414
|
variant: "outline",
|
|
412
415
|
"data-testid": "apply-template-trigger",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "Use template"]
|
|
414
417
|
})
|
|
415
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ h(y, {
|
|
416
419
|
className: "max-w-lg",
|
|
417
420
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ h(C, { children: [
|
|
419
422
|
"New project from \"",
|
|
420
423
|
i,
|
|
421
424
|
"\""
|
|
422
|
-
] }), /* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
425
|
+
] }), /* @__PURE__ */ m(b, { children: "Creates a project using this template's methodology and status. It counts toward the workspace's project quota like any other project." })] }),
|
|
426
|
+
/* @__PURE__ */ h("div", {
|
|
424
427
|
className: "space-y-3",
|
|
425
428
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ m(A, {
|
|
427
430
|
id: "apply-template-name",
|
|
428
431
|
label: "Project name",
|
|
429
|
-
value:
|
|
430
|
-
onChange:
|
|
432
|
+
value: d,
|
|
433
|
+
onChange: p
|
|
431
434
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ m(A, {
|
|
433
436
|
id: "apply-template-description",
|
|
434
437
|
label: "Description",
|
|
435
|
-
value:
|
|
436
|
-
onChange:
|
|
438
|
+
value: _,
|
|
439
|
+
onChange: T
|
|
437
440
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
439
442
|
htmlFor: "apply-template-owner",
|
|
440
443
|
className: "text-sm font-medium",
|
|
441
444
|
children: "Owner"
|
|
442
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ m("div", {
|
|
443
446
|
className: "mt-1",
|
|
444
|
-
children: /* @__PURE__ */
|
|
447
|
+
children: /* @__PURE__ */ m(r, {
|
|
445
448
|
id: "apply-template-owner",
|
|
446
449
|
value: F,
|
|
447
|
-
onChange:
|
|
450
|
+
onChange: O
|
|
448
451
|
})
|
|
449
452
|
})] })
|
|
450
453
|
]
|
|
451
454
|
}),
|
|
452
|
-
|
|
453
|
-
/* @__PURE__ */
|
|
455
|
+
k && /* @__PURE__ */ m(D, { message: k }),
|
|
456
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
454
457
|
onClick: async () => {
|
|
455
458
|
M(null);
|
|
456
459
|
try {
|
|
457
460
|
let e = (await n(N({ variables: { input: {
|
|
458
461
|
templateId: t,
|
|
459
|
-
projectName:
|
|
460
|
-
projectDescription:
|
|
462
|
+
projectName: d.trim(),
|
|
463
|
+
projectDescription: _.trim() || void 0,
|
|
461
464
|
ownerId: F
|
|
462
465
|
} } }))).data?.planmagnetApplyTemplate.id;
|
|
463
|
-
|
|
466
|
+
p(""), T(""), c(!1), e && a(e);
|
|
464
467
|
} catch (e) {
|
|
465
|
-
M(
|
|
468
|
+
M(j(e, "The project could not be created from this template."));
|
|
466
469
|
}
|
|
467
470
|
},
|
|
468
471
|
disabled: !I,
|
|
@@ -473,36 +476,36 @@ function R({ templateId: t, templateName: i, onApplied: a }) {
|
|
|
473
476
|
})]
|
|
474
477
|
});
|
|
475
478
|
}
|
|
476
|
-
var
|
|
479
|
+
var H = d`
|
|
477
480
|
mutation CreateDialogRisk($input: PlanmagnetCreateRiskInput!) {
|
|
478
481
|
planmagnetCreateRisk(input: $input) {
|
|
479
482
|
id
|
|
480
483
|
}
|
|
481
484
|
}
|
|
482
|
-
`,
|
|
485
|
+
`, U = [
|
|
483
486
|
1,
|
|
484
487
|
2,
|
|
485
488
|
3,
|
|
486
489
|
4,
|
|
487
490
|
5
|
|
488
491
|
];
|
|
489
|
-
function
|
|
490
|
-
return /* @__PURE__ */
|
|
492
|
+
function W({ id: e, label: t, value: n, onChange: r }) {
|
|
493
|
+
return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
491
494
|
htmlFor: e,
|
|
492
495
|
className: "text-sm font-medium",
|
|
493
496
|
children: t
|
|
494
|
-
}), /* @__PURE__ */
|
|
497
|
+
}), /* @__PURE__ */ m("select", {
|
|
495
498
|
id: e,
|
|
496
|
-
className:
|
|
499
|
+
className: E,
|
|
497
500
|
value: n,
|
|
498
501
|
onChange: (e) => r(Number(e.target.value)),
|
|
499
|
-
children:
|
|
502
|
+
children: U.map((e) => /* @__PURE__ */ m("option", {
|
|
500
503
|
value: e,
|
|
501
504
|
children: e
|
|
502
505
|
}, e))
|
|
503
506
|
})] });
|
|
504
507
|
}
|
|
505
|
-
function
|
|
508
|
+
function G({ projectId: e, onCreated: t }) {
|
|
506
509
|
let r = {
|
|
507
510
|
title: "",
|
|
508
511
|
projectId: e ?? "",
|
|
@@ -511,126 +514,126 @@ function H({ projectId: e, onCreated: t }) {
|
|
|
511
514
|
impact: 3,
|
|
512
515
|
category: "",
|
|
513
516
|
description: ""
|
|
514
|
-
}, [
|
|
517
|
+
}, [o, s] = l(!1), [c, d] = l(r), [p, _] = l(null), T = O(o && !e), { projects: M } = T, N = e || c.projectId || M[0]?.id || "", [P, { loading: F }] = f(H, {
|
|
515
518
|
refetchQueries: [
|
|
516
519
|
"GetRisks",
|
|
517
520
|
"GetRiskMatrix",
|
|
518
521
|
"GetProjectDetail"
|
|
519
522
|
],
|
|
520
523
|
awaitRefetchQueries: !0
|
|
521
|
-
}), I =
|
|
522
|
-
return /* @__PURE__ */
|
|
523
|
-
open:
|
|
524
|
+
}), I = c.title.trim() !== "" && N !== "" && !F;
|
|
525
|
+
return /* @__PURE__ */ h(v, {
|
|
526
|
+
open: o,
|
|
524
527
|
onOpenChange: (e) => {
|
|
525
|
-
|
|
528
|
+
s(e), e ? d(r) : _(null);
|
|
526
529
|
},
|
|
527
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ m(w, {
|
|
528
531
|
asChild: !0,
|
|
529
|
-
children: /* @__PURE__ */
|
|
532
|
+
children: /* @__PURE__ */ h(g, {
|
|
530
533
|
size: "sm",
|
|
531
534
|
"data-testid": "new-risk-trigger",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "New Risk"]
|
|
533
536
|
})
|
|
534
|
-
}), /* @__PURE__ */
|
|
537
|
+
}), /* @__PURE__ */ h(y, {
|
|
535
538
|
className: "max-w-lg",
|
|
536
539
|
children: [
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, { children: "New risk" }), /* @__PURE__ */ m(b, { children: "The risk starts as Identified. Likelihood and impact are each scored 1 (rare/minor) to 5 (near-certain/severe)." })] }),
|
|
541
|
+
/* @__PURE__ */ h("div", {
|
|
539
542
|
className: "space-y-3",
|
|
540
543
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ m(A, {
|
|
542
545
|
id: "new-risk-title",
|
|
543
546
|
label: "Title",
|
|
544
|
-
value:
|
|
545
|
-
onChange: (e) =>
|
|
546
|
-
...
|
|
547
|
+
value: c.title,
|
|
548
|
+
onChange: (e) => d({
|
|
549
|
+
...c,
|
|
547
550
|
title: e
|
|
548
551
|
})
|
|
549
552
|
}),
|
|
550
|
-
!e && /* @__PURE__ */
|
|
553
|
+
!e && /* @__PURE__ */ m(k, {
|
|
551
554
|
id: "new-risk-project",
|
|
552
555
|
value: N,
|
|
553
|
-
onChange: (e) =>
|
|
554
|
-
...
|
|
556
|
+
onChange: (e) => d({
|
|
557
|
+
...c,
|
|
555
558
|
projectId: e
|
|
556
559
|
}),
|
|
557
|
-
state:
|
|
560
|
+
state: T
|
|
558
561
|
}),
|
|
559
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
560
563
|
htmlFor: "new-risk-severity",
|
|
561
564
|
className: "text-sm font-medium",
|
|
562
565
|
children: "Severity"
|
|
563
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ m("select", {
|
|
564
567
|
id: "new-risk-severity",
|
|
565
|
-
className:
|
|
566
|
-
value:
|
|
567
|
-
onChange: (e) =>
|
|
568
|
-
...
|
|
568
|
+
className: E,
|
|
569
|
+
value: c.severity,
|
|
570
|
+
onChange: (e) => d({
|
|
571
|
+
...c,
|
|
569
572
|
severity: e.target.value
|
|
570
573
|
}),
|
|
571
|
-
children: a.map((e) => /* @__PURE__ */
|
|
574
|
+
children: a.map((e) => /* @__PURE__ */ m("option", {
|
|
572
575
|
value: e,
|
|
573
576
|
children: i(e)
|
|
574
577
|
}, e))
|
|
575
578
|
})] }),
|
|
576
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ h("div", {
|
|
577
580
|
className: "grid grid-cols-2 gap-3",
|
|
578
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ m(W, {
|
|
579
582
|
id: "new-risk-likelihood",
|
|
580
583
|
label: "Likelihood",
|
|
581
|
-
value:
|
|
582
|
-
onChange: (e) =>
|
|
583
|
-
...
|
|
584
|
+
value: c.likelihood,
|
|
585
|
+
onChange: (e) => d({
|
|
586
|
+
...c,
|
|
584
587
|
likelihood: e
|
|
585
588
|
})
|
|
586
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ m(W, {
|
|
587
590
|
id: "new-risk-impact",
|
|
588
591
|
label: "Impact",
|
|
589
|
-
value:
|
|
590
|
-
onChange: (e) =>
|
|
591
|
-
...
|
|
592
|
+
value: c.impact,
|
|
593
|
+
onChange: (e) => d({
|
|
594
|
+
...c,
|
|
592
595
|
impact: e
|
|
593
596
|
})
|
|
594
597
|
})]
|
|
595
598
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ m(A, {
|
|
597
600
|
id: "new-risk-category",
|
|
598
601
|
label: "Category",
|
|
599
602
|
placeholder: "e.g. schedule, budget, technical",
|
|
600
|
-
value:
|
|
601
|
-
onChange: (e) =>
|
|
602
|
-
...
|
|
603
|
+
value: c.category,
|
|
604
|
+
onChange: (e) => d({
|
|
605
|
+
...c,
|
|
603
606
|
category: e
|
|
604
607
|
})
|
|
605
608
|
}),
|
|
606
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ m(A, {
|
|
607
610
|
id: "new-risk-description",
|
|
608
611
|
label: "Description",
|
|
609
|
-
value:
|
|
610
|
-
onChange: (e) =>
|
|
611
|
-
...
|
|
612
|
+
value: c.description,
|
|
613
|
+
onChange: (e) => d({
|
|
614
|
+
...c,
|
|
612
615
|
description: e
|
|
613
616
|
})
|
|
614
617
|
})
|
|
615
618
|
]
|
|
616
619
|
}),
|
|
617
|
-
|
|
618
|
-
/* @__PURE__ */
|
|
620
|
+
p && /* @__PURE__ */ m(D, { message: p }),
|
|
621
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
619
622
|
onClick: async () => {
|
|
620
|
-
|
|
623
|
+
_(null);
|
|
621
624
|
try {
|
|
622
625
|
let e = (await n(P({ variables: { input: {
|
|
623
|
-
title:
|
|
626
|
+
title: c.title.trim(),
|
|
624
627
|
projectId: N,
|
|
625
|
-
severity:
|
|
626
|
-
likelihood:
|
|
627
|
-
impact:
|
|
628
|
-
category:
|
|
629
|
-
description:
|
|
628
|
+
severity: c.severity,
|
|
629
|
+
likelihood: c.likelihood,
|
|
630
|
+
impact: c.impact,
|
|
631
|
+
category: c.category.trim() || void 0,
|
|
632
|
+
description: c.description.trim() || void 0
|
|
630
633
|
} } }))).data?.planmagnetCreateRisk.id;
|
|
631
|
-
|
|
634
|
+
d(r), s(!1), e && t(e);
|
|
632
635
|
} catch (e) {
|
|
633
|
-
|
|
636
|
+
_(j(e, "The risk could not be created."));
|
|
634
637
|
}
|
|
635
638
|
},
|
|
636
639
|
disabled: !I,
|
|
@@ -641,7 +644,142 @@ function H({ projectId: e, onCreated: t }) {
|
|
|
641
644
|
})]
|
|
642
645
|
});
|
|
643
646
|
}
|
|
647
|
+
var K = d`
|
|
648
|
+
mutation NewQualityGateDialogCreate($input: PlanmagnetCreateQualityGateInput!) {
|
|
649
|
+
planmagnetCreateQualityGate(input: $input) {
|
|
650
|
+
id
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
`;
|
|
654
|
+
function q(e, t) {
|
|
655
|
+
return o(e && t !== "", t);
|
|
656
|
+
}
|
|
657
|
+
function J({ projectId: e, defaultProjectId: t, onCreated: r, trigger: i }) {
|
|
658
|
+
let a = {
|
|
659
|
+
name: "",
|
|
660
|
+
projectId: e ?? t ?? "",
|
|
661
|
+
description: "",
|
|
662
|
+
releaseId: "",
|
|
663
|
+
criteria: []
|
|
664
|
+
}, [o, d] = l(!1), [p, _] = l(a), [T, M] = l(null), N = O(o && !e), { projects: P } = N, F = e || p.projectId || P[0]?.id || "", I = q(o, F), [L, { loading: R }] = f(K, {
|
|
665
|
+
refetchQueries: ["QualityGatesList"],
|
|
666
|
+
awaitRefetchQueries: !0
|
|
667
|
+
}), z = p.name.trim() !== "" && F !== "" && !R;
|
|
668
|
+
return /* @__PURE__ */ h(v, {
|
|
669
|
+
open: o,
|
|
670
|
+
onOpenChange: (e) => {
|
|
671
|
+
d(e), e ? _(a) : M(null);
|
|
672
|
+
},
|
|
673
|
+
children: [/* @__PURE__ */ m(w, {
|
|
674
|
+
asChild: !0,
|
|
675
|
+
children: i ?? /* @__PURE__ */ h(g, {
|
|
676
|
+
size: "sm",
|
|
677
|
+
"data-testid": "quality-gate-new-trigger",
|
|
678
|
+
children: [/* @__PURE__ */ m(u, { className: "mr-1 h-4 w-4" }), "New quality gate"]
|
|
679
|
+
})
|
|
680
|
+
}), /* @__PURE__ */ h(y, {
|
|
681
|
+
className: "max-w-lg max-h-[85vh] overflow-y-auto",
|
|
682
|
+
children: [
|
|
683
|
+
/* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(C, { children: "New quality gate" }), /* @__PURE__ */ m(b, { children: "Starts as Pending. Add the criteria it must meet — you can add or edit them later." })] }),
|
|
684
|
+
/* @__PURE__ */ h("div", {
|
|
685
|
+
className: "space-y-3",
|
|
686
|
+
children: [
|
|
687
|
+
!e && /* @__PURE__ */ m(k, {
|
|
688
|
+
id: "quality-gate-new-project",
|
|
689
|
+
value: F,
|
|
690
|
+
onChange: (e) => _({
|
|
691
|
+
...p,
|
|
692
|
+
projectId: e,
|
|
693
|
+
releaseId: ""
|
|
694
|
+
}),
|
|
695
|
+
state: N
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ m(A, {
|
|
698
|
+
id: "quality-gate-new-name",
|
|
699
|
+
label: "Name",
|
|
700
|
+
value: p.name,
|
|
701
|
+
onChange: (e) => _({
|
|
702
|
+
...p,
|
|
703
|
+
name: e
|
|
704
|
+
})
|
|
705
|
+
}),
|
|
706
|
+
/* @__PURE__ */ m(A, {
|
|
707
|
+
id: "quality-gate-new-description",
|
|
708
|
+
label: "Description",
|
|
709
|
+
value: p.description,
|
|
710
|
+
onChange: (e) => _({
|
|
711
|
+
...p,
|
|
712
|
+
description: e
|
|
713
|
+
})
|
|
714
|
+
}),
|
|
715
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
|
|
716
|
+
htmlFor: "quality-gate-new-release",
|
|
717
|
+
className: "text-sm font-medium",
|
|
718
|
+
children: "Holds a release (optional)"
|
|
719
|
+
}), /* @__PURE__ */ h("select", {
|
|
720
|
+
id: "quality-gate-new-release",
|
|
721
|
+
className: E,
|
|
722
|
+
value: p.releaseId,
|
|
723
|
+
disabled: !F,
|
|
724
|
+
onChange: (e) => _({
|
|
725
|
+
...p,
|
|
726
|
+
releaseId: e.target.value
|
|
727
|
+
}),
|
|
728
|
+
children: [/* @__PURE__ */ m("option", {
|
|
729
|
+
value: "",
|
|
730
|
+
children: F ? I.loading ? "Loading releases…" : "No release" : "Choose a project first"
|
|
731
|
+
}), I.releases.map((e) => /* @__PURE__ */ h("option", {
|
|
732
|
+
value: e.id,
|
|
733
|
+
children: [
|
|
734
|
+
e.name,
|
|
735
|
+
" (",
|
|
736
|
+
e.version,
|
|
737
|
+
")"
|
|
738
|
+
]
|
|
739
|
+
}, e.id))]
|
|
740
|
+
})] }),
|
|
741
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("span", {
|
|
742
|
+
className: "text-sm font-medium",
|
|
743
|
+
children: "Criteria"
|
|
744
|
+
}), /* @__PURE__ */ m("div", {
|
|
745
|
+
className: "mt-1",
|
|
746
|
+
children: /* @__PURE__ */ m(c, {
|
|
747
|
+
idPrefix: "quality-gate-new",
|
|
748
|
+
items: p.criteria,
|
|
749
|
+
onChange: (e) => _({
|
|
750
|
+
...p,
|
|
751
|
+
criteria: e
|
|
752
|
+
})
|
|
753
|
+
})
|
|
754
|
+
})] })
|
|
755
|
+
]
|
|
756
|
+
}),
|
|
757
|
+
T && /* @__PURE__ */ m(D, { message: T }),
|
|
758
|
+
/* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(g, {
|
|
759
|
+
onClick: async () => {
|
|
760
|
+
M(null);
|
|
761
|
+
try {
|
|
762
|
+
let e = (await n(L({ variables: { input: {
|
|
763
|
+
projectId: F,
|
|
764
|
+
name: p.name.trim(),
|
|
765
|
+
description: p.description.trim() || void 0,
|
|
766
|
+
criteria: s(p.criteria),
|
|
767
|
+
releaseId: p.releaseId || void 0
|
|
768
|
+
} } }))).data?.planmagnetCreateQualityGate.id;
|
|
769
|
+
_(a), d(!1), e && r?.(e);
|
|
770
|
+
} catch (e) {
|
|
771
|
+
M(j(e, "The quality gate could not be created."));
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
disabled: !z,
|
|
775
|
+
"data-testid": "quality-gate-new-submit",
|
|
776
|
+
children: R ? "Creating…" : "Create gate"
|
|
777
|
+
}) })
|
|
778
|
+
]
|
|
779
|
+
})]
|
|
780
|
+
});
|
|
781
|
+
}
|
|
644
782
|
//#endregion
|
|
645
|
-
export {
|
|
783
|
+
export { V as ApplyTemplateDialog, L as NewMilestoneDialog, J as NewQualityGateDialog, P as NewReleaseDialog, G as NewRiskDialog, z as NewTemplateFromProjectDialog };
|
|
646
784
|
|
|
647
785
|
//# sourceMappingURL=CreateDialogs.js.map
|