@burdenoff/microfe-planmagnet 2026.927.2 → 2026.927.4

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