@burdenoff/microfe-planmagnet 2026.930.12 → 2026.930.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +20 -11
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +227 -223
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +37 -37
- package/dist/planmagnet/automation/AutomationRuleFields.js +41 -41
- package/dist/planmagnet/board/BulkActions.js +6 -6
- package/dist/planmagnet/board/ProjectBoard.js +24 -24
- package/dist/planmagnet/budgets/BudgetControls.js +18 -18
- package/dist/planmagnet/controls/FeatureControls.js +24 -24
- package/dist/planmagnet/controls/ObjectiveControls.js +11 -11
- package/dist/planmagnet/controls/ProgramControls.js +9 -9
- package/dist/planmagnet/controls/WorkItemControls.js +27 -27
- package/dist/planmagnet/dependency/DependencyPanel.js +7 -7
- package/dist/planmagnet/pages/AiPlanPagePage.js +6 -6
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +370 -221
- 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 +140 -135
- package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +160 -108
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsBudgetsPagePage.js +10 -10
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +5 -5
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js +30 -30
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.js +329 -0
- package/dist/planmagnet/pages/TasksMyDashboardPagePage.js.map +1 -0
- package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +26 -26
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts +14 -2
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js +173 -113
- package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js.map +1 -1
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts +8 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js +211 -0
- package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts +8 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.js +177 -0
- package/dist/planmagnet/pages/analytics/QualityMetricsCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts +7 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.js +137 -0
- package/dist/planmagnet/pages/analytics/ThroughputCard.js.map +1 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.d.ts +42 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.js +47 -0
- package/dist/planmagnet/pages/analytics/analyticsRange.js.map +1 -0
- package/dist/planmagnet/time/TimeEntryControls.js +12 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePlanMagnetNavigate as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { PROJECT_WORKFLOW as t, canonicalLabel as n } from "../hooks/useProjectWorkflow.js";
|
|
3
|
+
import { throwOnError as r } from "../utils/mutationResult.js";
|
|
4
|
+
import { ErrorLine as i } from "../controls/ConfirmButton.js";
|
|
5
5
|
import { useState as a } from "react";
|
|
6
6
|
import { ArrowLeft as o, Loader2 as s } from "lucide-react";
|
|
7
7
|
import { useParams as c } from "react-router";
|
|
@@ -42,17 +42,17 @@ var b = l`
|
|
|
42
42
|
"CANCELLED"
|
|
43
43
|
], C = new Set(["DONE", "CANCELLED"]);
|
|
44
44
|
function w() {
|
|
45
|
-
let
|
|
46
|
-
variables: { projectId:
|
|
47
|
-
skip: !
|
|
45
|
+
let n = e(), r = c().id ?? "", { data: a, loading: l, error: u } = d(t, {
|
|
46
|
+
variables: { projectId: r },
|
|
47
|
+
skip: !r
|
|
48
48
|
}), { data: h } = d(x, {
|
|
49
|
-
variables: { id:
|
|
50
|
-
skip: !
|
|
49
|
+
variables: { id: r },
|
|
50
|
+
skip: !r
|
|
51
51
|
});
|
|
52
52
|
return l && !a ? /* @__PURE__ */ f("div", {
|
|
53
53
|
className: "flex items-center justify-center p-12",
|
|
54
54
|
children: /* @__PURE__ */ f(s, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
55
|
-
}) : u || !a ? /* @__PURE__ */ f(
|
|
55
|
+
}) : u || !a ? /* @__PURE__ */ f(i, { message: u?.message ?? "This project was not found." }) : /* @__PURE__ */ p("div", {
|
|
56
56
|
className: "space-y-6 p-6",
|
|
57
57
|
children: [/* @__PURE__ */ p("div", {
|
|
58
58
|
className: "flex items-start gap-3",
|
|
@@ -60,7 +60,7 @@ function w() {
|
|
|
60
60
|
variant: "ghost",
|
|
61
61
|
size: "icon",
|
|
62
62
|
"aria-label": "Back to the project",
|
|
63
|
-
onClick: () =>
|
|
63
|
+
onClick: () => n(`/projects/project-detail-page/${r}`),
|
|
64
64
|
children: /* @__PURE__ */ f(o, { className: "h-4 w-4" })
|
|
65
65
|
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("h1", {
|
|
66
66
|
className: "text-2xl font-semibold",
|
|
@@ -73,23 +73,23 @@ function w() {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function T({ workflow: e }) {
|
|
76
|
-
let [
|
|
76
|
+
let [t, o] = a(e.statuses), [s, c] = a(e.enforceTransitions), [l, d] = a(new Set(e.transitions.map((e) => `${e.from}>${e.to}`))), [x, w] = a(null), [T, E] = a(!1), [D, O] = u(b, {
|
|
77
77
|
refetchQueries: [
|
|
78
78
|
"ProjectWorkflow",
|
|
79
79
|
"ProjectBoard",
|
|
80
80
|
"GetWorkItemDetail"
|
|
81
81
|
],
|
|
82
82
|
awaitRefetchQueries: !0
|
|
83
|
-
}), k =
|
|
84
|
-
E(!1), o(
|
|
85
|
-
...
|
|
86
|
-
...
|
|
87
|
-
} :
|
|
83
|
+
}), k = t.filter((e) => !e.hidden), A = (e, n) => {
|
|
84
|
+
E(!1), o(t.map((t) => t.status === e ? {
|
|
85
|
+
...t,
|
|
86
|
+
...n
|
|
87
|
+
} : t));
|
|
88
88
|
}, j = (e, t) => {
|
|
89
89
|
E(!1);
|
|
90
90
|
let n = `${e}>${t}`, r = new Set(l);
|
|
91
91
|
r.has(n) ? r.delete(n) : r.add(n), d(r);
|
|
92
|
-
}, M =
|
|
92
|
+
}, M = t.map((e) => e.label.trim().toLowerCase()), N = M.some((e, t) => e !== "" && M.indexOf(e) !== t), P = t.some((e) => e.label.trim() === ""), F = new Set(t.filter((e) => e.hidden).map((e) => e.status)), I = [...l].map((e) => {
|
|
93
93
|
let [t, n] = e.split(">");
|
|
94
94
|
return {
|
|
95
95
|
from: t,
|
|
@@ -98,11 +98,11 @@ function T({ workflow: e }) {
|
|
|
98
98
|
}).filter((e) => !F.has(e.to)), L = N || P || s && I.length === 0, R = async () => {
|
|
99
99
|
w(null), E(!1);
|
|
100
100
|
try {
|
|
101
|
-
await
|
|
101
|
+
await r(D({ variables: {
|
|
102
102
|
projectId: e.projectId,
|
|
103
103
|
input: {
|
|
104
104
|
enforceTransitions: s,
|
|
105
|
-
statuses:
|
|
105
|
+
statuses: t.map((e) => ({
|
|
106
106
|
status: e.status,
|
|
107
107
|
label: e.label.trim(),
|
|
108
108
|
hidden: e.hidden,
|
|
@@ -142,17 +142,17 @@ function T({ workflow: e }) {
|
|
|
142
142
|
children: "Hidden"
|
|
143
143
|
})
|
|
144
144
|
]
|
|
145
|
-
}) }), /* @__PURE__ */ f("tbody", { children:
|
|
145
|
+
}) }), /* @__PURE__ */ f("tbody", { children: t.map((e) => /* @__PURE__ */ p("tr", {
|
|
146
146
|
className: "border-t",
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ f("td", {
|
|
149
149
|
className: "py-2 pr-3 text-muted-foreground",
|
|
150
|
-
children:
|
|
150
|
+
children: n(e.status)
|
|
151
151
|
}),
|
|
152
152
|
/* @__PURE__ */ f("td", {
|
|
153
153
|
className: "py-2 pr-3",
|
|
154
154
|
children: /* @__PURE__ */ f(y, {
|
|
155
|
-
"aria-label": `Name for ${
|
|
155
|
+
"aria-label": `Name for ${n(e.status)}`,
|
|
156
156
|
maxLength: 40,
|
|
157
157
|
value: e.label,
|
|
158
158
|
onChange: (t) => A(e.status, { label: t.target.value })
|
|
@@ -161,7 +161,7 @@ function T({ workflow: e }) {
|
|
|
161
161
|
/* @__PURE__ */ f("td", {
|
|
162
162
|
className: "py-2 pr-3",
|
|
163
163
|
children: /* @__PURE__ */ f("select", {
|
|
164
|
-
"aria-label": `Category for ${
|
|
164
|
+
"aria-label": `Category for ${n(e.status)}`,
|
|
165
165
|
className: "rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60",
|
|
166
166
|
value: e.category,
|
|
167
167
|
disabled: C.has(e.status),
|
|
@@ -169,7 +169,7 @@ function T({ workflow: e }) {
|
|
|
169
169
|
onChange: (t) => A(e.status, { category: t.target.value }),
|
|
170
170
|
children: S.filter((t) => C.has(e.status) || !C.has(t)).map((e) => /* @__PURE__ */ f("option", {
|
|
171
171
|
value: e,
|
|
172
|
-
children:
|
|
172
|
+
children: n(e)
|
|
173
173
|
}, e))
|
|
174
174
|
})
|
|
175
175
|
}),
|
|
@@ -177,7 +177,7 @@ function T({ workflow: e }) {
|
|
|
177
177
|
className: "py-2",
|
|
178
178
|
children: /* @__PURE__ */ f("input", {
|
|
179
179
|
type: "checkbox",
|
|
180
|
-
"aria-label": `Hide ${
|
|
180
|
+
"aria-label": `Hide ${n(e.status)}`,
|
|
181
181
|
checked: e.hidden,
|
|
182
182
|
disabled: e.status === "DONE",
|
|
183
183
|
title: e.status === "DONE" ? "Done cannot be hidden" : void 0,
|
|
@@ -191,8 +191,8 @@ function T({ workflow: e }) {
|
|
|
191
191
|
className: "mt-2 text-xs text-muted-foreground",
|
|
192
192
|
children: "A hidden status cannot be chosen for new work; items already in it stay visible until they move."
|
|
193
193
|
}),
|
|
194
|
-
P && /* @__PURE__ */ f(
|
|
195
|
-
N && /* @__PURE__ */ f(
|
|
194
|
+
P && /* @__PURE__ */ f(i, { message: "Every status needs a name." }),
|
|
195
|
+
N && /* @__PURE__ */ f(i, { message: "Two statuses cannot share a name." })
|
|
196
196
|
] })] }),
|
|
197
197
|
/* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f(_, { children: /* @__PURE__ */ f(v, { children: "Allowed moves" }) }), /* @__PURE__ */ p(g, {
|
|
198
198
|
className: "space-y-3",
|
|
@@ -217,7 +217,7 @@ function T({ workflow: e }) {
|
|
|
217
217
|
}), k.map((e) => /* @__PURE__ */ f("th", {
|
|
218
218
|
className: "px-2 py-1 font-medium",
|
|
219
219
|
children: e.label
|
|
220
|
-
}, e.status))] }) }), /* @__PURE__ */ f("tbody", { children:
|
|
220
|
+
}, e.status))] }) }), /* @__PURE__ */ f("tbody", { children: t.map((e) => /* @__PURE__ */ p("tr", {
|
|
221
221
|
className: "border-t",
|
|
222
222
|
children: [/* @__PURE__ */ f("td", {
|
|
223
223
|
className: "py-1 pr-3",
|
|
@@ -235,7 +235,7 @@ function T({ workflow: e }) {
|
|
|
235
235
|
})
|
|
236
236
|
}, t.status))]
|
|
237
237
|
}, e.status)) })]
|
|
238
|
-
}), I.length === 0 && /* @__PURE__ */ f(
|
|
238
|
+
}), I.length === 0 && /* @__PURE__ */ f(i, { message: "Tick at least one move, or stop enforcing." })]
|
|
239
239
|
})]
|
|
240
240
|
})] }),
|
|
241
241
|
/* @__PURE__ */ p("div", {
|
|
@@ -251,7 +251,7 @@ function T({ workflow: e }) {
|
|
|
251
251
|
children: "Saved."
|
|
252
252
|
})]
|
|
253
253
|
}),
|
|
254
|
-
x && /* @__PURE__ */ f(
|
|
254
|
+
x && /* @__PURE__ */ f(i, { message: x })
|
|
255
255
|
]
|
|
256
256
|
});
|
|
257
257
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TasksMyDashboardPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/TasksMyDashboardPagePage.tsx"],"names":[],"mappings":"AAsbA,wBAAgB,wBAAwB,4CAuCvC"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { CombinedGraphQLErrors as e } from "../../node_modules/@apollo/client/errors/CombinedGraphQLErrors.js";
|
|
2
|
+
import { ServerError as t } from "../../node_modules/@apollo/client/errors/ServerError.js";
|
|
3
|
+
import { usePlanMagnet as n, usePlanMagnetNavigate as r } from "../providers/PlanMagnetProvider.js";
|
|
4
|
+
import { Legend as i } from "../../node_modules/recharts/es6/component/Legend.js";
|
|
5
|
+
import { Tooltip as a } from "../../node_modules/recharts/es6/component/Tooltip.js";
|
|
6
|
+
import { ResponsiveContainer as o } from "../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
7
|
+
import { Bar as s } from "../../node_modules/recharts/es6/cartesian/Bar.js";
|
|
8
|
+
import { CartesianGrid as c } from "../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
9
|
+
import { XAxis as l } from "../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
10
|
+
import { YAxis as u } from "../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
11
|
+
import { BarChart as d } from "../../node_modules/recharts/es6/chart/BarChart.js";
|
|
12
|
+
import { StatTile as f } from "./analytics/DeliveryHealthCards.js";
|
|
13
|
+
import { enumLabel as p } from "../controls/WorkItemControls.js";
|
|
14
|
+
import { RANGE_PRESETS as m, activePreset as h, presetRange as g, toRangeVariables as _ } from "./analytics/analyticsRange.js";
|
|
15
|
+
import { useState as v } from "react";
|
|
16
|
+
import { ArrowRight as y, Clock as b, Flag as x, LayoutDashboard as S, TrendingUp as C } from "lucide-react";
|
|
17
|
+
import { gql as w } from "@apollo/client";
|
|
18
|
+
import { useQuery as T } from "@apollo/client/react";
|
|
19
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
20
|
+
import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
|
+
import { Badge as A, Button as j, Card as M, CardContent as N, CardHeader as P, CardTitle as F } from "@burdenoff/fe-libs/ui";
|
|
22
|
+
//#region src/planmagnet/pages/TasksMyDashboardPagePage.tsx
|
|
23
|
+
var I = w`
|
|
24
|
+
query GetMyTimeAllocation($workspaceId: ID!, $startDate: DateTime, $endDate: DateTime) {
|
|
25
|
+
planmagnetMyTimeAllocation(
|
|
26
|
+
workspaceId: $workspaceId
|
|
27
|
+
startDate: $startDate
|
|
28
|
+
endDate: $endDate
|
|
29
|
+
) {
|
|
30
|
+
totalHours
|
|
31
|
+
byProject {
|
|
32
|
+
projectId
|
|
33
|
+
projectName
|
|
34
|
+
hours
|
|
35
|
+
}
|
|
36
|
+
byWorkItemType {
|
|
37
|
+
type
|
|
38
|
+
hours
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`, L = w`
|
|
43
|
+
query GetMyDeliveryTrend($workspaceId: ID!, $weeks: Int) {
|
|
44
|
+
planmagnetMyDeliveryTrend(workspaceId: $workspaceId, weeks: $weeks) {
|
|
45
|
+
weekStart
|
|
46
|
+
itemsCompleted
|
|
47
|
+
pointsCompleted
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`, R = w`
|
|
51
|
+
query GetMyObjectives($workspaceId: ID!, $filter: PlanmagnetObjectiveFilter) {
|
|
52
|
+
planmagnetObjectives(workspaceId: $workspaceId, filter: $filter, pagination: { first: 50 }) {
|
|
53
|
+
items {
|
|
54
|
+
id
|
|
55
|
+
title
|
|
56
|
+
status
|
|
57
|
+
progress
|
|
58
|
+
periodLabel
|
|
59
|
+
}
|
|
60
|
+
totalCount
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`, z = 8;
|
|
64
|
+
function B(n) {
|
|
65
|
+
return e.is(n) ? n.errors.some((e) => e.extensions?.code === "FORBIDDEN") : t.is(n) ? n.statusCode === 403 || /"code"\s*:\s*"FORBIDDEN"/.test(n.bodyText) : !1;
|
|
66
|
+
}
|
|
67
|
+
function V(e) {
|
|
68
|
+
let t = new Date(e);
|
|
69
|
+
return `${t.getUTCMonth() + 1}/${t.getUTCDate()}`;
|
|
70
|
+
}
|
|
71
|
+
function H({ progress: e }) {
|
|
72
|
+
return /* @__PURE__ */ D("div", {
|
|
73
|
+
className: "h-1.5 w-full rounded-full bg-muted overflow-hidden",
|
|
74
|
+
children: /* @__PURE__ */ D("div", {
|
|
75
|
+
className: "h-full rounded-full bg-primary",
|
|
76
|
+
style: { width: `${Math.max(0, Math.min(100, Math.round(e)))}%` }
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function U({ workspaceId: e, range: t, onRangeChange: n }) {
|
|
81
|
+
let { t: r } = k(), { startDate: i, endDate: a } = _(t), { data: o, loading: s, error: c } = T(I, {
|
|
82
|
+
variables: {
|
|
83
|
+
workspaceId: e,
|
|
84
|
+
startDate: i,
|
|
85
|
+
endDate: a
|
|
86
|
+
},
|
|
87
|
+
skip: !e
|
|
88
|
+
}), l = o?.planmagnetMyTimeAllocation, u = h(t);
|
|
89
|
+
return /* @__PURE__ */ O(M, {
|
|
90
|
+
"data-testid": "my-time-allocation",
|
|
91
|
+
children: [/* @__PURE__ */ D(P, { children: /* @__PURE__ */ O("div", {
|
|
92
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
93
|
+
children: [/* @__PURE__ */ O(F, {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [/* @__PURE__ */ D(b, { className: "h-4 w-4" }), r("planmagnet.myDashboard.timeAllocation.title", "My time allocation")]
|
|
96
|
+
}), /* @__PURE__ */ D("div", {
|
|
97
|
+
className: "flex items-center gap-1 rounded-md border p-0.5",
|
|
98
|
+
role: "group",
|
|
99
|
+
"aria-label": r("planmagnet.myDashboard.timeAllocation.rangeLabel", "Date range"),
|
|
100
|
+
children: m.map((e) => /* @__PURE__ */ D("button", {
|
|
101
|
+
type: "button",
|
|
102
|
+
"aria-pressed": u === e,
|
|
103
|
+
onClick: () => n(e),
|
|
104
|
+
className: `px-2 py-1 text-xs rounded ${u === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"}`,
|
|
105
|
+
children: r("planmagnet.myDashboard.timeAllocation.last", "Last {{days}}d", { days: e })
|
|
106
|
+
}, e))
|
|
107
|
+
})]
|
|
108
|
+
}) }), /* @__PURE__ */ D(N, { children: s ? /* @__PURE__ */ D("p", {
|
|
109
|
+
className: "text-sm text-muted-foreground",
|
|
110
|
+
children: r("planmagnet.myDashboard.loading", "Loading…")
|
|
111
|
+
}) : c ? /* @__PURE__ */ D("p", {
|
|
112
|
+
className: "text-sm text-muted-foreground",
|
|
113
|
+
children: B(c) ? r("planmagnet.myDashboard.timeAllocation.forbidden", "You don't have access to time-tracking data in this workspace.") : r("planmagnet.myDashboard.timeAllocation.error", "Time allocation could not be loaded: {{message}}", { message: c.message })
|
|
114
|
+
}) : !l || l.totalHours === 0 ? /* @__PURE__ */ D("p", {
|
|
115
|
+
className: "text-sm text-muted-foreground",
|
|
116
|
+
children: r("planmagnet.myDashboard.timeAllocation.empty", "No time logged against a project or task in this range.")
|
|
117
|
+
}) : /* @__PURE__ */ O("div", {
|
|
118
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
119
|
+
children: [/* @__PURE__ */ O("div", { children: [
|
|
120
|
+
/* @__PURE__ */ D(f, {
|
|
121
|
+
label: r("planmagnet.myDashboard.timeAllocation.total", "Total logged"),
|
|
122
|
+
value: `${l.totalHours.toFixed(1)} h`
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ D("h4", {
|
|
125
|
+
className: "mt-3 text-xs font-medium text-muted-foreground",
|
|
126
|
+
children: r("planmagnet.myDashboard.timeAllocation.byProject", "By project")
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ D("ul", {
|
|
129
|
+
className: "mt-1 space-y-1",
|
|
130
|
+
children: [...l.byProject].sort((e, t) => t.hours - e.hours).map((e) => /* @__PURE__ */ O("li", {
|
|
131
|
+
className: "flex items-center justify-between text-sm",
|
|
132
|
+
children: [/* @__PURE__ */ D("span", {
|
|
133
|
+
className: "truncate",
|
|
134
|
+
children: e.projectName
|
|
135
|
+
}), /* @__PURE__ */ O("span", {
|
|
136
|
+
className: "tabular-nums text-muted-foreground",
|
|
137
|
+
children: [e.hours.toFixed(1), " h"]
|
|
138
|
+
})]
|
|
139
|
+
}, e.projectId))
|
|
140
|
+
})
|
|
141
|
+
] }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("h4", {
|
|
142
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
143
|
+
children: r("planmagnet.myDashboard.timeAllocation.byType", "By work item type")
|
|
144
|
+
}), /* @__PURE__ */ D("ul", {
|
|
145
|
+
className: "mt-1 space-y-1",
|
|
146
|
+
children: [...l.byWorkItemType].sort((e, t) => t.hours - e.hours).map((e) => /* @__PURE__ */ O("li", {
|
|
147
|
+
className: "flex items-center justify-between text-sm",
|
|
148
|
+
children: [/* @__PURE__ */ D("span", { children: e.type ? p(e.type) : r("planmagnet.myDashboard.timeAllocation.noWorkItem", "No work item") }), /* @__PURE__ */ O("span", {
|
|
149
|
+
className: "tabular-nums text-muted-foreground",
|
|
150
|
+
children: [e.hours.toFixed(1), " h"]
|
|
151
|
+
})]
|
|
152
|
+
}, e.type ?? "none"))
|
|
153
|
+
})] })]
|
|
154
|
+
}) })]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function W({ workspaceId: e }) {
|
|
158
|
+
let { t } = k(), { data: n, loading: r, error: f } = T(L, {
|
|
159
|
+
variables: {
|
|
160
|
+
workspaceId: e,
|
|
161
|
+
weeks: z
|
|
162
|
+
},
|
|
163
|
+
skip: !e
|
|
164
|
+
}), p = n?.planmagnetMyDeliveryTrend ?? [], m = p.map((e) => ({
|
|
165
|
+
week: V(e.weekStart),
|
|
166
|
+
items: e.itemsCompleted,
|
|
167
|
+
points: e.pointsCompleted
|
|
168
|
+
})), h = p.reduce((e, t) => e + t.itemsCompleted, 0), g = p.reduce((e, t) => e + t.pointsCompleted, 0);
|
|
169
|
+
return /* @__PURE__ */ O(M, {
|
|
170
|
+
"data-testid": "my-delivery-trend",
|
|
171
|
+
children: [/* @__PURE__ */ O(P, { children: [/* @__PURE__ */ O(F, {
|
|
172
|
+
className: "flex items-center gap-2",
|
|
173
|
+
children: [/* @__PURE__ */ D(C, { className: "h-4 w-4" }), t("planmagnet.myDashboard.deliveryTrend.title", "My delivery trend")]
|
|
174
|
+
}), /* @__PURE__ */ D("p", {
|
|
175
|
+
className: "text-xs text-muted-foreground",
|
|
176
|
+
children: t("planmagnet.myDashboard.deliveryTrend.subtitle", "Items and points assigned to you that reached Done, last {{weeks}} weeks.", { weeks: z })
|
|
177
|
+
})] }), /* @__PURE__ */ D(N, { children: r ? /* @__PURE__ */ D("p", {
|
|
178
|
+
className: "text-sm text-muted-foreground",
|
|
179
|
+
children: t("planmagnet.myDashboard.loading", "Loading…")
|
|
180
|
+
}) : f ? /* @__PURE__ */ D("p", {
|
|
181
|
+
className: "text-sm text-muted-foreground",
|
|
182
|
+
children: t("planmagnet.myDashboard.deliveryTrend.error", "Delivery trend could not be loaded: {{message}}", { message: f.message })
|
|
183
|
+
}) : h === 0 ? /* @__PURE__ */ D("p", {
|
|
184
|
+
className: "text-sm text-muted-foreground",
|
|
185
|
+
children: t("planmagnet.myDashboard.deliveryTrend.empty", "Nothing assigned to you reached Done in the last {{weeks}} weeks.", { weeks: z })
|
|
186
|
+
}) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("p", {
|
|
187
|
+
className: "text-xs text-muted-foreground mb-2",
|
|
188
|
+
children: t("planmagnet.myDashboard.deliveryTrend.summary", "{{items}} item(s), {{points}} point(s) completed across {{weeks}} week(s).", {
|
|
189
|
+
items: h,
|
|
190
|
+
points: g,
|
|
191
|
+
weeks: m.length
|
|
192
|
+
})
|
|
193
|
+
}), /* @__PURE__ */ D(o, {
|
|
194
|
+
width: "100%",
|
|
195
|
+
height: 200,
|
|
196
|
+
children: /* @__PURE__ */ O(d, {
|
|
197
|
+
data: m,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ D(c, {
|
|
200
|
+
strokeDasharray: "3 3",
|
|
201
|
+
opacity: .2
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ D(l, {
|
|
204
|
+
dataKey: "week",
|
|
205
|
+
tick: { fontSize: 11 }
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ D(u, {
|
|
208
|
+
tick: { fontSize: 11 },
|
|
209
|
+
allowDecimals: !1
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ D(a, {}),
|
|
212
|
+
/* @__PURE__ */ D(i, { wrapperStyle: { fontSize: 12 } }),
|
|
213
|
+
/* @__PURE__ */ D(s, {
|
|
214
|
+
dataKey: "items",
|
|
215
|
+
name: t("planmagnet.myDashboard.deliveryTrend.items", "Items"),
|
|
216
|
+
fill: "var(--color-chart-1)"
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ D(s, {
|
|
219
|
+
dataKey: "points",
|
|
220
|
+
name: t("planmagnet.myDashboard.deliveryTrend.points", "Points"),
|
|
221
|
+
fill: "var(--color-chart-3)"
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
})
|
|
225
|
+
})] }) })]
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function G({ workspaceId: e, ownerId: t }) {
|
|
229
|
+
let { t: n } = k(), i = r(), { data: a, loading: o, error: s } = T(R, {
|
|
230
|
+
variables: {
|
|
231
|
+
workspaceId: e,
|
|
232
|
+
filter: t ? { ownerId: t } : void 0
|
|
233
|
+
},
|
|
234
|
+
skip: !e || !t
|
|
235
|
+
}), c = a?.planmagnetObjectives.items ?? [];
|
|
236
|
+
return /* @__PURE__ */ O(M, {
|
|
237
|
+
"data-testid": "my-goals",
|
|
238
|
+
children: [/* @__PURE__ */ O(P, { children: [/* @__PURE__ */ O(F, {
|
|
239
|
+
className: "flex items-center gap-2",
|
|
240
|
+
children: [/* @__PURE__ */ D(x, { className: "h-4 w-4" }), n("planmagnet.myDashboard.goals.title", "My goals")]
|
|
241
|
+
}), /* @__PURE__ */ D("p", {
|
|
242
|
+
className: "text-xs text-muted-foreground",
|
|
243
|
+
children: n("planmagnet.myDashboard.goals.subtitle", "Objectives you own, with their progress.")
|
|
244
|
+
})] }), /* @__PURE__ */ D(N, { children: t ? o ? /* @__PURE__ */ D("p", {
|
|
245
|
+
className: "text-sm text-muted-foreground",
|
|
246
|
+
children: n("planmagnet.myDashboard.loading", "Loading…")
|
|
247
|
+
}) : s ? /* @__PURE__ */ D("p", {
|
|
248
|
+
className: "text-sm text-muted-foreground",
|
|
249
|
+
children: n("planmagnet.myDashboard.goals.error", "Goals could not be loaded: {{message}}", { message: s.message })
|
|
250
|
+
}) : c.length === 0 ? /* @__PURE__ */ D("p", {
|
|
251
|
+
className: "text-sm text-muted-foreground",
|
|
252
|
+
children: n("planmagnet.myDashboard.goals.empty", "You do not own any objective yet.")
|
|
253
|
+
}) : /* @__PURE__ */ D("ul", {
|
|
254
|
+
className: "space-y-3",
|
|
255
|
+
children: c.map((e) => /* @__PURE__ */ D("li", { children: /* @__PURE__ */ O("button", {
|
|
256
|
+
type: "button",
|
|
257
|
+
className: "w-full text-left rounded-md border p-2 hover:border-primary transition-colors",
|
|
258
|
+
onClick: () => i(`/goals/objective-detail-page?objectiveId=${encodeURIComponent(e.id)}`),
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ O("div", {
|
|
261
|
+
className: "flex items-center justify-between gap-2",
|
|
262
|
+
children: [/* @__PURE__ */ D("span", {
|
|
263
|
+
className: "text-sm font-medium truncate",
|
|
264
|
+
children: e.title
|
|
265
|
+
}), /* @__PURE__ */ D(A, {
|
|
266
|
+
variant: "outline",
|
|
267
|
+
className: "text-xs capitalize shrink-0",
|
|
268
|
+
children: e.status.toLowerCase()
|
|
269
|
+
})]
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ D("p", {
|
|
272
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
273
|
+
children: e.periodLabel
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ O("div", {
|
|
276
|
+
className: "mt-1.5 flex items-center gap-2",
|
|
277
|
+
children: [/* @__PURE__ */ D(H, { progress: e.progress }), /* @__PURE__ */ O("span", {
|
|
278
|
+
className: "text-xs tabular-nums text-muted-foreground shrink-0",
|
|
279
|
+
children: [Math.round(e.progress), "%"]
|
|
280
|
+
})]
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
}) }, e.id))
|
|
284
|
+
}) : /* @__PURE__ */ D("p", {
|
|
285
|
+
className: "text-sm text-muted-foreground",
|
|
286
|
+
children: n("planmagnet.myDashboard.goals.noIdentity", "Sign in to see your goals.")
|
|
287
|
+
}) })]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function K() {
|
|
291
|
+
let { workspaceId: e, currentUser: t } = n(), i = r(), { t: a } = k(), [o, s] = v(() => g("30"));
|
|
292
|
+
return /* @__PURE__ */ O("div", {
|
|
293
|
+
className: "space-y-6 p-6",
|
|
294
|
+
"data-testid": "my-dashboard-page",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ O("div", {
|
|
297
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
298
|
+
children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ O("h1", {
|
|
299
|
+
className: "text-2xl font-semibold flex items-center gap-2",
|
|
300
|
+
children: [/* @__PURE__ */ D(S, { className: "h-6 w-6" }), a("planmagnet.myDashboard.title", "My dashboard")]
|
|
301
|
+
}), /* @__PURE__ */ D("p", {
|
|
302
|
+
className: "text-sm text-muted-foreground",
|
|
303
|
+
children: a("planmagnet.myDashboard.subtitle", "Your own time, delivery, and goals across every project.")
|
|
304
|
+
})] }), /* @__PURE__ */ O(j, {
|
|
305
|
+
variant: "outline",
|
|
306
|
+
size: "sm",
|
|
307
|
+
onClick: () => i("/tasks/my-work-page"),
|
|
308
|
+
children: [a("planmagnet.myDashboard.myWorkLink", "Go to My Work"), /* @__PURE__ */ D(y, { className: "ml-1 h-4 w-4" })]
|
|
309
|
+
})]
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ D(U, {
|
|
312
|
+
workspaceId: e,
|
|
313
|
+
range: o,
|
|
314
|
+
onRangeChange: (e) => s(g(e))
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ O("div", {
|
|
317
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
318
|
+
children: [/* @__PURE__ */ D(W, { workspaceId: e }), /* @__PURE__ */ D(G, {
|
|
319
|
+
workspaceId: e,
|
|
320
|
+
ownerId: t?.id
|
|
321
|
+
})]
|
|
322
|
+
})
|
|
323
|
+
]
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
export { K as TasksMyDashboardPagePage };
|
|
328
|
+
|
|
329
|
+
//# sourceMappingURL=TasksMyDashboardPagePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TasksMyDashboardPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/TasksMyDashboardPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { CombinedGraphQLErrors, ServerError } from '@apollo/client/errors';\nimport { Badge, Button, Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ArrowRight, Clock, Flag, LayoutDashboard, TrendingUp } from 'lucide-react';\nimport {\n Bar,\n BarChart,\n CartesianGrid,\n Legend,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { enumLabel } from '../controls/WorkItemControls';\nimport { StatTile } from './analytics/DeliveryHealthCards';\nimport {\n RANGE_PRESETS,\n activePreset,\n presetRange,\n toRangeVariables,\n type DateRange,\n type RangePreset,\n} from './analytics/analyticsRange';\n\n/**\n * ANR-08: a team member's own view — time allocation, delivery trend, and the objectives they own — plus a way\n * back to My Work. Every section owns its own query (same reasoning as analytics/DeliveryHealthCards.tsx: a\n * query that comes back FORBIDDEN — no time-tracking access, most commonly — must not break the other two\n * sections or the page around them), and identity is implicit: `planmagnetMyTimeAllocation` /\n * `planmagnetMyDeliveryTrend` read `x-actor-id` themselves, so there is nothing to pass or fake here.\n */\n\nconst GET_MY_TIME_ALLOCATION = gql`\n query GetMyTimeAllocation($workspaceId: ID!, $startDate: DateTime, $endDate: DateTime) {\n planmagnetMyTimeAllocation(\n workspaceId: $workspaceId\n startDate: $startDate\n endDate: $endDate\n ) {\n totalHours\n byProject {\n projectId\n projectName\n hours\n }\n byWorkItemType {\n type\n hours\n }\n }\n }\n`;\n\nconst GET_MY_DELIVERY_TREND = gql`\n query GetMyDeliveryTrend($workspaceId: ID!, $weeks: Int) {\n planmagnetMyDeliveryTrend(workspaceId: $workspaceId, weeks: $weeks) {\n weekStart\n itemsCompleted\n pointsCompleted\n }\n }\n`;\n\nconst GET_MY_OBJECTIVES = gql`\n query GetMyObjectives($workspaceId: ID!, $filter: PlanmagnetObjectiveFilter) {\n planmagnetObjectives(workspaceId: $workspaceId, filter: $filter, pagination: { first: 50 }) {\n items {\n id\n title\n status\n progress\n periodLabel\n }\n totalCount\n }\n }\n`;\n\ninterface TimeAllocationData {\n planmagnetMyTimeAllocation: {\n totalHours: number;\n byProject: Array<{ projectId: string; projectName: string; hours: number }>;\n byWorkItemType: Array<{ type: string | null; hours: number }>;\n };\n}\n\ninterface DeliveryTrendData {\n planmagnetMyDeliveryTrend: Array<{\n weekStart: string;\n itemsCompleted: number;\n pointsCompleted: number;\n }>;\n}\n\ninterface MyObjective {\n id: string;\n title: string;\n status: string;\n progress: number;\n periodLabel: string;\n}\n\ninterface MyObjectivesData {\n planmagnetObjectives: { items: MyObjective[]; totalCount: number };\n}\n\nconst DELIVERY_TREND_WEEKS = 8;\n\n/**\n * Is this the gateway refusing the caller's role (e.g. no timetracking read grant)? Same detection as\n * releases/ReleaseReadinessCard.tsx's `denied()` — the gateway answers an RBAC denial with `extensions.code:\n * FORBIDDEN`, surfaced either as a GraphQL error or (depending on the fetch path) a ServerError body.\n */\nfunction isForbidden(error: unknown): boolean {\n if (CombinedGraphQLErrors.is(error)) {\n return error.errors.some((e) => e.extensions?.code === 'FORBIDDEN');\n }\n if (ServerError.is(error)) {\n return error.statusCode === 403 || /\"code\"\\s*:\\s*\"FORBIDDEN\"/.test(error.bodyText);\n }\n return false;\n}\n\nfunction formatWeek(iso: string): string {\n const d = new Date(iso);\n return `${d.getUTCMonth() + 1}/${d.getUTCDate()}`;\n}\n\nfunction ProgressBar({ progress }: { progress: number }) {\n const pct = Math.max(0, Math.min(100, Math.round(progress)));\n return (\n <div className=\"h-1.5 w-full rounded-full bg-muted overflow-hidden\">\n <div className=\"h-full rounded-full bg-primary\" style={{ width: `${pct}%` }} />\n </div>\n );\n}\n\nfunction TimeAllocationCard({\n workspaceId,\n range,\n onRangeChange,\n}: {\n workspaceId?: string | null;\n range: DateRange;\n onRangeChange: (p: RangePreset) => void;\n}) {\n const { t } = useI18n();\n const { startDate, endDate } = toRangeVariables(range);\n const { data, loading, error } = useQuery<TimeAllocationData>(GET_MY_TIME_ALLOCATION, {\n variables: { workspaceId, startDate, endDate },\n skip: !workspaceId,\n });\n const allocation = data?.planmagnetMyTimeAllocation;\n const preset = activePreset(range);\n\n return (\n <Card data-testid=\"my-time-allocation\">\n <CardHeader>\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <CardTitle className=\"flex items-center gap-2\">\n <Clock className=\"h-4 w-4\" />\n {t('planmagnet.myDashboard.timeAllocation.title', 'My time allocation')}\n </CardTitle>\n <div\n className=\"flex items-center gap-1 rounded-md border p-0.5\"\n role=\"group\"\n aria-label={t('planmagnet.myDashboard.timeAllocation.rangeLabel', 'Date range')}\n >\n {RANGE_PRESETS.map((p) => (\n <button\n key={p}\n type=\"button\"\n aria-pressed={preset === p}\n onClick={() => onRangeChange(p)}\n className={`px-2 py-1 text-xs rounded ${\n preset === p\n ? 'bg-primary text-primary-foreground'\n : 'text-muted-foreground hover:bg-muted'\n }`}\n >\n {t('planmagnet.myDashboard.timeAllocation.last', 'Last {{days}}d', { days: p })}\n </button>\n ))}\n </div>\n </div>\n </CardHeader>\n <CardContent>\n {loading ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.loading', 'Loading…')}\n </p>\n ) : error ? (\n <p className=\"text-sm text-muted-foreground\">\n {isForbidden(error)\n ? t(\n 'planmagnet.myDashboard.timeAllocation.forbidden',\n \"You don't have access to time-tracking data in this workspace.\"\n )\n : t(\n 'planmagnet.myDashboard.timeAllocation.error',\n 'Time allocation could not be loaded: {{message}}',\n { message: error.message }\n )}\n </p>\n ) : !allocation || allocation.totalHours === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n {t(\n 'planmagnet.myDashboard.timeAllocation.empty',\n 'No time logged against a project or task in this range.'\n )}\n </p>\n ) : (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <StatTile\n label={t('planmagnet.myDashboard.timeAllocation.total', 'Total logged')}\n value={`${allocation.totalHours.toFixed(1)} h`}\n />\n <h4 className=\"mt-3 text-xs font-medium text-muted-foreground\">\n {t('planmagnet.myDashboard.timeAllocation.byProject', 'By project')}\n </h4>\n <ul className=\"mt-1 space-y-1\">\n {[...allocation.byProject]\n .sort((a, b) => b.hours - a.hours)\n .map((p) => (\n <li key={p.projectId} className=\"flex items-center justify-between text-sm\">\n <span className=\"truncate\">{p.projectName}</span>\n <span className=\"tabular-nums text-muted-foreground\">\n {p.hours.toFixed(1)} h\n </span>\n </li>\n ))}\n </ul>\n </div>\n <div>\n <h4 className=\"text-xs font-medium text-muted-foreground\">\n {t('planmagnet.myDashboard.timeAllocation.byType', 'By work item type')}\n </h4>\n <ul className=\"mt-1 space-y-1\">\n {[...allocation.byWorkItemType]\n .sort((a, b) => b.hours - a.hours)\n .map((wt) => (\n <li\n key={wt.type ?? 'none'}\n className=\"flex items-center justify-between text-sm\"\n >\n <span>\n {wt.type\n ? enumLabel(wt.type)\n : t('planmagnet.myDashboard.timeAllocation.noWorkItem', 'No work item')}\n </span>\n <span className=\"tabular-nums text-muted-foreground\">\n {wt.hours.toFixed(1)} h\n </span>\n </li>\n ))}\n </ul>\n </div>\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n\nfunction DeliveryTrendCard({ workspaceId }: { workspaceId?: string | null }) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<DeliveryTrendData>(GET_MY_DELIVERY_TREND, {\n variables: { workspaceId, weeks: DELIVERY_TREND_WEEKS },\n skip: !workspaceId,\n });\n const weeks = data?.planmagnetMyDeliveryTrend ?? [];\n const chartData = weeks.map((w) => ({\n week: formatWeek(w.weekStart),\n items: w.itemsCompleted,\n points: w.pointsCompleted,\n }));\n const totalItems = weeks.reduce((sum, w) => sum + w.itemsCompleted, 0);\n const totalPoints = weeks.reduce((sum, w) => sum + w.pointsCompleted, 0);\n\n return (\n <Card data-testid=\"my-delivery-trend\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <TrendingUp className=\"h-4 w-4\" />\n {t('planmagnet.myDashboard.deliveryTrend.title', 'My delivery trend')}\n </CardTitle>\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'planmagnet.myDashboard.deliveryTrend.subtitle',\n 'Items and points assigned to you that reached Done, last {{weeks}} weeks.',\n { weeks: DELIVERY_TREND_WEEKS }\n )}\n </p>\n </CardHeader>\n <CardContent>\n {loading ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.loading', 'Loading…')}\n </p>\n ) : error ? (\n <p className=\"text-sm text-muted-foreground\">\n {t(\n 'planmagnet.myDashboard.deliveryTrend.error',\n 'Delivery trend could not be loaded: {{message}}',\n { message: error.message }\n )}\n </p>\n ) : totalItems === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n {t(\n 'planmagnet.myDashboard.deliveryTrend.empty',\n 'Nothing assigned to you reached Done in the last {{weeks}} weeks.',\n { weeks: DELIVERY_TREND_WEEKS }\n )}\n </p>\n ) : (\n <>\n {/* Accessible text restatement of the chart. */}\n <p className=\"text-xs text-muted-foreground mb-2\">\n {t(\n 'planmagnet.myDashboard.deliveryTrend.summary',\n '{{items}} item(s), {{points}} point(s) completed across {{weeks}} week(s).',\n { items: totalItems, points: totalPoints, weeks: chartData.length }\n )}\n </p>\n <ResponsiveContainer width=\"100%\" height={200}>\n <BarChart data={chartData}>\n <CartesianGrid strokeDasharray=\"3 3\" opacity={0.2} />\n <XAxis dataKey=\"week\" tick={{ fontSize: 11 }} />\n <YAxis tick={{ fontSize: 11 }} allowDecimals={false} />\n <Tooltip />\n <Legend wrapperStyle={{ fontSize: 12 }} />\n <Bar\n dataKey=\"items\"\n name={t('planmagnet.myDashboard.deliveryTrend.items', 'Items')}\n fill=\"var(--color-chart-1)\"\n />\n <Bar\n dataKey=\"points\"\n name={t('planmagnet.myDashboard.deliveryTrend.points', 'Points')}\n fill=\"var(--color-chart-3)\"\n />\n </BarChart>\n </ResponsiveContainer>\n </>\n )}\n </CardContent>\n </Card>\n );\n}\n\nfunction MyGoalsCard({\n workspaceId,\n ownerId,\n}: {\n workspaceId?: string | null;\n ownerId?: string | null;\n}) {\n const { t } = useI18n();\n const navigate = usePlanMagnetNavigate();\n const { data, loading, error } = useQuery<MyObjectivesData>(GET_MY_OBJECTIVES, {\n variables: { workspaceId, filter: ownerId ? { ownerId } : undefined },\n skip: !workspaceId || !ownerId,\n });\n const objectives = data?.planmagnetObjectives.items ?? [];\n\n return (\n <Card data-testid=\"my-goals\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Flag className=\"h-4 w-4\" />\n {t('planmagnet.myDashboard.goals.title', 'My goals')}\n </CardTitle>\n <p className=\"text-xs text-muted-foreground\">\n {t('planmagnet.myDashboard.goals.subtitle', 'Objectives you own, with their progress.')}\n </p>\n </CardHeader>\n <CardContent>\n {!ownerId ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.goals.noIdentity', 'Sign in to see your goals.')}\n </p>\n ) : loading ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.loading', 'Loading…')}\n </p>\n ) : error ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.goals.error', 'Goals could not be loaded: {{message}}', {\n message: error.message,\n })}\n </p>\n ) : objectives.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.myDashboard.goals.empty', 'You do not own any objective yet.')}\n </p>\n ) : (\n <ul className=\"space-y-3\">\n {objectives.map((obj) => (\n <li key={obj.id}>\n <button\n type=\"button\"\n className=\"w-full text-left rounded-md border p-2 hover:border-primary transition-colors\"\n onClick={() =>\n navigate(\n `/goals/objective-detail-page?objectiveId=${encodeURIComponent(obj.id)}`\n )\n }\n >\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"text-sm font-medium truncate\">{obj.title}</span>\n <Badge variant=\"outline\" className=\"text-xs capitalize shrink-0\">\n {obj.status.toLowerCase()}\n </Badge>\n </div>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{obj.periodLabel}</p>\n <div className=\"mt-1.5 flex items-center gap-2\">\n <ProgressBar progress={obj.progress} />\n <span className=\"text-xs tabular-nums text-muted-foreground shrink-0\">\n {Math.round(obj.progress)}%\n </span>\n </div>\n </button>\n </li>\n ))}\n </ul>\n )}\n </CardContent>\n </Card>\n );\n}\n\nexport function TasksMyDashboardPagePage() {\n const { workspaceId, currentUser } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const { t } = useI18n();\n const [timeRange, setTimeRange] = useState<DateRange>(() => presetRange('30'));\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"my-dashboard-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <LayoutDashboard className=\"h-6 w-6\" />\n {t('planmagnet.myDashboard.title', 'My dashboard')}\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {t(\n 'planmagnet.myDashboard.subtitle',\n 'Your own time, delivery, and goals across every project.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" size=\"sm\" onClick={() => navigate('/tasks/my-work-page')}>\n {t('planmagnet.myDashboard.myWorkLink', 'Go to My Work')}\n <ArrowRight className=\"ml-1 h-4 w-4\" />\n </Button>\n </div>\n\n <TimeAllocationCard\n workspaceId={workspaceId}\n range={timeRange}\n onRangeChange={(p) => setTimeRange(presetRange(p))}\n />\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <DeliveryTrendCard workspaceId={workspaceId} />\n <MyGoalsCard workspaceId={workspaceId} ownerId={currentUser?.id} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,IAAyB,CAAG;;;;;;;;;;;;;;;;;;;GAqB5B,IAAwB,CAAG;;;;;;;;GAU3B,IAAoB,CAAG;;;;;;;;;;;;;GA2CvB,IAAuB;AAO7B,SAAS,EAAY,GAAyB;AAO5C,QANI,EAAsB,GAAG,EAAM,GAC1B,EAAM,OAAO,MAAM,MAAM,EAAE,YAAY,SAAS,YAAY,GAEjE,EAAY,GAAG,EAAM,GAChB,EAAM,eAAe,OAAO,2BAA2B,KAAK,EAAM,SAAS,GAE7E;;AAGT,SAAS,EAAW,GAAqB;CACvC,IAAM,IAAI,IAAI,KAAK,EAAI;AACvB,QAAO,GAAG,EAAE,aAAa,GAAG,EAAE,GAAG,EAAE,YAAY;;AAGjD,SAAS,EAAY,EAAE,eAAkC;AAEvD,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;GAAiC,OAAO,EAAE,OAAO,GAHxD,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,EAAS,CAAC,CAAC,CAGe,IAAI;GAAI,CAAA;EAC3E,CAAA;;AAIV,SAAS,EAAmB,EAC1B,gBACA,UACA,oBAKC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,cAAW,eAAY,EAAiB,EAAM,EAChD,EAAE,SAAM,YAAS,aAAU,EAA6B,GAAwB;EACpF,WAAW;GAAE;GAAa;GAAW;GAAS;EAC9C,MAAM,CAAC;EACR,CAAC,EACI,IA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