@burdenoff/microfe-planmagnet 2026.927.4 → 2026.927.6
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/generated/global-types.d.ts +9 -1
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +0 -12
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +14 -10
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.d.ts.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +149 -127
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.d.ts +2 -0
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +492 -225
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +142 -139
- package/dist/planmagnet/controls/FeatureControls.js.map +1 -1
- package/dist/planmagnet/controls/FeatureTriage.d.ts +21 -0
- package/dist/planmagnet/controls/FeatureTriage.d.ts.map +1 -0
- package/dist/planmagnet/controls/FeatureTriage.js +398 -0
- package/dist/planmagnet/controls/FeatureTriage.js.map +1 -0
- package/dist/planmagnet/controls/MilestoneControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/MilestoneControls.js +76 -73
- package/dist/planmagnet/controls/MilestoneControls.js.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.js +47 -44
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -1
- package/dist/planmagnet/controls/ReleaseControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/ReleaseControls.js +47 -44
- package/dist/planmagnet/controls/ReleaseControls.js.map +1 -1
- package/dist/planmagnet/controls/WorkItemControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/WorkItemControls.js +68 -65
- package/dist/planmagnet/controls/WorkItemControls.js.map +1 -1
- package/dist/planmagnet/hooks/useCounts.d.ts +39 -0
- package/dist/planmagnet/hooks/useCounts.d.ts.map +1 -0
- package/dist/planmagnet/hooks/useCounts.js +209 -0
- package/dist/planmagnet/hooks/useCounts.js.map +1 -0
- package/dist/planmagnet/import/exportColumns.d.ts +52 -0
- package/dist/planmagnet/import/exportColumns.d.ts.map +1 -0
- package/dist/planmagnet/import/exportColumns.js +81 -0
- package/dist/planmagnet/import/exportColumns.js.map +1 -0
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +255 -242
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js +199 -160
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js +147 -144
- package/dist/planmagnet/pages/DocsDocDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsGoalsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsGoalsPagePage.js +2 -7
- package/dist/planmagnet/pages/GoalsGoalsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js +173 -173
- package/dist/planmagnet/pages/GoalsObjectiveDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +120 -117
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.js +97 -117
- package/dist/planmagnet/pages/ProductsFeatureAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js +168 -103
- package/dist/planmagnet/pages/ProductsFeatureDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js +117 -103
- package/dist/planmagnet/pages/ProductsFeaturesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -8
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsProductsPagePage.js +85 -90
- package/dist/planmagnet/pages/ProductsProductsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +12 -2
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js +2 -2
- package/dist/planmagnet/pages/ProductsReleasesPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js +48 -71
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js +17 -13
- package/dist/planmagnet/pages/ProductsRoadmapsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.js +1 -1
- package/dist/planmagnet/pages/ProjectsActiveProjectsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +11 -8
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsPlanningPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningPagePage.js +1 -1
- package/dist/planmagnet/pages/ProjectsPlanningPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +152 -139
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.js +75 -74
- package/dist/planmagnet/pages/ProjectsProjectsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ReportsReportsPagePage.d.ts +7 -0
- package/dist/planmagnet/pages/ReportsReportsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ReportsReportsPagePage.js +39 -201
- package/dist/planmagnet/pages/ReportsReportsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js +118 -99
- package/dist/planmagnet/pages/SprintsStartSprintPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksImportPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/TasksImportPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/TasksImportPagePage.js +309 -0
- package/dist/planmagnet/pages/TasksImportPagePage.js.map +1 -0
- package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.js +110 -104
- package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TeamTeamPagePage.js +99 -177
- package/dist/planmagnet/pages/TeamTeamPagePage.js.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js +8 -4
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js.map +1 -1
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.d.ts.map +1 -1
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.js +10 -4
- package/dist/planmagnet/releases/ReleaseWorkItemsCard.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapControls.js +151 -138
- package/dist/planmagnet/roadmaps/RoadmapControls.js.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.d.ts.map +1 -1
- package/dist/planmagnet/sprints/SprintControls.js +32 -30
- package/dist/planmagnet/sprints/SprintControls.js.map +1 -1
- package/dist/planmagnet/utils/mutationResult.d.ts +10 -0
- package/dist/planmagnet/utils/mutationResult.d.ts.map +1 -1
- package/dist/planmagnet/utils/mutationResult.js +2 -1
- package/dist/planmagnet/utils/mutationResult.js.map +1 -1
- package/dist/planmagnet/utils/rowNavigation.d.ts +2 -0
- package/dist/planmagnet/utils/rowNavigation.d.ts.map +1 -1
- package/dist/planmagnet/utils/rowNavigation.js +9 -8
- package/dist/planmagnet/utils/rowNavigation.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useFeatureCounts as e } from "../hooks/useCounts.js";
|
|
2
2
|
import { planningFocusLabel as t } from "../roadmaps/planningFocus.js";
|
|
3
3
|
import { AlertTriangle as n, BarChart3 as r, CheckCircle as i, Loader2 as a, Target as o, TrendingUp as s } from "lucide-react";
|
|
4
4
|
import { useParams as c } from "react-router";
|
|
@@ -29,71 +29,48 @@ var _ = l`
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
`, v = l`
|
|
33
|
-
query ListFeatureRequestsForRoadmapAnalytics(
|
|
34
|
-
$workspaceId: ID!
|
|
35
|
-
$pagination: PlanmagnetPaginationInput
|
|
36
|
-
) {
|
|
37
|
-
planmagnetFeatureRequests(workspaceId: $workspaceId, pagination: $pagination) {
|
|
38
|
-
items {
|
|
39
|
-
id
|
|
40
|
-
status
|
|
41
|
-
voteCount
|
|
42
|
-
businessValue
|
|
43
|
-
priorityScore
|
|
44
|
-
}
|
|
45
|
-
totalCount
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
32
|
`;
|
|
49
|
-
function
|
|
50
|
-
let
|
|
51
|
-
variables: { id:
|
|
52
|
-
skip: !y
|
|
53
|
-
}), { data: C } = u(v, {
|
|
54
|
-
variables: {
|
|
55
|
-
workspaceId: l,
|
|
56
|
-
pagination: { first: 100 }
|
|
57
|
-
},
|
|
33
|
+
function v() {
|
|
34
|
+
let l = c().id ?? "", { data: v, loading: y, error: b } = u(_, {
|
|
35
|
+
variables: { id: l },
|
|
58
36
|
skip: !l
|
|
59
|
-
});
|
|
60
|
-
if (
|
|
37
|
+
}), x = e();
|
|
38
|
+
if (y && !v) return /* @__PURE__ */ d("div", {
|
|
61
39
|
className: "flex items-center justify-center p-12",
|
|
62
40
|
children: /* @__PURE__ */ d(a, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
63
41
|
});
|
|
64
|
-
if (
|
|
42
|
+
if (b) return /* @__PURE__ */ f("div", {
|
|
65
43
|
className: "p-6 text-destructive",
|
|
66
|
-
children: ["Failed to load analytics: ",
|
|
44
|
+
children: ["Failed to load analytics: ", b.message]
|
|
67
45
|
});
|
|
68
|
-
let
|
|
69
|
-
if (!
|
|
46
|
+
let S = v?.planmagnetRoadmap;
|
|
47
|
+
if (!S) return /* @__PURE__ */ d("div", {
|
|
70
48
|
className: "p-6 text-muted-foreground",
|
|
71
49
|
children: "Roadmap not found."
|
|
72
50
|
});
|
|
73
|
-
let
|
|
74
|
-
for (let e of
|
|
75
|
-
let A = {};
|
|
76
|
-
for (let e of
|
|
77
|
-
let j = {};
|
|
78
|
-
for (let e of T) {
|
|
51
|
+
let C = S.items ?? [], w = (e) => e.status === "COMPLETED" || e.status === "DONE", T = C.filter((e) => e.status !== "CANCELLED"), E = T.filter(w), D = T.length > 0 ? Math.round(E.length / T.length * 100) : 0, O = {};
|
|
52
|
+
for (let e of C) O[e.status] = (O[e.status] || 0) + 1;
|
|
53
|
+
let k = x ? Object.fromEntries(Object.entries(x.byStatus).filter(([, e]) => e > 0)) : {}, A = {};
|
|
54
|
+
for (let e of C) {
|
|
79
55
|
let t = e.swimlane ?? "Uncategorized";
|
|
80
|
-
|
|
56
|
+
A[t] = (A[t] || 0) + 1;
|
|
81
57
|
}
|
|
82
|
-
let
|
|
58
|
+
let j = /* @__PURE__ */ new Date(), M = T.filter((e) => e.endDate && new Date(e.endDate) < j && !w(e)), N = T.filter((e) => !w(e)), P = N.length > 0 ? Math.round(N.filter((e) => !M.includes(e) && e.status !== "AT_RISK" && e.status !== "DELAYED").length / N.length * 100) : null, F = {};
|
|
83
59
|
for (let e of T) if (e.endDate) {
|
|
84
|
-
let t =
|
|
85
|
-
month: "short",
|
|
86
|
-
year: "2-digit"
|
|
87
|
-
});
|
|
60
|
+
let t = e.endDate.slice(0, 7);
|
|
88
61
|
F[t] || (F[t] = {
|
|
89
62
|
planned: 0,
|
|
90
63
|
completed: 0
|
|
91
|
-
}), F[t].planned += 1, (e
|
|
64
|
+
}), F[t].planned += 1, w(e) && (F[t].completed += 1);
|
|
92
65
|
}
|
|
93
|
-
let I = Object.entries(F).map(([e, t]) => ({
|
|
94
|
-
month: e,
|
|
66
|
+
let I = Object.entries(F).sort(([e], [t]) => e.localeCompare(t)).slice(-6).map(([e, t]) => ({
|
|
67
|
+
month: (/* @__PURE__ */ new Date(`${e}-01T00:00:00Z`)).toLocaleDateString("en-US", {
|
|
68
|
+
month: "short",
|
|
69
|
+
year: "2-digit",
|
|
70
|
+
timeZone: "UTC"
|
|
71
|
+
}),
|
|
95
72
|
...t
|
|
96
|
-
}))
|
|
73
|
+
})), L = Math.max(...I.map((e) => Math.max(e.planned, e.completed)), 1);
|
|
97
74
|
return /* @__PURE__ */ f("div", {
|
|
98
75
|
className: "space-y-6 p-6",
|
|
99
76
|
children: [
|
|
@@ -103,9 +80,9 @@ function y() {
|
|
|
103
80
|
}), /* @__PURE__ */ f("p", {
|
|
104
81
|
className: "text-sm text-muted-foreground",
|
|
105
82
|
children: [
|
|
106
|
-
|
|
83
|
+
S.name,
|
|
107
84
|
" - ",
|
|
108
|
-
t(
|
|
85
|
+
t(S.planningFocus)
|
|
109
86
|
]
|
|
110
87
|
})] }),
|
|
111
88
|
/* @__PURE__ */ f("div", {
|
|
@@ -116,17 +93,17 @@ function y() {
|
|
|
116
93
|
children: [
|
|
117
94
|
/* @__PURE__ */ f("div", {
|
|
118
95
|
className: "flex items-center gap-2 text-muted-foreground text-xs",
|
|
119
|
-
children: [/* @__PURE__ */ d(o, { className: "h-4 w-4" }), "
|
|
96
|
+
children: [/* @__PURE__ */ d(o, { className: "h-4 w-4" }), "Open items on track"]
|
|
120
97
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ d("p", {
|
|
122
99
|
className: "text-2xl font-bold mt-1",
|
|
123
|
-
children:
|
|
100
|
+
children: P === null ? "—" : `${P}%`
|
|
124
101
|
}),
|
|
125
102
|
/* @__PURE__ */ d("div", {
|
|
126
103
|
className: "w-full h-2 rounded-full bg-muted mt-2 overflow-hidden",
|
|
127
104
|
children: /* @__PURE__ */ d("div", {
|
|
128
|
-
className: "h-full rounded-full bg-
|
|
129
|
-
style: { width: `${P}%` }
|
|
105
|
+
className: "h-full rounded-full bg-success",
|
|
106
|
+
style: { width: `${P ?? 0}%` }
|
|
130
107
|
})
|
|
131
108
|
})
|
|
132
109
|
]
|
|
@@ -140,11 +117,11 @@ function y() {
|
|
|
140
117
|
}),
|
|
141
118
|
/* @__PURE__ */ f("p", {
|
|
142
119
|
className: "text-2xl font-bold mt-1",
|
|
143
|
-
children: [
|
|
120
|
+
children: [D, "%"]
|
|
144
121
|
}),
|
|
145
122
|
/* @__PURE__ */ f("p", {
|
|
146
123
|
className: "text-xs text-muted-foreground mt-1",
|
|
147
|
-
children: [
|
|
124
|
+
children: [C.length, " items total"]
|
|
148
125
|
})
|
|
149
126
|
]
|
|
150
127
|
}) }),
|
|
@@ -157,7 +134,7 @@ function y() {
|
|
|
157
134
|
}),
|
|
158
135
|
/* @__PURE__ */ d("p", {
|
|
159
136
|
className: "text-2xl font-bold mt-1",
|
|
160
|
-
children:
|
|
137
|
+
children: E.length
|
|
161
138
|
}),
|
|
162
139
|
/* @__PURE__ */ d("p", {
|
|
163
140
|
className: "text-xs text-muted-foreground mt-1",
|
|
@@ -174,7 +151,7 @@ function y() {
|
|
|
174
151
|
}),
|
|
175
152
|
/* @__PURE__ */ d("p", {
|
|
176
153
|
className: "text-2xl font-bold mt-1",
|
|
177
|
-
children:
|
|
154
|
+
children: M.length
|
|
178
155
|
}),
|
|
179
156
|
/* @__PURE__ */ d("p", {
|
|
180
157
|
className: "text-xs text-muted-foreground mt-1",
|
|
@@ -223,8 +200,8 @@ function y() {
|
|
|
223
200
|
})]
|
|
224
201
|
})] })] }), /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ d(g, { children: "Item Status Breakdown" }) }), /* @__PURE__ */ d(m, {
|
|
225
202
|
className: "space-y-3",
|
|
226
|
-
children: Object.entries(
|
|
227
|
-
let n =
|
|
203
|
+
children: Object.entries(O).map(([e, t]) => {
|
|
204
|
+
let n = C.length, r = n > 0 ? Math.round(t / n * 100) : 0;
|
|
228
205
|
return /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
|
|
229
206
|
className: "flex justify-between text-sm mb-1",
|
|
230
207
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -258,13 +235,13 @@ function y() {
|
|
|
258
235
|
}),
|
|
259
236
|
/* @__PURE__ */ f("div", {
|
|
260
237
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
261
|
-
children: [/* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ d(g, { children: "Feature
|
|
238
|
+
children: [/* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ d(g, { children: "Feature request status (workspace)" }) }), /* @__PURE__ */ d(m, {
|
|
262
239
|
className: "space-y-3",
|
|
263
|
-
children: Object.entries(
|
|
240
|
+
children: Object.entries(k).length === 0 ? /* @__PURE__ */ d("p", {
|
|
264
241
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
265
242
|
children: "No feature request data"
|
|
266
|
-
}) : Object.entries(
|
|
267
|
-
let n =
|
|
243
|
+
}) : Object.entries(k).map(([e, t]) => {
|
|
244
|
+
let n = x?.all ?? 0, r = n > 0 ? Math.round(t / n * 100) : 0;
|
|
268
245
|
return /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
|
|
269
246
|
className: "flex justify-between text-sm mb-1",
|
|
270
247
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -296,11 +273,11 @@ function y() {
|
|
|
296
273
|
})
|
|
297
274
|
})] }), /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ d(g, { children: "Swimlane Distribution" }) }), /* @__PURE__ */ d(m, {
|
|
298
275
|
className: "space-y-3",
|
|
299
|
-
children: Object.entries(
|
|
276
|
+
children: Object.entries(A).length === 0 ? /* @__PURE__ */ d("p", {
|
|
300
277
|
className: "text-sm text-muted-foreground text-center py-4",
|
|
301
278
|
children: "No swimlane data"
|
|
302
|
-
}) : Object.entries(
|
|
303
|
-
let n =
|
|
279
|
+
}) : Object.entries(A).map(([e, t]) => {
|
|
280
|
+
let n = C.length, r = n > 0 ? Math.round(t / n * 100) : 0;
|
|
304
281
|
return /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
|
|
305
282
|
className: "flex justify-between text-sm mb-1",
|
|
306
283
|
children: [/* @__PURE__ */ d("span", { children: e }), /* @__PURE__ */ f("span", {
|
|
@@ -322,9 +299,9 @@ function y() {
|
|
|
322
299
|
})
|
|
323
300
|
})] })]
|
|
324
301
|
}),
|
|
325
|
-
|
|
302
|
+
M.length > 0 && /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ d(h, { children: /* @__PURE__ */ d(g, { children: "Overdue Items" }) }), /* @__PURE__ */ d(m, { children: /* @__PURE__ */ d("div", {
|
|
326
303
|
className: "space-y-3",
|
|
327
|
-
children:
|
|
304
|
+
children: M.map((e) => /* @__PURE__ */ f("div", {
|
|
328
305
|
className: "flex items-center justify-between border rounded-md p-3",
|
|
329
306
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("p", {
|
|
330
307
|
className: "text-sm font-medium",
|
|
@@ -342,6 +319,6 @@ function y() {
|
|
|
342
319
|
});
|
|
343
320
|
}
|
|
344
321
|
//#endregion
|
|
345
|
-
export {
|
|
322
|
+
export { v as ProductsRoadmapAnalyticsPagePage };
|
|
346
323
|
|
|
347
324
|
//# sourceMappingURL=ProductsRoadmapAnalyticsPagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsRoadmapAnalyticsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { TrendingUp, Target, CheckCircle, AlertTriangle, BarChart3, Loader2 } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { useParams } from 'react-router';\nimport { planningFocusLabel } from '../roadmaps/planningFocus';\n\nconst GET_ROADMAP_ANALYTICS = gql`\n query GetRoadmapAnalytics($id: ID!) {\n planmagnetRoadmap(id: $id) {\n id\n name\n description\n type\n planningFocus\n isPublic\n ownerId\n createdAt\n updatedAt\n items {\n id\n title\n status\n startDate\n endDate\n swimlane\n }\n }\n }\n`;\n\nconst LIST_FEATURE_REQUESTS_FOR_ANALYTICS = gql`\n query ListFeatureRequestsForRoadmapAnalytics(\n $workspaceId: ID!\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetFeatureRequests(workspaceId: $workspaceId, pagination: $pagination) {\n items {\n id\n status\n voteCount\n businessValue\n priorityScore\n }\n totalCount\n }\n }\n`;\n\ninterface RoadmapItemNode {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n swimlane: string | null;\n}\n\nexport function ProductsRoadmapAnalyticsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const params = useParams<{ id: string }>();\n const roadmapId = params.id ?? '';\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_ROADMAP_ANALYTICS, {\n variables: { id: roadmapId },\n skip: !roadmapId,\n });\n\n const {\n data: featuresData,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_FEATURE_REQUESTS_FOR_ANALYTICS, {\n variables: { workspaceId, pagination: { first: 100 } },\n skip: !workspaceId,\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load analytics: {error.message}</div>;\n }\n\n const roadmap = data?.planmagnetRoadmap;\n if (!roadmap) return <div className=\"p-6 text-muted-foreground\">Roadmap not found.</div>;\n\n const items: RoadmapItemNode[] = roadmap.items ?? [];\n const allFeatures = featuresData?.planmagnetFeatureRequests?.items ?? [];\n\n const completedItems = items.filter((i) => i.status === 'COMPLETED' || i.status === 'DONE');\n const progress = items.length > 0 ? Math.round((completedItems.length / items.length) * 100) : 0;\n\n // Items by status\n const itemsByStatus: Record<string, number> = {};\n for (const item of items) {\n itemsByStatus[item.status] = (itemsByStatus[item.status] || 0) + 1;\n }\n\n // Feature status distribution\n const featuresByStatus: Record<string, number> = {};\n for (const f of allFeatures) {\n featuresByStatus[f.status] = (featuresByStatus[f.status] || 0) + 1;\n }\n\n // Items by swimlane\n const itemsBySwimlane: Record<string, number> = {};\n for (const item of items) {\n const lane = item.swimlane ?? 'Uncategorized';\n itemsBySwimlane[lane] = (itemsBySwimlane[lane] || 0) + 1;\n }\n\n // Items with overdue end dates\n const now = new Date();\n const overdueItems = items.filter(\n (i) => i.endDate && new Date(i.endDate) < now && i.status !== 'COMPLETED' && i.status !== 'DONE'\n );\n\n // Health score based on progress and overdue items\n const healthScore = Math.max(\n 0,\n Math.round(progress * 0.7 + (1 - overdueItems.length / Math.max(items.length, 1)) * 30)\n );\n\n // Monthly velocity (items completed by month based on endDate)\n const velocityMap: Record<string, { planned: number; completed: number }> = {};\n for (const item of items) {\n if (item.endDate) {\n const month = new Date(item.endDate).toLocaleDateString('en-US', {\n month: 'short',\n year: '2-digit',\n });\n if (!velocityMap[month]) velocityMap[month] = { planned: 0, completed: 0 };\n velocityMap[month].planned += 1;\n if (item.status === 'COMPLETED' || item.status === 'DONE') {\n velocityMap[month].completed += 1;\n }\n }\n }\n const velocityData = Object.entries(velocityMap)\n .map(([month, vals]) => ({ month, ...vals }))\n .slice(-6);\n const maxVal = Math.max(...velocityData.map((d) => Math.max(d.planned, d.completed)), 1);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Roadmap Analytics</h1>\n <p className=\"text-sm text-muted-foreground\">\n {roadmap.name} - {planningFocusLabel(roadmap.planningFocus)}\n </p>\n </div>\n\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <Target className=\"h-4 w-4\" />\n Health Score\n </div>\n <p className=\"text-2xl font-bold mt-1\">{healthScore}/100</p>\n <div className=\"w-full h-2 rounded-full bg-muted mt-2 overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-green-500\"\n style={{ width: `${healthScore}%` }}\n />\n </div>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <TrendingUp className=\"h-4 w-4\" />\n Progress\n </div>\n <p className=\"text-2xl font-bold mt-1\">{progress}%</p>\n <p className=\"text-xs text-muted-foreground mt-1\">{items.length} items total</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <CheckCircle className=\"h-4 w-4\" />\n Completed\n </div>\n <p className=\"text-2xl font-bold mt-1\">{completedItems.length}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">items completed</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <AlertTriangle className=\"h-4 w-4\" />\n Overdue\n </div>\n <p className=\"text-2xl font-bold mt-1\">{overdueItems.length}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">items past end date</p>\n </CardContent>\n </Card>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <BarChart3 className=\"h-4 w-4\" />\n Item Velocity\n </CardTitle>\n </CardHeader>\n <CardContent>\n {velocityData.length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-8\">\n No timeline data available\n </p>\n ) : (\n <div className=\"flex items-end gap-2 h-48\">\n {velocityData.map((d) => (\n <div key={d.month} className=\"flex-1 flex flex-col items-center gap-1\">\n <div className=\"flex gap-0.5 items-end w-full justify-center h-40\">\n <div\n className=\"w-3 bg-primary/30 rounded-t\"\n style={{ height: `${(d.planned / maxVal) * 100}%` }}\n title={`Planned: ${d.planned}`}\n />\n <div\n className=\"w-3 bg-primary rounded-t\"\n style={{ height: `${(d.completed / maxVal) * 100}%` }}\n title={`Completed: ${d.completed}`}\n />\n </div>\n <span className=\"text-xs text-muted-foreground\">{d.month}</span>\n </div>\n ))}\n </div>\n )}\n <div className=\"flex gap-4 justify-center mt-3 text-xs\">\n <span className=\"flex items-center gap-1\">\n <span className=\"h-2 w-2 rounded bg-primary/30\" />\n Planned\n </span>\n <span className=\"flex items-center gap-1\">\n <span className=\"h-2 w-2 rounded bg-primary\" />\n Completed\n </span>\n </div>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Item Status Breakdown</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(itemsByStatus).map(([status, count]) => {\n const total = items.length;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const colors: Record<string, string> = {\n TODO: 'bg-gray-400',\n PLANNED: 'bg-yellow-400',\n IN_PROGRESS: 'bg-blue-400',\n BLOCKED: 'bg-red-400',\n DONE: 'bg-green-400',\n COMPLETED: 'bg-green-400',\n };\n return (\n <div key={status}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span className=\"capitalize\">{status.toLowerCase().replace('_', ' ')}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className={`h-full rounded-full ${colors[status] ?? 'bg-gray-300'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })}\n </CardContent>\n </Card>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <Card>\n <CardHeader>\n <CardTitle>Feature Request Status</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(featuresByStatus).length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-4\">\n No feature request data\n </p>\n ) : (\n Object.entries(featuresByStatus).map(([status, count]) => {\n const total = allFeatures.length;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const colors: Record<string, string> = {\n SUBMITTED: 'bg-gray-400',\n UNDER_REVIEW: 'bg-yellow-400',\n PLANNED: 'bg-blue-400',\n IN_PROGRESS: 'bg-purple-400',\n COMPLETED: 'bg-green-400',\n DECLINED: 'bg-red-400',\n };\n return (\n <div key={status}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span className=\"capitalize\">{status.toLowerCase().replace('_', ' ')}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className={`h-full rounded-full ${colors[status] ?? 'bg-gray-300'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })\n )}\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Swimlane Distribution</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(itemsBySwimlane).length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-4\">No swimlane data</p>\n ) : (\n Object.entries(itemsBySwimlane).map(([lane, count]) => {\n const total = items.length;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n return (\n <div key={lane}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span>{lane}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-primary\"\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })\n )}\n </CardContent>\n </Card>\n </div>\n\n {overdueItems.length > 0 && (\n <Card>\n <CardHeader>\n <CardTitle>Overdue Items</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-3\">\n {overdueItems.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center justify-between border rounded-md p-3\"\n >\n <div>\n <p className=\"text-sm font-medium\">{item.title}</p>\n <p className=\"text-xs text-muted-foreground\">\n Due: {item.endDate ? new Date(item.endDate).toLocaleDateString() : 'N/A'}\n </p>\n </div>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-red-100 text-red-800 capitalize\">\n {item.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;;;GAwB3B,IAAsC,CAAG;;;;;;;;;;;;;;;;;AA2B/C,SAAgB,IAAmC;CACjD,IAAM,EAAE,mBAAgB,GAAe,EAEjC,IADS,GAA2B,CACjB,MAAM,IAEzB,EACJ,SACA,YACA,aAGA,EAA8B,GAAuB;EACnD,WAAW,EAAE,IAAI,GAAW;EAC5B,MAAM,CAAC;EACR,CAAC,EAEE,EACJ,MAAM,MAGN,EAA8B,GAAqC;EACjE,WAAW;GAAE;GAAa,YAAY,EAAE,OAAO,KAAK;GAAE;EACtD,MAAM,CAAC;EACR,CAAC;AAMJ,KAAI,KAAW,CAAC,EACd,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,8CAA+C,CAAA;EA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,IAAI,KAAK,MAAO,IAAQ,IAAS,IAAI,GAAG;AAC5D,aACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD,EAAA,UAAO,GAAY,CAAA,EACnB,kBAAC,QAAD;QAAM,WAAU;kBAAhB;SACG;SAAM;SAAG;SAAI;SACT;UACH;UACN,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,OAAD;QACE,WAAU;QACV,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;QAC3B,CAAA;OACE,CAAA,CACF,EAAA,EAbI,EAaJ;OAER;KAEQ,CAAA,CACT,EAAA,CAAA,CACH;;GAEL,EAAa,SAAS,KACrB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,iBAAyB,CAAA,EACzB,CAAA,EACb,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAa,KAAK,MACjB,kBAAC,OAAD;KAEE,WAAU;eAFZ,CAIE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAuB,EAAK;MAAU,CAAA,EACnD,kBAAC,KAAD;MAAG,WAAU;gBAAb,CAA6C,SACrC,EAAK,UAAU,IAAI,KAAK,EAAK,QAAQ,CAAC,oBAAoB,GAAG,MACjE;QACA,EAAA,CAAA,EACN,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAK,OAAO,aAAa,CAAC,QAAQ,KAAK,IAAI;MACvC,CAAA,CACH;OAZC,EAAK,GAYN,CACN;IACE,CAAA,EACM,CAAA,CACT,EAAA,CAAA;GAEL"}
|
|
1
|
+
{"version":3,"file":"ProductsRoadmapAnalyticsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { TrendingUp, Target, CheckCircle, AlertTriangle, BarChart3, Loader2 } from 'lucide-react';\nimport { useParams } from 'react-router';\nimport { useFeatureCounts } from '../hooks/useCounts';\nimport { planningFocusLabel } from '../roadmaps/planningFocus';\n\nconst GET_ROADMAP_ANALYTICS = gql`\n query GetRoadmapAnalytics($id: ID!) {\n planmagnetRoadmap(id: $id) {\n id\n name\n description\n type\n planningFocus\n isPublic\n ownerId\n createdAt\n updatedAt\n items {\n id\n title\n status\n startDate\n endDate\n swimlane\n }\n }\n }\n`;\n\ninterface RoadmapItemNode {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n swimlane: string | null;\n}\n\nexport function ProductsRoadmapAnalyticsPagePage() {\n const params = useParams<{ id: string }>();\n const roadmapId = params.id ?? '';\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_ROADMAP_ANALYTICS, {\n variables: { id: roadmapId },\n skip: !roadmapId,\n });\n\n const featureCounts = useFeatureCounts();\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load analytics: {error.message}</div>;\n }\n\n const roadmap = data?.planmagnetRoadmap;\n if (!roadmap) return <div className=\"p-6 text-muted-foreground\">Roadmap not found.</div>;\n\n const items: RoadmapItemNode[] = roadmap.items ?? [];\n\n // BOFF-7994: cancelled items no longer need doing — out of the progress denominator and out of \"overdue\".\n const isDone = (i: RoadmapItemNode) => i.status === 'COMPLETED' || i.status === 'DONE';\n const liveItems = items.filter((i) => i.status !== 'CANCELLED');\n const completedItems = liveItems.filter(isDone);\n const progress =\n liveItems.length > 0 ? Math.round((completedItems.length / liveItems.length) * 100) : 0;\n\n // Items by status\n const itemsByStatus: Record<string, number> = {};\n for (const item of items) {\n itemsByStatus[item.status] = (itemsByStatus[item.status] || 0) + 1;\n }\n\n // Feature request status across the WORKSPACE, from server counts (it was the 100 newest, counted in the browser).\n const featuresByStatus: Record<string, number> = featureCounts\n ? Object.fromEntries(Object.entries(featureCounts.byStatus).filter(([, n]) => n > 0))\n : {};\n\n // Items by swimlane\n const itemsBySwimlane: Record<string, number> = {};\n for (const item of items) {\n const lane = item.swimlane ?? 'Uncategorized';\n itemsBySwimlane[lane] = (itemsBySwimlane[lane] || 0) + 1;\n }\n\n // Items with overdue end dates\n const now = new Date();\n const overdueItems = liveItems.filter(\n (i) => i.endDate && new Date(i.endDate) < now && !isDone(i)\n );\n\n // \"On track\" replaces an undefined health score (0.7 x progress + 30 x not-overdue share, so an empty roadmap\n // scored 30/100): the share of OPEN items that are neither overdue nor flagged at risk or delayed.\n const openItems = liveItems.filter((i) => !isDone(i));\n const onTrack =\n openItems.length > 0\n ? Math.round(\n (openItems.filter(\n (i) => !overdueItems.includes(i) && i.status !== 'AT_RISK' && i.status !== 'DELAYED'\n ).length /\n openItems.length) *\n 100\n )\n : null;\n\n // Items due per month, keyed by YYYY-MM and sorted by DATE, the latest six kept (they were in storage order,\n // and the last six inserted were kept — out of order, recent months dropped).\n const velocityMap: Record<string, { planned: number; completed: number }> = {};\n for (const item of liveItems) {\n if (item.endDate) {\n const key = item.endDate.slice(0, 7);\n if (!velocityMap[key]) velocityMap[key] = { planned: 0, completed: 0 };\n velocityMap[key].planned += 1;\n if (isDone(item)) velocityMap[key].completed += 1;\n }\n }\n const velocityData = Object.entries(velocityMap)\n .sort(([a], [b]) => a.localeCompare(b))\n .slice(-6)\n .map(([key, vals]) => ({\n month: new Date(`${key}-01T00:00:00Z`).toLocaleDateString('en-US', {\n month: 'short',\n year: '2-digit',\n timeZone: 'UTC',\n }),\n ...vals,\n }));\n const maxVal = Math.max(...velocityData.map((d) => Math.max(d.planned, d.completed)), 1);\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Roadmap Analytics</h1>\n <p className=\"text-sm text-muted-foreground\">\n {roadmap.name} - {planningFocusLabel(roadmap.planningFocus)}\n </p>\n </div>\n\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <Target className=\"h-4 w-4\" />\n Open items on track\n </div>\n <p className=\"text-2xl font-bold mt-1\">{onTrack === null ? '—' : `${onTrack}%`}</p>\n <div className=\"w-full h-2 rounded-full bg-muted mt-2 overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-success\"\n style={{ width: `${onTrack ?? 0}%` }}\n />\n </div>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <TrendingUp className=\"h-4 w-4\" />\n Progress\n </div>\n <p className=\"text-2xl font-bold mt-1\">{progress}%</p>\n <p className=\"text-xs text-muted-foreground mt-1\">{items.length} items total</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <CheckCircle className=\"h-4 w-4\" />\n Completed\n </div>\n <p className=\"text-2xl font-bold mt-1\">{completedItems.length}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">items completed</p>\n </CardContent>\n </Card>\n <Card>\n <CardContent className=\"pt-4\">\n <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n <AlertTriangle className=\"h-4 w-4\" />\n Overdue\n </div>\n <p className=\"text-2xl font-bold mt-1\">{overdueItems.length}</p>\n <p className=\"text-xs text-muted-foreground mt-1\">items past end date</p>\n </CardContent>\n </Card>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <BarChart3 className=\"h-4 w-4\" />\n Item Velocity\n </CardTitle>\n </CardHeader>\n <CardContent>\n {velocityData.length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-8\">\n No timeline data available\n </p>\n ) : (\n <div className=\"flex items-end gap-2 h-48\">\n {velocityData.map((d) => (\n <div key={d.month} className=\"flex-1 flex flex-col items-center gap-1\">\n <div className=\"flex gap-0.5 items-end w-full justify-center h-40\">\n <div\n className=\"w-3 bg-primary/30 rounded-t\"\n style={{ height: `${(d.planned / maxVal) * 100}%` }}\n title={`Planned: ${d.planned}`}\n />\n <div\n className=\"w-3 bg-primary rounded-t\"\n style={{ height: `${(d.completed / maxVal) * 100}%` }}\n title={`Completed: ${d.completed}`}\n />\n </div>\n <span className=\"text-xs text-muted-foreground\">{d.month}</span>\n </div>\n ))}\n </div>\n )}\n <div className=\"flex gap-4 justify-center mt-3 text-xs\">\n <span className=\"flex items-center gap-1\">\n <span className=\"h-2 w-2 rounded bg-primary/30\" />\n Planned\n </span>\n <span className=\"flex items-center gap-1\">\n <span className=\"h-2 w-2 rounded bg-primary\" />\n Completed\n </span>\n </div>\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Item Status Breakdown</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(itemsByStatus).map(([status, count]) => {\n const total = items.length;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const colors: Record<string, string> = {\n TODO: 'bg-gray-400',\n PLANNED: 'bg-yellow-400',\n IN_PROGRESS: 'bg-blue-400',\n BLOCKED: 'bg-red-400',\n DONE: 'bg-green-400',\n COMPLETED: 'bg-green-400',\n };\n return (\n <div key={status}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span className=\"capitalize\">{status.toLowerCase().replace('_', ' ')}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className={`h-full rounded-full ${colors[status] ?? 'bg-gray-300'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })}\n </CardContent>\n </Card>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <Card>\n <CardHeader>\n <CardTitle>Feature request status (workspace)</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(featuresByStatus).length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-4\">\n No feature request data\n </p>\n ) : (\n Object.entries(featuresByStatus).map(([status, count]) => {\n const total = featureCounts?.all ?? 0;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n const colors: Record<string, string> = {\n SUBMITTED: 'bg-gray-400',\n UNDER_REVIEW: 'bg-yellow-400',\n PLANNED: 'bg-blue-400',\n IN_PROGRESS: 'bg-purple-400',\n COMPLETED: 'bg-green-400',\n DECLINED: 'bg-red-400',\n };\n return (\n <div key={status}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span className=\"capitalize\">{status.toLowerCase().replace('_', ' ')}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className={`h-full rounded-full ${colors[status] ?? 'bg-gray-300'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })\n )}\n </CardContent>\n </Card>\n\n <Card>\n <CardHeader>\n <CardTitle>Swimlane Distribution</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {Object.entries(itemsBySwimlane).length === 0 ? (\n <p className=\"text-sm text-muted-foreground text-center py-4\">No swimlane data</p>\n ) : (\n Object.entries(itemsBySwimlane).map(([lane, count]) => {\n const total = items.length;\n const pct = total > 0 ? Math.round((count / total) * 100) : 0;\n return (\n <div key={lane}>\n <div className=\"flex justify-between text-sm mb-1\">\n <span>{lane}</span>\n <span className=\"font-medium\">\n {count} ({pct}%)\n </span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-primary\"\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })\n )}\n </CardContent>\n </Card>\n </div>\n\n {overdueItems.length > 0 && (\n <Card>\n <CardHeader>\n <CardTitle>Overdue Items</CardTitle>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-3\">\n {overdueItems.map((item) => (\n <div\n key={item.id}\n className=\"flex items-center justify-between border rounded-md p-3\"\n >\n <div>\n <p className=\"text-sm font-medium\">{item.title}</p>\n <p className=\"text-xs text-muted-foreground\">\n Due: {item.endDate ? new Date(item.endDate).toLocaleDateString() : 'N/A'}\n </p>\n </div>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-red-100 text-red-800 capitalize\">\n {item.status.toLowerCase().replace('_', ' ')}\n </span>\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;;;;AAiCjC,SAAgB,IAAmC;CAEjD,IAAM,IADS,GAA2B,CACjB,MAAM,IAEzB,EACJ,SACA,YACA,aAGA,EAA8B,GAAuB;EACnD,WAAW,EAAE,IAAI,GAAW;EAC5B,MAAM,CAAC;EACR,CAAC,EAEE,IAAgB,GAAkB;AAMxC,KAAI,KAAW,CAAC,EACd,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,8CAA+C,CAAA;EAC9D,CAAA;AAIV,KAAI,EACF,QAAO,kBAAC,OAAD;EAAK,WAAU;YAAf,CAAsC,8BAA2B,EAAM,QAAc;;CAG9F,IAAM,IAAU,GAAM;AACtB,KAAI,CAAC,EAAS,QAAO,kBAAC,OAAD;EAAK,WAAU;YAA4B;EAAwB,CAAA;CAExF,IAAM,IAA2B,EAAQ,SAAS,EAAE,EAG9C,KAAU,MAAuB,EAAE,WAAW,eA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Q,IAAS,IAAI,GAAG;AAC5D,aACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD,EAAA,UAAO,GAAY,CAAA,EACnB,kBAAC,QAAD;QAAM,WAAU;kBAAhB;SACG;SAAM;SAAG;SAAI;SACT;UACH;UACN,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,OAAD;QACE,WAAU;QACV,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;QAC3B,CAAA;OACE,CAAA,CACF,EAAA,EAbI,EAaJ;OAER;KAEQ,CAAA,CACT,EAAA,CAAA,CACH;;GAEL,EAAa,SAAS,KACrB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,iBAAyB,CAAA,EACzB,CAAA,EACb,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAa,KAAK,MACjB,kBAAC,OAAD;KAEE,WAAU;eAFZ,CAIE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;MAAG,WAAU;gBAAuB,EAAK;MAAU,CAAA,EACnD,kBAAC,KAAD;MAAG,WAAU;gBAAb,CAA6C,SACrC,EAAK,UAAU,IAAI,KAAK,EAAK,QAAQ,CAAC,oBAAoB,GAAG,MACjE;QACA,EAAA,CAAA,EACN,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAK,OAAO,aAAa,CAAC,QAAQ,KAAK,IAAI;MACvC,CAAA,CACH;OAZC,EAAK,GAYN,CACN;IACE,CAAA,EACM,CAAA,CACT,EAAA,CAAA;GAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsRoadmapsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsRoadmapsPagePage.tsx"],"names":[],"mappings":"AAoEA,wBAAgB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"ProductsRoadmapsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsRoadmapsPagePage.tsx"],"names":[],"mappings":"AAoEA,wBAAgB,wBAAwB,4CAqLvC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
3
|
+
import { detailPath as r, rowLinkProps as i } from "../utils/rowNavigation.js";
|
|
4
|
+
import { PLANNING_FOCUSES as a, PlanningFocusBadge as o, planningFocusLabel as s } from "../roadmaps/planningFocus.js";
|
|
5
5
|
import { useState as c } from "react";
|
|
6
6
|
import { Calendar as l, Filter as u, Loader2 as d, Map as f, Plus as p } from "lucide-react";
|
|
7
7
|
import { gql as m } from "@apollo/client";
|
|
@@ -43,7 +43,11 @@ function T() {
|
|
|
43
43
|
let m = t(), { workspaceId: T } = e(), [E, D] = c("all"), [O, k] = c("all"), { data: A, loading: j, error: M } = h(w, {
|
|
44
44
|
variables: {
|
|
45
45
|
workspaceId: T,
|
|
46
|
-
pagination: { first: 50 }
|
|
46
|
+
pagination: { first: 50 },
|
|
47
|
+
filter: {
|
|
48
|
+
...E === "none" ? { hasPlanningFocus: !1 } : E === "all" ? {} : { planningFocus: E },
|
|
49
|
+
...O === "all" ? {} : { isPublic: O === "public" }
|
|
50
|
+
}
|
|
47
51
|
},
|
|
48
52
|
skip: !T
|
|
49
53
|
});
|
|
@@ -57,13 +61,13 @@ function T() {
|
|
|
57
61
|
});
|
|
58
62
|
let N = A?.planmagnetRoadmaps?.items ?? [], P = A?.planmagnetRoadmaps?.totalCount ?? 0, F = [
|
|
59
63
|
"all",
|
|
60
|
-
...
|
|
64
|
+
...a,
|
|
61
65
|
"none"
|
|
62
66
|
], I = [
|
|
63
67
|
"all",
|
|
64
68
|
"public",
|
|
65
69
|
"private"
|
|
66
|
-
], L = N
|
|
70
|
+
], L = N;
|
|
67
71
|
return /* @__PURE__ */ _("div", {
|
|
68
72
|
className: "space-y-6 p-6",
|
|
69
73
|
children: [
|
|
@@ -72,9 +76,9 @@ function T() {
|
|
|
72
76
|
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
|
|
73
77
|
className: "text-2xl font-semibold",
|
|
74
78
|
children: "Roadmaps"
|
|
75
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ g("p", {
|
|
76
80
|
className: "text-sm text-muted-foreground",
|
|
77
|
-
children:
|
|
81
|
+
children: E !== "all" || O !== "all" ? `${P} match` : `${P} roadmaps across all products`
|
|
78
82
|
})] }), /* @__PURE__ */ _(y, {
|
|
79
83
|
size: "sm",
|
|
80
84
|
onClick: () => m("/products/create-roadmap-page"),
|
|
@@ -96,7 +100,7 @@ function T() {
|
|
|
96
100
|
"aria-pressed": E === e,
|
|
97
101
|
onClick: () => D(e),
|
|
98
102
|
className: `px-2 py-1 text-xs rounded-md ${E === e ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`,
|
|
99
|
-
children: e === "all" ? "All" : e === "none" ? "Not set" :
|
|
103
|
+
children: e === "all" ? "All" : e === "none" ? "Not set" : s(e)
|
|
100
104
|
}, e))
|
|
101
105
|
]
|
|
102
106
|
}), /* @__PURE__ */ _("div", {
|
|
@@ -114,9 +118,9 @@ function T() {
|
|
|
114
118
|
/* @__PURE__ */ g("div", {
|
|
115
119
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
116
120
|
children: L.map((e) => {
|
|
117
|
-
let t = e.items?.length ?? 0,
|
|
121
|
+
let t = e.items?.length ?? 0, a = e.items?.filter((e) => e.status === "COMPLETED" || e.status === "DONE").length ?? 0, s = t > 0 ? Math.round(a / t * 100) : 0, c = e.items?.map((e) => e.startDate).filter(Boolean) ?? [], u = e.items?.map((e) => e.endDate).filter(Boolean) ?? [], d = c.length > 0 ? c.sort()[0] : null, p = u.length > 0 ? u.sort().reverse()[0] : null;
|
|
118
122
|
return /* @__PURE__ */ _(b, {
|
|
119
|
-
...
|
|
123
|
+
...i(() => m(r("/products/roadmap-detail-page", e.id)), e.name),
|
|
120
124
|
children: [/* @__PURE__ */ g(S, {
|
|
121
125
|
className: "pb-2",
|
|
122
126
|
children: /* @__PURE__ */ _("div", {
|
|
@@ -139,7 +143,7 @@ function T() {
|
|
|
139
143
|
}),
|
|
140
144
|
/* @__PURE__ */ _("div", {
|
|
141
145
|
className: "flex items-center gap-2",
|
|
142
|
-
children: [/* @__PURE__ */ g(
|
|
146
|
+
children: [/* @__PURE__ */ g(o, { focus: e.planningFocus }), /* @__PURE__ */ g(v, {
|
|
143
147
|
variant: "outline",
|
|
144
148
|
className: "text-xs capitalize",
|
|
145
149
|
children: e.isPublic ? "public" : "private"
|
|
@@ -152,13 +156,13 @@ function T() {
|
|
|
152
156
|
children: "Progress"
|
|
153
157
|
}), /* @__PURE__ */ _("span", {
|
|
154
158
|
className: "font-medium",
|
|
155
|
-
children: [
|
|
159
|
+
children: [s, "%"]
|
|
156
160
|
})]
|
|
157
161
|
}), /* @__PURE__ */ g("div", {
|
|
158
162
|
className: "w-full h-2 rounded-full bg-muted overflow-hidden",
|
|
159
163
|
children: /* @__PURE__ */ g("div", {
|
|
160
164
|
className: "h-full bg-primary rounded-full",
|
|
161
|
-
style: { width: `${
|
|
165
|
+
style: { width: `${s}%` }
|
|
162
166
|
})
|
|
163
167
|
})] }),
|
|
164
168
|
/* @__PURE__ */ g("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsRoadmapsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsRoadmapsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport { Map, Calendar, Plus, Filter, Loader2 } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\nimport {\n PLANNING_FOCUSES,\n PlanningFocusBadge,\n planningFocusLabel,\n} from '../roadmaps/planningFocus';\n\nconst LIST_ROADMAPS = gql`\n query ListRoadmapsPage(\n $workspaceId: ID!\n $filter: PlanmagnetRoadmapFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetRoadmaps(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n planningFocus\n isPublic\n ownerId\n createdAt\n updatedAt\n items {\n id\n title\n status\n startDate\n endDate\n }\n }\n totalCount\n }\n }\n`;\n\ninterface RoadmapItemNode {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface RoadmapNode {\n id: string;\n name: string;\n description: string | null;\n type: string;\n planningFocus: string | null;\n isPublic: boolean;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n items: RoadmapItemNode[];\n}\n\nexport function ProductsRoadmapsPagePage() {\n const navigate = usePlanMagnetNavigate();\n const { workspaceId } = usePlanMagnet();\n const [focusFilter, setFocusFilter] = useState<string>('all');\n const [visFilter, setVisFilter] = useState<string>('all');\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_ROADMAPS, {\n variables: {\n workspaceId,\n pagination: { first: 50 },\n },\n skip: !workspaceId,\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load roadmaps: {error.message}</div>;\n }\n\n const roadmaps: RoadmapNode[] = data?.planmagnetRoadmaps?.items ?? [];\n const totalCount = data?.planmagnetRoadmaps?.totalCount ?? 0;\n\n // Filter by what a roadmap is ABOUT. Every roadmap has the same display, so\n // filtering by it (the old \"Type: timeline\" chips) chose nothing (BOFF-7934).\n const focuses = ['all', ...PLANNING_FOCUSES, 'none'];\n const visibilities = ['all', 'public', 'private'];\n\n const filtered = roadmaps.filter(\n (r) =>\n (focusFilter === 'all' ||\n (focusFilter === 'none' ? !r.planningFocus : r.planningFocus === focusFilter)) &&\n (visFilter === 'all' ||\n (visFilter === 'public' && r.isPublic) ||\n (visFilter === 'private' && !r.isPublic))\n );\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Roadmaps</h1>\n <p className=\"text-sm text-muted-foreground\">{totalCount} roadmaps across all products</p>\n </div>\n <Button size=\"sm\" onClick={() => navigate('/products/create-roadmap-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Roadmap\n </Button>\n </div>\n\n <div className=\"flex gap-4 flex-wrap\">\n <div className=\"flex items-center gap-2\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-sm text-muted-foreground\">Focus:</span>\n {focuses.map((f) => (\n <button\n key={f}\n type=\"button\"\n aria-pressed={focusFilter === f}\n onClick={() => setFocusFilter(f)}\n className={`px-2 py-1 text-xs rounded-md ${focusFilter === f ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {f === 'all' ? 'All' : f === 'none' ? 'Not set' : planningFocusLabel(f)}\n </button>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-muted-foreground\">Visibility:</span>\n {visibilities.map((v) => (\n <button\n key={v}\n onClick={() => setVisFilter(v)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${visFilter === v ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {v}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {filtered.map((rm) => {\n const itemCount = rm.items?.length ?? 0;\n const completedItems =\n rm.items?.filter((i) => i.status === 'COMPLETED' || i.status === 'DONE').length ?? 0;\n const progress = itemCount > 0 ? Math.round((completedItems / itemCount) * 100) : 0;\n const startDates = rm.items?.map((i) => i.startDate).filter(Boolean) ?? [];\n const endDates = rm.items?.map((i) => i.endDate).filter(Boolean) ?? [];\n const earliestStart = startDates.length > 0 ? startDates.sort()[0] : null;\n const latestEnd = endDates.length > 0 ? endDates.sort().reverse()[0] : null;\n\n return (\n <Card\n key={rm.id}\n {...rowLinkProps(\n () => navigate(detailPath('/products/roadmap-detail-page', rm.id)),\n rm.name\n )}\n >\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{rm.name}</CardTitle>\n <Badge variant={rm.isPublic ? 'default' : 'secondary'} className=\"capitalize\">\n {rm.isPublic ? 'public' : 'private'}\n </Badge>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {rm.description ?? 'No description'}\n </p>\n <div className=\"flex items-center gap-2\">\n <PlanningFocusBadge focus={rm.planningFocus} />\n <Badge variant=\"outline\" className=\"text-xs capitalize\">\n {rm.isPublic ? 'public' : 'private'}\n </Badge>\n </div>\n <div>\n <div className=\"flex justify-between text-xs mb-1\">\n <span className=\"text-muted-foreground\">Progress</span>\n <span className=\"font-medium\">{progress}%</span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className=\"h-full bg-primary rounded-full\"\n style={{ width: `${progress}%` }}\n />\n </div>\n </div>\n <div className=\"flex gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n <Map className=\"h-3 w-3\" />\n {itemCount} items\n </span>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground border-t pt-2\">\n <span>\n Owner: <PersonName id={rm.ownerId} />\n </span>\n {earliestStart && latestEnd && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {new Date(earliestStart).toLocaleDateString()} -{' '}\n {new Date(latestEnd).toLocaleDateString()}\n </span>\n )}\n </div>\n </CardContent>\n </Card>\n );\n })}\n </div>\n {filtered.length === 0 && (\n <p className=\"text-center text-muted-foreground py-8\">\n No roadmaps match the selected filters.\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDzB,SAAgB,IAA2B;CACzC,IAAM,IAAW,GAAuB,EAClC,EAAE,mBAAgB,GAAe,EACjC,CAAC,GAAa,KAAkB,EAAiB,MAAM,EACvD,CAAC,GAAW,KAAgB,EAAiB,MAAM,EAEnD,EACJ,SACA,YACA,aAGA,EAA8B,GAAe;EAC3C,WAAW;GACT;GACA,YAAY,EAAE,OAAO,IAAI;GAC1B;EACD,MAAM,CAAC;EACR,CAAC;AAMJ,KAAI,KAAW,CAAC,EACd,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,8CAA+C,CAAA;EAC9D,CAAA;AAIV,KAAI,EACF,QAAO,kBAAC,OAAD;EAAK,WAAU;YAAf,CAAsC,6BAA0B,EAAM,QAAc;;CAG7F,IAAM,IAA0B,GAAM,oBAAoB,SAAS,EAAE,EAC/D,IAAa,GAAM,oBAAoB,cAAc,GAIrD,IAAU;EAAC;EAAO,GAAG;EAAkB;EAAO,EAC9C,IAAe;EAAC;EAAO;EAAU;EAAU,EAE3C,IAAW,EAAS,QACvB,OACE,MAAgB,UACd,MAAgB,SAAS,CAAC,EAAE,gBAAgB,EAAE,kBAAkB,QAClE,MAAc,SACZ,MAAc,YAAY,EAAE,YAC5B,MAAc,aAAa,CAAC,EAAE,UACpC;AAED,QACE,kBAAC,OAAD;EAAK,WAAU;YAA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kBAAC,QAAD;UAAM,WAAU;oBAAhB;WACE,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA;WAC1B;WAAU;WACN;;SACH,CAAA;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD,EAAA,UAAA,CAAM,WACG,kBAAC,GAAD,EAAY,IAAI,EAAG,SAAW,CAAA,CAChC,EAAA,CAAA,EACN,KAAiB,KAChB,kBAAC,QAAD;UAAM,WAAU;oBAAhB;WACE,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;WAC/B,IAAI,KAAK,EAAc,CAAC,oBAAoB;WAAC;WAAG;WAChD,IAAI,KAAK,EAAU,CAAC,oBAAoB;WACpC;YAEL;;QACM;SACT;QAvDA,EAAG,GAuDH;MAET;IACE,CAAA;GACL,EAAS,WAAW,KACnB,kBAAC,KAAD;IAAG,WAAU;cAAyC;IAElD,CAAA;GAEF"}
|
|
1
|
+
{"version":3,"file":"ProductsRoadmapsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProductsRoadmapsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge, Button } from '@burdenoff/fe-libs/ui';\nimport { Map, Calendar, Plus, Filter, Loader2 } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\nimport {\n PLANNING_FOCUSES,\n PlanningFocusBadge,\n planningFocusLabel,\n} from '../roadmaps/planningFocus';\n\nconst LIST_ROADMAPS = gql`\n query ListRoadmapsPage(\n $workspaceId: ID!\n $filter: PlanmagnetRoadmapFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetRoadmaps(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n planningFocus\n isPublic\n ownerId\n createdAt\n updatedAt\n items {\n id\n title\n status\n startDate\n endDate\n }\n }\n totalCount\n }\n }\n`;\n\ninterface RoadmapItemNode {\n id: string;\n title: string;\n status: string;\n startDate: string | null;\n endDate: string | null;\n}\n\ninterface RoadmapNode {\n id: string;\n name: string;\n description: string | null;\n type: string;\n planningFocus: string | null;\n isPublic: boolean;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n items: RoadmapItemNode[];\n}\n\nexport function ProductsRoadmapsPagePage() {\n const navigate = usePlanMagnetNavigate();\n const { workspaceId } = usePlanMagnet();\n const [focusFilter, setFocusFilter] = useState<string>('all');\n const [visFilter, setVisFilter] = useState<string>('all');\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(LIST_ROADMAPS, {\n // Filters run on the server (BOFF-7986): filtering the first 50 in the browser hid every match past the\n // 50th and could say \"no roadmaps match\" while matches existed.\n variables: {\n workspaceId,\n pagination: { first: 50 },\n filter: {\n ...(focusFilter === 'none'\n ? { hasPlanningFocus: false }\n : focusFilter !== 'all'\n ? { planningFocus: focusFilter }\n : {}),\n ...(visFilter !== 'all' ? { isPublic: visFilter === 'public' } : {}),\n },\n },\n skip: !workspaceId,\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data) {\n return (\n <div className=\"flex items-center justify-center p-12\">\n <Loader2 className=\"h-8 w-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error) {\n return <div className=\"p-6 text-destructive\">Failed to load roadmaps: {error.message}</div>;\n }\n\n const roadmaps: RoadmapNode[] = data?.planmagnetRoadmaps?.items ?? [];\n const totalCount = data?.planmagnetRoadmaps?.totalCount ?? 0;\n\n // Filter by what a roadmap is ABOUT. Every roadmap has the same display, so\n // filtering by it (the old \"Type: timeline\" chips) chose nothing (BOFF-7934).\n const focuses = ['all', ...PLANNING_FOCUSES, 'none'];\n const visibilities = ['all', 'public', 'private'];\n\n const filtered = roadmaps;\n const filteredView = focusFilter !== 'all' || visFilter !== 'all';\n\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Roadmaps</h1>\n <p className=\"text-sm text-muted-foreground\">\n {filteredView ? `${totalCount} match` : `${totalCount} roadmaps across all products`}\n </p>\n </div>\n <Button size=\"sm\" onClick={() => navigate('/products/create-roadmap-page')}>\n <Plus className=\"mr-1 h-4 w-4\" />\n New Roadmap\n </Button>\n </div>\n\n <div className=\"flex gap-4 flex-wrap\">\n <div className=\"flex items-center gap-2\">\n <Filter className=\"h-4 w-4 text-muted-foreground\" />\n <span className=\"text-sm text-muted-foreground\">Focus:</span>\n {focuses.map((f) => (\n <button\n key={f}\n type=\"button\"\n aria-pressed={focusFilter === f}\n onClick={() => setFocusFilter(f)}\n className={`px-2 py-1 text-xs rounded-md ${focusFilter === f ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {f === 'all' ? 'All' : f === 'none' ? 'Not set' : planningFocusLabel(f)}\n </button>\n ))}\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-muted-foreground\">Visibility:</span>\n {visibilities.map((v) => (\n <button\n key={v}\n onClick={() => setVisFilter(v)}\n className={`px-2 py-1 text-xs rounded-md capitalize ${visFilter === v ? 'bg-primary text-primary-foreground' : 'bg-muted text-muted-foreground'}`}\n >\n {v}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {filtered.map((rm) => {\n const itemCount = rm.items?.length ?? 0;\n const completedItems =\n rm.items?.filter((i) => i.status === 'COMPLETED' || i.status === 'DONE').length ?? 0;\n const progress = itemCount > 0 ? Math.round((completedItems / itemCount) * 100) : 0;\n const startDates = rm.items?.map((i) => i.startDate).filter(Boolean) ?? [];\n const endDates = rm.items?.map((i) => i.endDate).filter(Boolean) ?? [];\n const earliestStart = startDates.length > 0 ? startDates.sort()[0] : null;\n const latestEnd = endDates.length > 0 ? endDates.sort().reverse()[0] : null;\n\n return (\n <Card\n key={rm.id}\n {...rowLinkProps(\n () => navigate(detailPath('/products/roadmap-detail-page', rm.id)),\n rm.name\n )}\n >\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{rm.name}</CardTitle>\n <Badge variant={rm.isPublic ? 'default' : 'secondary'} className=\"capitalize\">\n {rm.isPublic ? 'public' : 'private'}\n </Badge>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {rm.description ?? 'No description'}\n </p>\n <div className=\"flex items-center gap-2\">\n <PlanningFocusBadge focus={rm.planningFocus} />\n <Badge variant=\"outline\" className=\"text-xs capitalize\">\n {rm.isPublic ? 'public' : 'private'}\n </Badge>\n </div>\n <div>\n <div className=\"flex justify-between text-xs mb-1\">\n <span className=\"text-muted-foreground\">Progress</span>\n <span className=\"font-medium\">{progress}%</span>\n </div>\n <div className=\"w-full h-2 rounded-full bg-muted overflow-hidden\">\n <div\n className=\"h-full bg-primary rounded-full\"\n style={{ width: `${progress}%` }}\n />\n </div>\n </div>\n <div className=\"flex gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n <Map className=\"h-3 w-3\" />\n {itemCount} items\n </span>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground border-t pt-2\">\n <span>\n Owner: <PersonName id={rm.ownerId} />\n </span>\n {earliestStart && latestEnd && (\n <span className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n {new Date(earliestStart).toLocaleDateString()} -{' '}\n {new Date(latestEnd).toLocaleDateString()}\n </span>\n )}\n </div>\n </CardContent>\n </Card>\n );\n })}\n </div>\n {filtered.length === 0 && (\n <p className=\"text-center text-muted-foreground py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BAAC,GAAD,EAAY,IAAI,EAAG,SAAW,CAAA,CAChC,EAAA,CAAA,EACN,KAAiB,KAChB,kBAAC,QAAD;UAAM,WAAU;oBAAhB;WACE,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;WAC/B,IAAI,KAAK,EAAc,CAAC,oBAAoB;WAAC;WAAG;WAChD,IAAI,KAAK,EAAU,CAAC,oBAAoB;WACpC;YAEL;;QACM;SACT;QAvDA,EAAG,GAuDH;MAET;IACE,CAAA;GACL,EAAS,WAAW,KACnB,kBAAC,KAAD;IAAG,WAAU;cAAyC;IAElD,CAAA;GAEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsActiveProjectsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProjectsActiveProjectsPagePage.tsx"],"names":[],"mappings":"AA4CA,wBAAgB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ProjectsActiveProjectsPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProjectsActiveProjectsPagePage.tsx"],"names":[],"mappings":"AA4CA,wBAAgB,8BAA8B,4CAqG7C"}
|
|
@@ -50,7 +50,7 @@ function g() {
|
|
|
50
50
|
children: "Active Projects"
|
|
51
51
|
}), /* @__PURE__ */ l("p", {
|
|
52
52
|
className: "text-sm text-muted-foreground",
|
|
53
|
-
children: [b.length, " active projects in progress"]
|
|
53
|
+
children: [_?.planmagnetProjects?.totalCount ?? b.length, " active projects in progress"]
|
|
54
54
|
})] }),
|
|
55
55
|
/* @__PURE__ */ c("div", {
|
|
56
56
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsActiveProjectsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProjectsActiveProjectsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Users } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\n\nconst GET_ACTIVE_PROJECTS = gql`\n query GetActiveProjects($workspaceId: ID!) {\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: { status: ACTIVE }\n pagination: { first: 100 }\n ) {\n items {\n id\n name\n key\n description\n status\n methodology\n ownerId\n startDate\n endDate\n tags\n createdAt\n }\n totalCount\n }\n }\n`;\n\nconst methodColor: Record<string, string> = {\n SCRUM: 'bg-blue-100 text-blue-800',\n KANBAN: 'bg-purple-100 text-purple-800',\n WATERFALL: 'bg-gray-100 text-gray-800',\n HYBRID: 'bg-teal-100 text-teal-800',\n AGILE: 'bg-indigo-100 text-indigo-800',\n CUSTOM: 'bg-amber-100 text-amber-800',\n};\n\nexport function ProjectsActiveProjectsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_ACTIVE_PROJECTS, {\n variables: { workspaceId: workspaceId ?? 'default' },\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data)\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n if (error)\n return <div className=\"p-6 text-red-500\">Error loading active projects: {error.message}</div>;\n\n const active = data?.planmagnetProjects?.items ?? [];\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Active Projects</h1>\n <p className=\"text-sm text-muted-foreground\"
|
|
1
|
+
{"version":3,"file":"ProjectsActiveProjectsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProjectsActiveProjectsPagePage.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle, Badge } from '@burdenoff/fe-libs/ui';\nimport { Users } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { rowLinkProps, detailPath } from '../utils/rowNavigation';\nimport { PersonName } from '../people/People';\n\nconst GET_ACTIVE_PROJECTS = gql`\n query GetActiveProjects($workspaceId: ID!) {\n planmagnetProjects(\n workspaceId: $workspaceId\n filter: { status: ACTIVE }\n pagination: { first: 100 }\n ) {\n items {\n id\n name\n key\n description\n status\n methodology\n ownerId\n startDate\n endDate\n tags\n createdAt\n }\n totalCount\n }\n }\n`;\n\nconst methodColor: Record<string, string> = {\n SCRUM: 'bg-blue-100 text-blue-800',\n KANBAN: 'bg-purple-100 text-purple-800',\n WATERFALL: 'bg-gray-100 text-gray-800',\n HYBRID: 'bg-teal-100 text-teal-800',\n AGILE: 'bg-indigo-100 text-indigo-800',\n CUSTOM: 'bg-amber-100 text-amber-800',\n};\n\nexport function ProjectsActiveProjectsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n\n const {\n data,\n loading,\n error,\n } = // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useQuery<Record<string, any>>(GET_ACTIVE_PROJECTS, {\n variables: { workspaceId: workspaceId ?? 'default' },\n });\n\n // Only before the first load: a refetch must not blank the page (it\n\n // unmounts every component on it and loses their state).\n\n if (loading && !data)\n return (\n <div className=\"flex items-center justify-center p-12\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n if (error)\n return <div className=\"p-6 text-red-500\">Error loading active projects: {error.message}</div>;\n\n const active = data?.planmagnetProjects?.items ?? [];\n\n return (\n <div className=\"space-y-6 p-6\">\n <div>\n <h1 className=\"text-2xl font-semibold\">Active Projects</h1>\n {/* The server total, not the length of the loaded page (BOFF-7969). */}\n <p className=\"text-sm text-muted-foreground\">\n {data?.planmagnetProjects?.totalCount ?? active.length} active projects in progress\n </p>\n </div>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {active.map(\n (project: {\n id: string;\n name: string;\n key: string;\n description: string | null;\n status: string;\n methodology: string;\n ownerId: string;\n startDate: string | null;\n endDate: string | null;\n tags: string[];\n }) => {\n return (\n <Card\n key={project.id}\n {...rowLinkProps(\n () => navigate(detailPath('/projects/project-detail-page', project.id)),\n project.name\n )}\n >\n <CardHeader className=\"pb-2\">\n <div className=\"flex items-center justify-between\">\n <CardTitle className=\"text-base\">{project.name}</CardTitle>\n <span className=\"text-xs font-mono text-muted-foreground\">{project.key}</span>\n </div>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-sm text-muted-foreground\">\n {project.description ?? 'No description'}\n </p>\n <div className=\"flex gap-2\">\n <Badge variant=\"outline\" className=\"capitalize\">\n {project.methodology.toLowerCase()}\n </Badge>\n {project.tags.slice(0, 3).map((tag: string) => (\n <Badge key={tag} variant=\"outline\" className=\"text-xs\">\n {tag}\n </Badge>\n ))}\n </div>\n <div className=\"flex gap-4 text-xs text-muted-foreground\">\n <span>\n {project.startDate ? new Date(project.startDate).toLocaleDateString() : '—'} -{' '}\n {project.endDate ? new Date(project.endDate).toLocaleDateString() : '—'}\n </span>\n </div>\n <div className=\"text-xs text-muted-foreground border-t pt-2 flex items-center gap-1\">\n <Users className=\"h-3 w-3\" />\n Owner: <PersonName id={project.ownerId} />\n </div>\n </CardContent>\n </Card>\n );\n }\n )}\n </div>\n {active.length === 0 && (\n <p className=\"text-center text-muted-foreground py-8\">No active projects.</p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;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ChC,EAAQ,YAAY,aAAa;SAC5B,CAAA,EACP,EAAQ,KAAK,MAAM,GAAG,EAAE,CAAC,KAAK,MAC7B,kBAAC,GAAD;SAAiB,SAAQ;SAAU,WAAU;mBAC1C;SACK,EAFI,EAEJ,CACR,CACE;;OACN,kBAAC,OAAD;QAAK,WAAU;kBACb,kBAAC,QAAD,EAAA,UAAA;SACG,EAAQ,YAAY,IAAI,KAAK,EAAQ,UAAU,CAAC,oBAAoB,GAAG;SAAI;SAAG;SAC9E,EAAQ,UAAU,IAAI,KAAK,EAAQ,QAAQ,CAAC,oBAAoB,GAAG;SAC/D,EAAA,CAAA;QACH,CAAA;OACN,kBAAC,OAAD;QAAK,WAAU;kBAAf;SACE,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA;;SACtB,kBAAC,GAAD,EAAY,IAAI,EAAQ,SAAW,CAAA;SACtC;;OACM;QACT;OArCA,EAAQ,GAqCR,CAGZ;IACG,CAAA;GACL,EAAO,WAAW,KACjB,kBAAC,KAAD;IAAG,WAAU;cAAyC;IAAuB,CAAA;GAE3E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { throwOnError as t } from "../utils/mutationResult.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { detailPath as n } from "../utils/rowNavigation.js";
|
|
4
|
+
import { endBeforeStart as r } from "../utils/formValidation.js";
|
|
5
|
+
import { enumLabel as i } from "../controls/WorkItemControls.js";
|
|
6
6
|
import { useEntityId as a } from "../hooks/useEntityId.js";
|
|
7
7
|
import { PROJECT_STATUSES as o } from "../controls/ProjectControls.js";
|
|
8
8
|
import { useMemo as s, useState as c } from "react";
|
|
@@ -64,7 +64,7 @@ function w() {
|
|
|
64
64
|
"GetProjectsForEdit",
|
|
65
65
|
"GetProjectDetail",
|
|
66
66
|
"AdminPlanmagnetProjects"
|
|
67
|
-
] }), [R, z] = c(null), B =
|
|
67
|
+
] }), [R, z] = c(null), B = r(P.startDate, P.endDate);
|
|
68
68
|
return d ? E && !T ? /* @__PURE__ */ m("div", {
|
|
69
69
|
className: "flex items-center justify-center p-12",
|
|
70
70
|
children: /* @__PURE__ */ m("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
|
|
@@ -82,7 +82,7 @@ function w() {
|
|
|
82
82
|
variant: "ghost",
|
|
83
83
|
size: "sm",
|
|
84
84
|
"aria-label": "Back to the project",
|
|
85
|
-
onClick: () => w(
|
|
85
|
+
onClick: () => w(n("/projects/project-detail-page", d)),
|
|
86
86
|
children: /* @__PURE__ */ m(l, { className: "h-4 w-4" })
|
|
87
87
|
}), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
88
88
|
className: "text-2xl font-semibold",
|
|
@@ -190,7 +190,7 @@ function w() {
|
|
|
190
190
|
}),
|
|
191
191
|
children: (o.includes(P.status) ? o : [P.status, ...o]).map((e) => /* @__PURE__ */ m("option", {
|
|
192
192
|
value: e,
|
|
193
|
-
children:
|
|
193
|
+
children: i(e)
|
|
194
194
|
}, e))
|
|
195
195
|
})] }),
|
|
196
196
|
/* @__PURE__ */ h("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectsPlanningDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProjectsPlanningDetailPagePage.tsx"],"names":[],"mappings":"AA8EA,wBAAgB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"ProjectsPlanningDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProjectsPlanningDetailPagePage.tsx"],"names":[],"mappings":"AA8EA,wBAAgB,8BAA8B,4CA2R7C"}
|