@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,13 +1,14 @@
|
|
|
1
1
|
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { PersonName as n } from "../people/People.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { throwOnError as r } from "../utils/mutationResult.js";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
|
+
import { ArrowLeft as a, Calendar as o, Flag as s, Plus as c, Trash2 as l, User 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 _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
//#region src/planmagnet/pages/GoalsObjectiveDetailPagePage.tsx
|
|
10
|
-
var
|
|
11
|
+
var C = d`
|
|
11
12
|
query GetObjectiveDetail($id: ID!) {
|
|
12
13
|
planmagnetObjective(id: $id) {
|
|
13
14
|
id
|
|
@@ -41,13 +42,13 @@ var S = u`
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
`,
|
|
45
|
+
`, w = d`
|
|
45
46
|
mutation CreateKeyResult($input: PlanmagnetCreateKeyResultInput!) {
|
|
46
47
|
planmagnetCreateKeyResult(input: $input) {
|
|
47
48
|
id
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
`,
|
|
51
|
+
`, T = d`
|
|
51
52
|
mutation UpdateKeyResult($id: ID!, $input: PlanmagnetUpdateKeyResultInput!) {
|
|
52
53
|
planmagnetUpdateKeyResult(id: $id, input: $input) {
|
|
53
54
|
id
|
|
@@ -55,73 +56,83 @@ var S = u`
|
|
|
55
56
|
status
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
`,
|
|
59
|
+
`, E = d`
|
|
59
60
|
mutation DeleteKeyResult($id: ID!) {
|
|
60
61
|
planmagnetDeleteKeyResult(id: $id)
|
|
61
62
|
}
|
|
62
|
-
`,
|
|
63
|
+
`, D = d`
|
|
63
64
|
mutation DeleteObjective($id: ID!) {
|
|
64
65
|
planmagnetDeleteObjective(id: $id)
|
|
65
66
|
}
|
|
66
|
-
`,
|
|
67
|
+
`, O = {
|
|
67
68
|
DRAFT: "bg-gray-100 text-gray-800",
|
|
68
69
|
ACTIVE: "bg-blue-100 text-blue-800",
|
|
69
70
|
COMPLETED: "bg-green-100 text-green-800",
|
|
70
71
|
CANCELLED: "bg-red-100 text-red-800"
|
|
71
|
-
},
|
|
72
|
+
}, k = {
|
|
72
73
|
NOT_STARTED: "bg-gray-100 text-gray-800",
|
|
73
74
|
IN_PROGRESS: "bg-blue-100 text-blue-800",
|
|
74
75
|
AT_RISK: "bg-orange-100 text-orange-800",
|
|
75
76
|
COMPLETED: "bg-green-100 text-green-800"
|
|
76
77
|
};
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
function A({ progress: e }) {
|
|
79
|
+
return /* @__PURE__ */ m("div", {
|
|
79
80
|
className: "h-2 w-full rounded-full bg-muted overflow-hidden",
|
|
80
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ m("div", {
|
|
81
82
|
className: "h-full rounded-full bg-primary transition-all",
|
|
82
83
|
style: { width: `${Math.max(0, Math.min(100, Math.round(e)))}%` }
|
|
83
84
|
})
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
let [
|
|
88
|
-
return /* @__PURE__ */
|
|
87
|
+
function j({ kr: e, onUpdated: t, onDeleted: n }) {
|
|
88
|
+
let [a, o] = i(String(e.currentValue)), [s, { loading: c }] = f(T), [u, { loading: d }] = f(E), [p, g] = i(null);
|
|
89
|
+
return /* @__PURE__ */ h("div", {
|
|
89
90
|
className: "rounded-md border border-input p-4 space-y-3",
|
|
90
91
|
children: [
|
|
91
|
-
/* @__PURE__ */ m("
|
|
92
|
+
p && /* @__PURE__ */ m("p", {
|
|
93
|
+
role: "alert",
|
|
94
|
+
className: "text-sm text-destructive",
|
|
95
|
+
children: p
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ h("div", {
|
|
92
98
|
className: "flex items-start justify-between gap-3",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ h("div", {
|
|
94
100
|
className: "min-w-0",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ m("p", {
|
|
96
102
|
className: "text-sm font-medium",
|
|
97
103
|
children: e.title
|
|
98
|
-
}), e.description && /* @__PURE__ */
|
|
104
|
+
}), e.description && /* @__PURE__ */ m("p", {
|
|
99
105
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
100
106
|
children: e.description
|
|
101
107
|
})]
|
|
102
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ h("div", {
|
|
103
109
|
className: "flex items-center gap-2 shrink-0",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
105
|
-
className: `text-xs px-2 py-0.5 rounded-full capitalize ${
|
|
110
|
+
children: [/* @__PURE__ */ m("span", {
|
|
111
|
+
className: `text-xs px-2 py-0.5 rounded-full capitalize ${k[e.status] ?? ""}`,
|
|
106
112
|
children: e.status.toLowerCase().replace("_", " ")
|
|
107
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ m(_, {
|
|
108
114
|
size: "icon",
|
|
109
115
|
variant: "ghost",
|
|
110
|
-
disabled:
|
|
116
|
+
disabled: d,
|
|
111
117
|
onClick: async () => {
|
|
112
|
-
|
|
118
|
+
g(null);
|
|
119
|
+
try {
|
|
120
|
+
await r(u({ variables: { id: e.id } })), n();
|
|
121
|
+
} catch (e) {
|
|
122
|
+
g(e instanceof Error ? e.message : "The key result could not be deleted.");
|
|
123
|
+
}
|
|
113
124
|
},
|
|
114
125
|
"aria-label": `Delete ${e.title}`,
|
|
115
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
|
|
116
127
|
})]
|
|
117
128
|
})]
|
|
118
129
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ m(A, { progress: e.progress }),
|
|
131
|
+
/* @__PURE__ */ h("div", {
|
|
121
132
|
className: "flex items-center justify-between text-xs text-muted-foreground",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ m("span", { children: e.metricType === "BOOLEAN" ? e.currentValue > 0 ? "Done" : "Not done" : `${e.currentValue}${e.unit ? ` ${e.unit}` : ""} of ${e.targetValue}${e.unit ? ` ${e.unit}` : ""}` }), /* @__PURE__ */ h("span", { children: [Math.round(e.progress), "%"] })]
|
|
123
134
|
}),
|
|
124
|
-
e.linkedWorkItemRollup.totalLinked > 0 && /* @__PURE__ */
|
|
135
|
+
e.linkedWorkItemRollup.totalLinked > 0 && /* @__PURE__ */ h("p", {
|
|
125
136
|
className: "text-xs text-muted-foreground",
|
|
126
137
|
children: [
|
|
127
138
|
e.linkedWorkItemRollup.doneCount,
|
|
@@ -132,296 +143,327 @@ function A({ kr: e, onUpdated: t, onDeleted: n }) {
|
|
|
132
143
|
"%) — informational, update progress above manually"
|
|
133
144
|
]
|
|
134
145
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ h("div", {
|
|
136
147
|
className: "flex items-center gap-2",
|
|
137
|
-
children: [e.metricType === "BOOLEAN" ? /* @__PURE__ */
|
|
148
|
+
children: [e.metricType === "BOOLEAN" ? /* @__PURE__ */ h("select", {
|
|
138
149
|
className: "rounded-md border border-input bg-background px-3 py-1.5 text-sm",
|
|
139
|
-
value:
|
|
140
|
-
onChange: (e) =>
|
|
141
|
-
children: [/* @__PURE__ */
|
|
150
|
+
value: a,
|
|
151
|
+
onChange: (e) => o(e.target.value),
|
|
152
|
+
children: [/* @__PURE__ */ m("option", {
|
|
142
153
|
value: "0",
|
|
143
154
|
children: "Not done"
|
|
144
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ m("option", {
|
|
145
156
|
value: "1",
|
|
146
157
|
children: "Done"
|
|
147
158
|
})]
|
|
148
|
-
}) : /* @__PURE__ */
|
|
159
|
+
}) : /* @__PURE__ */ m(S, {
|
|
149
160
|
type: "number",
|
|
150
|
-
value:
|
|
151
|
-
onChange: (e) =>
|
|
161
|
+
value: a,
|
|
162
|
+
onChange: (e) => o(e.target.value),
|
|
152
163
|
className: "w-32"
|
|
153
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ m(_, {
|
|
154
165
|
size: "sm",
|
|
155
166
|
variant: "outline",
|
|
156
|
-
disabled:
|
|
167
|
+
disabled: c,
|
|
157
168
|
onClick: async () => {
|
|
158
|
-
let n = e.metricType === "BOOLEAN" ? +(
|
|
159
|
-
Number.isNaN(n)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
let n = e.metricType === "BOOLEAN" ? +(a === "1") : Number(a);
|
|
170
|
+
if (!Number.isNaN(n)) {
|
|
171
|
+
g(null);
|
|
172
|
+
try {
|
|
173
|
+
await r(s({ variables: {
|
|
174
|
+
id: e.id,
|
|
175
|
+
input: { currentValue: n }
|
|
176
|
+
} })), t();
|
|
177
|
+
} catch (e) {
|
|
178
|
+
g(e instanceof Error ? e.message : "The progress could not be saved.");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
163
181
|
},
|
|
164
|
-
children:
|
|
182
|
+
children: c ? "Saving..." : "Update progress"
|
|
165
183
|
})]
|
|
166
184
|
})
|
|
167
185
|
]
|
|
168
186
|
});
|
|
169
187
|
}
|
|
170
|
-
function
|
|
171
|
-
let { workspaceId:
|
|
188
|
+
function M() {
|
|
189
|
+
let { workspaceId: d } = e(), T = t(), E = new URLSearchParams(window.location.search).get("objectiveId") ?? "", [k, M] = i(!1), [N, P] = i({
|
|
172
190
|
title: "",
|
|
173
191
|
metricType: "NUMERIC",
|
|
174
192
|
targetValue: "100",
|
|
175
193
|
unit: ""
|
|
176
|
-
}), { data:
|
|
177
|
-
variables: { id:
|
|
178
|
-
skip: !
|
|
179
|
-
}), [
|
|
180
|
-
if (
|
|
194
|
+
}), { data: F, loading: I, error: L, refetch: R } = p(C, {
|
|
195
|
+
variables: { id: E },
|
|
196
|
+
skip: !d || !E
|
|
197
|
+
}), [z, { loading: B }] = f(w), [V, { loading: H }] = f(D), [U, W] = i(null);
|
|
198
|
+
if (I) return /* @__PURE__ */ m("div", {
|
|
181
199
|
className: "flex items-center justify-center p-12",
|
|
182
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ m("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
|
|
183
201
|
});
|
|
184
|
-
if (
|
|
202
|
+
if (L) return /* @__PURE__ */ h("div", {
|
|
185
203
|
className: "p-6 text-red-500",
|
|
186
|
-
children: ["Error: ",
|
|
204
|
+
children: ["Error: ", L.message]
|
|
187
205
|
});
|
|
188
|
-
let
|
|
189
|
-
return
|
|
206
|
+
let G = F?.planmagnetObjective;
|
|
207
|
+
return G ? /* @__PURE__ */ h("div", {
|
|
190
208
|
className: "space-y-6 p-6",
|
|
191
|
-
children: [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
className: "
|
|
195
|
-
children:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
children: [/* @__PURE__ */ p(c, { className: "mr-1 h-4 w-4" }), "Delete"]
|
|
224
|
-
})]
|
|
225
|
-
})]
|
|
226
|
-
}), /* @__PURE__ */ m("div", {
|
|
227
|
-
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
228
|
-
children: [/* @__PURE__ */ m("div", {
|
|
229
|
-
className: "lg:col-span-2 space-y-6",
|
|
230
|
-
children: [/* @__PURE__ */ m(_, { children: [/* @__PURE__ */ m(y, {
|
|
231
|
-
className: "flex flex-row items-center justify-between space-y-0",
|
|
232
|
-
children: [/* @__PURE__ */ p(b, { children: "Overview" }), /* @__PURE__ */ m(h, {
|
|
209
|
+
children: [
|
|
210
|
+
U && /* @__PURE__ */ m("p", {
|
|
211
|
+
role: "alert",
|
|
212
|
+
className: "text-sm text-destructive",
|
|
213
|
+
children: U
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ h("div", {
|
|
216
|
+
className: "flex items-center justify-between",
|
|
217
|
+
children: [/* @__PURE__ */ h("div", {
|
|
218
|
+
className: "flex items-center gap-3",
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ m(_, {
|
|
221
|
+
variant: "ghost",
|
|
222
|
+
size: "icon",
|
|
223
|
+
onClick: () => T("/goals/goals-page"),
|
|
224
|
+
children: /* @__PURE__ */ m(a, { className: "h-4 w-4" })
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ m(s, { className: "h-6 w-6 text-primary" }),
|
|
227
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
228
|
+
className: "text-2xl font-semibold",
|
|
229
|
+
children: G.title
|
|
230
|
+
}), /* @__PURE__ */ m("p", {
|
|
231
|
+
className: "text-sm text-muted-foreground",
|
|
232
|
+
children: G.periodLabel
|
|
233
|
+
})] })
|
|
234
|
+
]
|
|
235
|
+
}), /* @__PURE__ */ h("div", {
|
|
236
|
+
className: "flex items-center gap-2",
|
|
237
|
+
children: [/* @__PURE__ */ m("span", {
|
|
238
|
+
className: `text-xs px-3 py-1 rounded-full capitalize ${O[G.status] ?? "bg-gray-100"}`,
|
|
239
|
+
children: G.status.toLowerCase()
|
|
240
|
+
}), /* @__PURE__ */ h(_, {
|
|
233
241
|
variant: "outline",
|
|
234
|
-
children: [Math.round(H.progress), "% complete"]
|
|
235
|
-
})]
|
|
236
|
-
}), /* @__PURE__ */ m(v, {
|
|
237
|
-
className: "space-y-4",
|
|
238
|
-
children: [/* @__PURE__ */ p("p", {
|
|
239
|
-
className: "text-sm",
|
|
240
|
-
children: H.description ?? "No description provided."
|
|
241
|
-
}), /* @__PURE__ */ p(k, { progress: H.progress })]
|
|
242
|
-
})] }), /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ m(y, {
|
|
243
|
-
className: "flex flex-row items-center justify-between space-y-0",
|
|
244
|
-
children: [/* @__PURE__ */ p(b, { children: "Key Results" }), !O && /* @__PURE__ */ m(g, {
|
|
245
242
|
size: "sm",
|
|
246
|
-
|
|
247
|
-
onClick: () =>
|
|
248
|
-
|
|
243
|
+
disabled: H,
|
|
244
|
+
onClick: async () => {
|
|
245
|
+
W(null);
|
|
246
|
+
try {
|
|
247
|
+
await r(V({ variables: { id: E } }));
|
|
248
|
+
} catch (e) {
|
|
249
|
+
W(e instanceof Error ? e.message : "The objective could not be deleted.");
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
T("/goals/goals-page");
|
|
253
|
+
},
|
|
254
|
+
children: [/* @__PURE__ */ m(l, { className: "mr-1 h-4 w-4" }), "Delete"]
|
|
249
255
|
})]
|
|
250
|
-
})
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
256
|
+
})]
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ h("div", {
|
|
259
|
+
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
260
|
+
children: [/* @__PURE__ */ h("div", {
|
|
261
|
+
className: "lg:col-span-2 space-y-6",
|
|
262
|
+
children: [/* @__PURE__ */ h(v, { children: [/* @__PURE__ */ h(b, {
|
|
263
|
+
className: "flex flex-row items-center justify-between space-y-0",
|
|
264
|
+
children: [/* @__PURE__ */ m(x, { children: "Overview" }), /* @__PURE__ */ h(g, {
|
|
265
|
+
variant: "outline",
|
|
266
|
+
children: [Math.round(G.progress), "% complete"]
|
|
267
|
+
})]
|
|
268
|
+
}), /* @__PURE__ */ h(y, {
|
|
269
|
+
className: "space-y-4",
|
|
270
|
+
children: [/* @__PURE__ */ m("p", {
|
|
271
|
+
className: "text-sm",
|
|
272
|
+
children: G.description ?? "No description provided."
|
|
273
|
+
}), /* @__PURE__ */ m(A, { progress: G.progress })]
|
|
274
|
+
})] }), /* @__PURE__ */ h(v, { children: [/* @__PURE__ */ h(b, {
|
|
275
|
+
className: "flex flex-row items-center justify-between space-y-0",
|
|
276
|
+
children: [/* @__PURE__ */ m(x, { children: "Key Results" }), !k && /* @__PURE__ */ h(_, {
|
|
277
|
+
size: "sm",
|
|
278
|
+
variant: "outline",
|
|
279
|
+
onClick: () => M(!0),
|
|
280
|
+
children: [/* @__PURE__ */ m(c, { className: "mr-1 h-4 w-4" }), "Add Key Result"]
|
|
281
|
+
})]
|
|
282
|
+
}), /* @__PURE__ */ h(y, {
|
|
283
|
+
className: "space-y-4",
|
|
284
|
+
children: [
|
|
285
|
+
k && /* @__PURE__ */ h("div", {
|
|
286
|
+
className: "space-y-3 rounded-md border border-input p-3",
|
|
287
|
+
children: [
|
|
288
|
+
/* @__PURE__ */ m(S, {
|
|
289
|
+
placeholder: "Key result title, e.g. Sign 10 new enterprise customers",
|
|
290
|
+
value: N.title,
|
|
291
|
+
onChange: (e) => P({
|
|
292
|
+
...N,
|
|
293
|
+
title: e.target.value
|
|
294
|
+
})
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ h("div", {
|
|
297
|
+
className: "grid grid-cols-3 gap-3",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ h("select", {
|
|
300
|
+
className: "rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
301
|
+
value: N.metricType,
|
|
302
|
+
onChange: (e) => P({
|
|
303
|
+
...N,
|
|
304
|
+
metricType: e.target.value
|
|
282
305
|
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ m("option", {
|
|
308
|
+
value: "NUMERIC",
|
|
309
|
+
children: "Numeric"
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ m("option", {
|
|
312
|
+
value: "PERCENTAGE",
|
|
313
|
+
children: "Percentage"
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ m("option", {
|
|
316
|
+
value: "BOOLEAN",
|
|
317
|
+
children: "Yes / No"
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}),
|
|
321
|
+
N.metricType !== "BOOLEAN" && /* @__PURE__ */ m(S, {
|
|
322
|
+
type: "number",
|
|
323
|
+
placeholder: "Target value",
|
|
324
|
+
value: N.targetValue,
|
|
325
|
+
onChange: (e) => P({
|
|
326
|
+
...N,
|
|
327
|
+
targetValue: e.target.value
|
|
328
|
+
})
|
|
329
|
+
}),
|
|
330
|
+
N.metricType === "NUMERIC" && /* @__PURE__ */ m(S, {
|
|
331
|
+
placeholder: "Unit (optional)",
|
|
332
|
+
value: N.unit,
|
|
333
|
+
onChange: (e) => P({
|
|
334
|
+
...N,
|
|
335
|
+
unit: e.target.value
|
|
286
336
|
})
|
|
287
|
-
]
|
|
288
|
-
}),
|
|
289
|
-
M.metricType !== "BOOLEAN" && /* @__PURE__ */ p(x, {
|
|
290
|
-
type: "number",
|
|
291
|
-
placeholder: "Target value",
|
|
292
|
-
value: M.targetValue,
|
|
293
|
-
onChange: (e) => N({
|
|
294
|
-
...M,
|
|
295
|
-
targetValue: e.target.value
|
|
296
|
-
})
|
|
297
|
-
}),
|
|
298
|
-
M.metricType === "NUMERIC" && /* @__PURE__ */ p(x, {
|
|
299
|
-
placeholder: "Unit (optional)",
|
|
300
|
-
value: M.unit,
|
|
301
|
-
onChange: (e) => N({
|
|
302
|
-
...M,
|
|
303
|
-
unit: e.target.value
|
|
304
337
|
})
|
|
305
|
-
|
|
306
|
-
|
|
338
|
+
]
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ h("div", {
|
|
341
|
+
className: "flex gap-2 justify-end",
|
|
342
|
+
children: [/* @__PURE__ */ m(_, {
|
|
343
|
+
size: "sm",
|
|
344
|
+
variant: "ghost",
|
|
345
|
+
onClick: () => {
|
|
346
|
+
M(!1), P({
|
|
347
|
+
title: "",
|
|
348
|
+
metricType: "NUMERIC",
|
|
349
|
+
targetValue: "100",
|
|
350
|
+
unit: ""
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
children: "Cancel"
|
|
354
|
+
}), /* @__PURE__ */ m(_, {
|
|
355
|
+
size: "sm",
|
|
356
|
+
disabled: B || !N.title.trim(),
|
|
357
|
+
onClick: async () => {
|
|
358
|
+
if (!N.title.trim() || !E) return;
|
|
359
|
+
let e = Number(N.metricType === "BOOLEAN" ? 1 : N.targetValue);
|
|
360
|
+
if (!Number.isNaN(e)) {
|
|
361
|
+
W(null);
|
|
362
|
+
try {
|
|
363
|
+
await r(z({ variables: { input: {
|
|
364
|
+
objectiveId: E,
|
|
365
|
+
title: N.title.trim(),
|
|
366
|
+
metricType: N.metricType,
|
|
367
|
+
targetValue: e,
|
|
368
|
+
unit: N.unit.trim() || void 0
|
|
369
|
+
} } }));
|
|
370
|
+
} catch (e) {
|
|
371
|
+
W(e instanceof Error ? e.message : "The key result could not be added.");
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
P({
|
|
375
|
+
title: "",
|
|
376
|
+
metricType: "NUMERIC",
|
|
377
|
+
targetValue: "100",
|
|
378
|
+
unit: ""
|
|
379
|
+
}), M(!1), R();
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
children: B ? "Adding..." : "Add Key Result"
|
|
383
|
+
})]
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
}),
|
|
387
|
+
G.keyResults.length === 0 && !k && /* @__PURE__ */ m("p", {
|
|
388
|
+
className: "text-sm text-muted-foreground",
|
|
389
|
+
children: "No key results yet. Add one to make this objective measurable."
|
|
390
|
+
}),
|
|
391
|
+
G.keyResults.map((e) => /* @__PURE__ */ m(j, {
|
|
392
|
+
kr: e,
|
|
393
|
+
onUpdated: () => void R(),
|
|
394
|
+
onDeleted: () => void R()
|
|
395
|
+
}, e.id))
|
|
396
|
+
]
|
|
397
|
+
})] })]
|
|
398
|
+
}), /* @__PURE__ */ h(v, { children: [/* @__PURE__ */ m(b, { children: /* @__PURE__ */ m(x, { children: "Details" }) }), /* @__PURE__ */ h(y, {
|
|
399
|
+
className: "space-y-3 text-sm",
|
|
400
|
+
children: [
|
|
401
|
+
/* @__PURE__ */ h("div", {
|
|
402
|
+
className: "flex items-center gap-2",
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ m(u, { className: "h-4 w-4 text-muted-foreground" }),
|
|
405
|
+
/* @__PURE__ */ m("span", {
|
|
406
|
+
className: "text-muted-foreground",
|
|
407
|
+
children: "Owner:"
|
|
307
408
|
}),
|
|
308
|
-
/* @__PURE__ */ m("
|
|
309
|
-
className: "
|
|
310
|
-
children:
|
|
311
|
-
size: "sm",
|
|
312
|
-
variant: "ghost",
|
|
313
|
-
onClick: () => {
|
|
314
|
-
j(!1), N({
|
|
315
|
-
title: "",
|
|
316
|
-
metricType: "NUMERIC",
|
|
317
|
-
targetValue: "100",
|
|
318
|
-
unit: ""
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
children: "Cancel"
|
|
322
|
-
}), /* @__PURE__ */ p(g, {
|
|
323
|
-
size: "sm",
|
|
324
|
-
disabled: z || !M.title.trim(),
|
|
325
|
-
onClick: async () => {
|
|
326
|
-
if (!M.title.trim() || !T) return;
|
|
327
|
-
let e = Number(M.metricType === "BOOLEAN" ? 1 : M.targetValue);
|
|
328
|
-
Number.isNaN(e) || (await R({ variables: { input: {
|
|
329
|
-
objectiveId: T,
|
|
330
|
-
title: M.title.trim(),
|
|
331
|
-
metricType: M.metricType,
|
|
332
|
-
targetValue: e,
|
|
333
|
-
unit: M.unit.trim() || void 0
|
|
334
|
-
} } }), N({
|
|
335
|
-
title: "",
|
|
336
|
-
metricType: "NUMERIC",
|
|
337
|
-
targetValue: "100",
|
|
338
|
-
unit: ""
|
|
339
|
-
}), j(!1), L());
|
|
340
|
-
},
|
|
341
|
-
children: z ? "Adding..." : "Add Key Result"
|
|
342
|
-
})]
|
|
409
|
+
/* @__PURE__ */ m("span", {
|
|
410
|
+
className: "font-medium",
|
|
411
|
+
children: /* @__PURE__ */ m(n, { id: G.ownerId })
|
|
343
412
|
})
|
|
344
413
|
]
|
|
345
414
|
}),
|
|
346
|
-
|
|
347
|
-
className: "
|
|
348
|
-
children:
|
|
415
|
+
/* @__PURE__ */ h("div", {
|
|
416
|
+
className: "flex items-center gap-2",
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ m(o, { className: "h-4 w-4 text-muted-foreground" }),
|
|
419
|
+
/* @__PURE__ */ m("span", {
|
|
420
|
+
className: "text-muted-foreground",
|
|
421
|
+
children: "Period:"
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ m("span", {
|
|
424
|
+
className: "font-medium",
|
|
425
|
+
children: G.periodLabel
|
|
426
|
+
})
|
|
427
|
+
]
|
|
349
428
|
}),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
429
|
+
G.endDate && /* @__PURE__ */ h("div", {
|
|
430
|
+
className: "flex items-center gap-2",
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ m(o, { className: "h-4 w-4 text-muted-foreground" }),
|
|
433
|
+
/* @__PURE__ */ m("span", {
|
|
434
|
+
className: "text-muted-foreground",
|
|
435
|
+
children: "Target end:"
|
|
436
|
+
}),
|
|
437
|
+
/* @__PURE__ */ m("span", {
|
|
438
|
+
className: "font-medium",
|
|
439
|
+
children: new Date(G.endDate).toLocaleDateString()
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ h("div", {
|
|
444
|
+
className: "flex items-center gap-2",
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ m(o, { className: "h-4 w-4 text-muted-foreground" }),
|
|
447
|
+
/* @__PURE__ */ m("span", {
|
|
448
|
+
className: "text-muted-foreground",
|
|
449
|
+
children: "Created:"
|
|
450
|
+
}),
|
|
451
|
+
/* @__PURE__ */ m("span", {
|
|
452
|
+
className: "font-medium",
|
|
453
|
+
children: G.createdAt ? new Date(G.createdAt).toLocaleDateString() : "—"
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
})
|
|
355
457
|
]
|
|
356
458
|
})] })]
|
|
357
|
-
})
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
/* @__PURE__ */ m("div", {
|
|
361
|
-
className: "flex items-center gap-2",
|
|
362
|
-
children: [
|
|
363
|
-
/* @__PURE__ */ p(l, { className: "h-4 w-4 text-muted-foreground" }),
|
|
364
|
-
/* @__PURE__ */ p("span", {
|
|
365
|
-
className: "text-muted-foreground",
|
|
366
|
-
children: "Owner:"
|
|
367
|
-
}),
|
|
368
|
-
/* @__PURE__ */ p("span", {
|
|
369
|
-
className: "font-medium",
|
|
370
|
-
children: /* @__PURE__ */ p(n, { id: H.ownerId })
|
|
371
|
-
})
|
|
372
|
-
]
|
|
373
|
-
}),
|
|
374
|
-
/* @__PURE__ */ m("div", {
|
|
375
|
-
className: "flex items-center gap-2",
|
|
376
|
-
children: [
|
|
377
|
-
/* @__PURE__ */ p(a, { className: "h-4 w-4 text-muted-foreground" }),
|
|
378
|
-
/* @__PURE__ */ p("span", {
|
|
379
|
-
className: "text-muted-foreground",
|
|
380
|
-
children: "Period:"
|
|
381
|
-
}),
|
|
382
|
-
/* @__PURE__ */ p("span", {
|
|
383
|
-
className: "font-medium",
|
|
384
|
-
children: H.periodLabel
|
|
385
|
-
})
|
|
386
|
-
]
|
|
387
|
-
}),
|
|
388
|
-
H.endDate && /* @__PURE__ */ m("div", {
|
|
389
|
-
className: "flex items-center gap-2",
|
|
390
|
-
children: [
|
|
391
|
-
/* @__PURE__ */ p(a, { className: "h-4 w-4 text-muted-foreground" }),
|
|
392
|
-
/* @__PURE__ */ p("span", {
|
|
393
|
-
className: "text-muted-foreground",
|
|
394
|
-
children: "Target end:"
|
|
395
|
-
}),
|
|
396
|
-
/* @__PURE__ */ p("span", {
|
|
397
|
-
className: "font-medium",
|
|
398
|
-
children: new Date(H.endDate).toLocaleDateString()
|
|
399
|
-
})
|
|
400
|
-
]
|
|
401
|
-
}),
|
|
402
|
-
/* @__PURE__ */ m("div", {
|
|
403
|
-
className: "flex items-center gap-2",
|
|
404
|
-
children: [
|
|
405
|
-
/* @__PURE__ */ p(a, { className: "h-4 w-4 text-muted-foreground" }),
|
|
406
|
-
/* @__PURE__ */ p("span", {
|
|
407
|
-
className: "text-muted-foreground",
|
|
408
|
-
children: "Created:"
|
|
409
|
-
}),
|
|
410
|
-
/* @__PURE__ */ p("span", {
|
|
411
|
-
className: "font-medium",
|
|
412
|
-
children: H.createdAt ? new Date(H.createdAt).toLocaleDateString() : "—"
|
|
413
|
-
})
|
|
414
|
-
]
|
|
415
|
-
})
|
|
416
|
-
]
|
|
417
|
-
})] })]
|
|
418
|
-
})]
|
|
419
|
-
}) : /* @__PURE__ */ p("div", {
|
|
459
|
+
})
|
|
460
|
+
]
|
|
461
|
+
}) : /* @__PURE__ */ m("div", {
|
|
420
462
|
className: "p-6 text-muted-foreground",
|
|
421
463
|
children: "Objective not found."
|
|
422
464
|
});
|
|
423
465
|
}
|
|
424
466
|
//#endregion
|
|
425
|
-
export {
|
|
467
|
+
export { M as GoalsObjectiveDetailPagePage };
|
|
426
468
|
|
|
427
469
|
//# sourceMappingURL=GoalsObjectiveDetailPagePage.js.map
|