@burdenoff/microfe-planmagnet 2026.925.7 → 2026.925.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/generated/wspace-types.d.ts +49 -0
  2. package/dist/generated/wspace-types.d.ts.map +1 -1
  3. package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
  4. package/dist/planmagnet/board/ProjectBoard.js +159 -158
  5. package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
  6. package/dist/planmagnet/comments/WorkItemComments.d.ts +4 -0
  7. package/dist/planmagnet/comments/WorkItemComments.d.ts.map +1 -0
  8. package/dist/planmagnet/comments/WorkItemComments.js +260 -0
  9. package/dist/planmagnet/comments/WorkItemComments.js.map +1 -0
  10. package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
  11. package/dist/planmagnet/create/CreateDialogs.js +118 -117
  12. package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
  13. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.d.ts.map +1 -1
  14. package/dist/planmagnet/pages/GoalsCreateObjectivePagePage.js.map +1 -1
  15. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
  16. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +322 -280
  17. package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
  18. package/dist/planmagnet/pages/TasksCreateTaskPagePage.d.ts.map +1 -1
  19. package/dist/planmagnet/pages/TasksCreateTaskPagePage.js.map +1 -1
  20. package/dist/planmagnet/pages/TasksEditTaskPagePage.d.ts.map +1 -1
  21. package/dist/planmagnet/pages/TasksEditTaskPagePage.js.map +1 -1
  22. package/dist/planmagnet/pages/TasksTaskDetailPagePage.d.ts.map +1 -1
  23. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +166 -143
  24. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js.map +1 -1
  25. package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
  26. package/dist/planmagnet/sprints/SprintControls.js +202 -201
  27. package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
  28. package/dist/planmagnet/utils/mutationResult.d.ts +16 -0
  29. package/dist/planmagnet/utils/mutationResult.d.ts.map +1 -0
  30. package/dist/planmagnet/utils/mutationResult.js +10 -0
  31. package/dist/planmagnet/utils/mutationResult.js.map +1 -0
  32. 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 { useState as r } from "react";
4
- import { ArrowLeft as i, Calendar as a, Flag as o, Plus as s, Trash2 as c, User as l } from "lucide-react";
5
- import { gql as u } from "@apollo/client";
6
- import { useMutation as d, useQuery as f } from "@apollo/client/react";
7
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
- import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x } from "@burdenoff/fe-libs/ui";
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 S = u`
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
- `, C = u`
45
+ `, w = d`
45
46
  mutation CreateKeyResult($input: PlanmagnetCreateKeyResultInput!) {
46
47
  planmagnetCreateKeyResult(input: $input) {
47
48
  id
48
49
  }
49
50
  }
50
- `, w = u`
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
- `, T = u`
59
+ `, E = d`
59
60
  mutation DeleteKeyResult($id: ID!) {
60
61
  planmagnetDeleteKeyResult(id: $id)
61
62
  }
62
- `, E = u`
63
+ `, D = d`
63
64
  mutation DeleteObjective($id: ID!) {
64
65
  planmagnetDeleteObjective(id: $id)
65
66
  }
66
- `, D = {
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
- }, O = {
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 k({ progress: e }) {
78
- return /* @__PURE__ */ p("div", {
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__ */ p("div", {
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 A({ kr: e, onUpdated: t, onDeleted: n }) {
87
- let [i, a] = r(String(e.currentValue)), [o, { loading: s }] = d(w), [l, { loading: u }] = d(T);
88
- return /* @__PURE__ */ m("div", {
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("div", {
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__ */ m("div", {
99
+ children: [/* @__PURE__ */ h("div", {
94
100
  className: "min-w-0",
95
- children: [/* @__PURE__ */ p("p", {
101
+ children: [/* @__PURE__ */ m("p", {
96
102
  className: "text-sm font-medium",
97
103
  children: e.title
98
- }), e.description && /* @__PURE__ */ p("p", {
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__ */ m("div", {
108
+ }), /* @__PURE__ */ h("div", {
103
109
  className: "flex items-center gap-2 shrink-0",
104
- children: [/* @__PURE__ */ p("span", {
105
- className: `text-xs px-2 py-0.5 rounded-full capitalize ${O[e.status] ?? ""}`,
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__ */ p(g, {
113
+ }), /* @__PURE__ */ m(_, {
108
114
  size: "icon",
109
115
  variant: "ghost",
110
- disabled: u,
116
+ disabled: d,
111
117
  onClick: async () => {
112
- await l({ variables: { id: e.id } }), n();
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__ */ p(c, { className: "h-4 w-4" })
126
+ children: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
116
127
  })]
117
128
  })]
118
129
  }),
119
- /* @__PURE__ */ p(k, { progress: e.progress }),
120
- /* @__PURE__ */ m("div", {
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__ */ p("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__ */ m("span", { children: [Math.round(e.progress), "%"] })]
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__ */ m("p", {
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__ */ m("div", {
146
+ /* @__PURE__ */ h("div", {
136
147
  className: "flex items-center gap-2",
137
- children: [e.metricType === "BOOLEAN" ? /* @__PURE__ */ m("select", {
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: i,
140
- onChange: (e) => a(e.target.value),
141
- children: [/* @__PURE__ */ p("option", {
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__ */ p("option", {
155
+ }), /* @__PURE__ */ m("option", {
145
156
  value: "1",
146
157
  children: "Done"
147
158
  })]
148
- }) : /* @__PURE__ */ p(x, {
159
+ }) : /* @__PURE__ */ m(S, {
149
160
  type: "number",
150
- value: i,
151
- onChange: (e) => a(e.target.value),
161
+ value: a,
162
+ onChange: (e) => o(e.target.value),
152
163
  className: "w-32"
153
- }), /* @__PURE__ */ p(g, {
164
+ }), /* @__PURE__ */ m(_, {
154
165
  size: "sm",
155
166
  variant: "outline",
156
- disabled: s,
167
+ disabled: c,
157
168
  onClick: async () => {
158
- let n = e.metricType === "BOOLEAN" ? +(i === "1") : Number(i);
159
- Number.isNaN(n) || (await o({ variables: {
160
- id: e.id,
161
- input: { currentValue: n }
162
- } }), t());
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: s ? "Saving..." : "Update progress"
182
+ children: c ? "Saving..." : "Update progress"
165
183
  })]
166
184
  })
167
185
  ]
168
186
  });
169
187
  }
170
- function j() {
171
- let { workspaceId: u } = e(), w = t(), T = new URLSearchParams(window.location.search).get("objectiveId") ?? "", [O, j] = r(!1), [M, N] = r({
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: P, loading: F, error: I, refetch: L } = f(S, {
177
- variables: { id: T },
178
- skip: !u || !T
179
- }), [R, { loading: z }] = d(C), [B, { loading: V }] = d(E);
180
- if (F) return /* @__PURE__ */ p("div", {
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__ */ p("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
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 (I) return /* @__PURE__ */ m("div", {
202
+ if (L) return /* @__PURE__ */ h("div", {
185
203
  className: "p-6 text-red-500",
186
- children: ["Error: ", I.message]
204
+ children: ["Error: ", L.message]
187
205
  });
188
- let H = P?.planmagnetObjective;
189
- return H ? /* @__PURE__ */ m("div", {
206
+ let G = F?.planmagnetObjective;
207
+ return G ? /* @__PURE__ */ h("div", {
190
208
  className: "space-y-6 p-6",
191
- children: [/* @__PURE__ */ m("div", {
192
- className: "flex items-center justify-between",
193
- children: [/* @__PURE__ */ m("div", {
194
- className: "flex items-center gap-3",
195
- children: [
196
- /* @__PURE__ */ p(g, {
197
- variant: "ghost",
198
- size: "icon",
199
- onClick: () => w("/goals/goals-page"),
200
- children: /* @__PURE__ */ p(i, { className: "h-4 w-4" })
201
- }),
202
- /* @__PURE__ */ p(o, { className: "h-6 w-6 text-primary" }),
203
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
204
- className: "text-2xl font-semibold",
205
- children: H.title
206
- }), /* @__PURE__ */ p("p", {
207
- className: "text-sm text-muted-foreground",
208
- children: H.periodLabel
209
- })] })
210
- ]
211
- }), /* @__PURE__ */ m("div", {
212
- className: "flex items-center gap-2",
213
- children: [/* @__PURE__ */ p("span", {
214
- className: `text-xs px-3 py-1 rounded-full capitalize ${D[H.status] ?? "bg-gray-100"}`,
215
- children: H.status.toLowerCase()
216
- }), /* @__PURE__ */ m(g, {
217
- variant: "outline",
218
- size: "sm",
219
- disabled: V,
220
- onClick: async () => {
221
- await B({ variables: { id: T } }), w("/goals/goals-page");
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
- variant: "outline",
247
- onClick: () => j(!0),
248
- children: [/* @__PURE__ */ p(s, { className: "mr-1 h-4 w-4" }), "Add Key Result"]
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
- }), /* @__PURE__ */ m(v, {
251
- className: "space-y-4",
252
- children: [
253
- O && /* @__PURE__ */ m("div", {
254
- className: "space-y-3 rounded-md border border-input p-3",
255
- children: [
256
- /* @__PURE__ */ p(x, {
257
- placeholder: "Key result title, e.g. Sign 10 new enterprise customers",
258
- value: M.title,
259
- onChange: (e) => N({
260
- ...M,
261
- title: e.target.value
262
- })
263
- }),
264
- /* @__PURE__ */ m("div", {
265
- className: "grid grid-cols-3 gap-3",
266
- children: [
267
- /* @__PURE__ */ m("select", {
268
- className: "rounded-md border border-input bg-background px-3 py-2 text-sm",
269
- value: M.metricType,
270
- onChange: (e) => N({
271
- ...M,
272
- metricType: e.target.value
273
- }),
274
- children: [
275
- /* @__PURE__ */ p("option", {
276
- value: "NUMERIC",
277
- children: "Numeric"
278
- }),
279
- /* @__PURE__ */ p("option", {
280
- value: "PERCENTAGE",
281
- children: "Percentage"
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
- /* @__PURE__ */ p("option", {
284
- value: "BOOLEAN",
285
- children: "Yes / No"
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("div", {
309
- className: "flex gap-2 justify-end",
310
- children: [/* @__PURE__ */ p(g, {
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
- H.keyResults.length === 0 && !O && /* @__PURE__ */ p("p", {
347
- className: "text-sm text-muted-foreground",
348
- children: "No key results yet. Add one to make this objective measurable."
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
- H.keyResults.map((e) => /* @__PURE__ */ p(A, {
351
- kr: e,
352
- onUpdated: () => void L(),
353
- onDeleted: () => void L()
354
- }, e.id))
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
- }), /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ p(y, { children: /* @__PURE__ */ p(b, { children: "Details" }) }), /* @__PURE__ */ m(v, {
358
- className: "space-y-3 text-sm",
359
- children: [
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 { j as GoalsObjectiveDetailPagePage };
467
+ export { M as GoalsObjectiveDetailPagePage };
426
468
 
427
469
  //# sourceMappingURL=GoalsObjectiveDetailPagePage.js.map