@burdenoff/microfe-timecampus 2026.1031.12 → 2026.1031.14
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/wspace-operations.d.ts +110 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1330 -1274
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +574 -13
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +10 -8
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
- package/dist/timecampus/TimeCampusRoutes.js +4 -0
- package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/dashboard/ReportsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/dashboard/ReportsPage.js +143 -129
- package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.d.ts +6 -0
- package/dist/timecampus/pages/dashboard/ServerReportExports.d.ts.map +1 -0
- package/dist/timecampus/pages/dashboard/ServerReportExports.js +257 -0
- package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -0
- package/dist/timecampus/pages/dashboard/reportTemplates.d.ts +33 -0
- package/dist/timecampus/pages/dashboard/reportTemplates.d.ts.map +1 -0
- package/dist/timecampus/pages/dashboard/reportTemplates.js +129 -0
- package/dist/timecampus/pages/dashboard/reportTemplates.js.map +1 -0
- package/dist/timecampus/pages/mobile/mobileModel.d.ts +1 -1
- package/dist/timecampus/pages/mobile/mobileModel.d.ts.map +1 -1
- package/dist/timecampus/pages/mobile/mobileModel.js +3 -1
- package/dist/timecampus/pages/mobile/mobileModel.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,82 +11,86 @@ import { BarsChart as d } from "../../components/charts/BarsChart.js";
|
|
|
11
11
|
import { RadialGauge as f } from "../../components/charts/RadialGauge.js";
|
|
12
12
|
import { ProgressMeter as p } from "../../components/charts/ProgressMeter.js";
|
|
13
13
|
import "../../components/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { ServerReportExports as m } from "./ServerReportExports.js";
|
|
15
|
+
import { useState as h } from "react";
|
|
16
|
+
import { Brain as g, CalendarRange as _, Clock as v, DollarSign as y, Download as b, RefreshCw as x } from "lucide-react";
|
|
17
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
18
|
+
import { GlassCard as w } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/timecampus/pages/dashboard/ReportsPage.tsx
|
|
19
|
-
function
|
|
20
|
+
function T(e, t) {
|
|
20
21
|
let n = (e) => `"${String(e).replace(/"/g, "\"\"")}"`, r = ["Metric,Value", ...t.map(([e, t]) => `${n(e)},${n(t)}`)].join("\n"), i = new Blob([r], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
21
22
|
o.href = a, o.download = e, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function E() {
|
|
24
25
|
c("reports");
|
|
25
|
-
let { workspaceId:
|
|
26
|
-
|
|
26
|
+
let { workspaceId: E = "" } = e(), [D, O] = h(!1), { data: k, loading: A, error: j, refetch: M } = o({ skip: !E }), { data: N, loading: P, refetch: F } = s({ skip: !E }), { data: I, loading: L, refetch: R } = a({ skip: !E }), z = k?.timeEntryStats, B = N?.workPatternSummary, V = I?.focusScoreSummary, H = async () => {
|
|
27
|
+
O(!0);
|
|
27
28
|
try {
|
|
28
29
|
await Promise.all([
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
M(),
|
|
31
|
+
F(),
|
|
32
|
+
R()
|
|
32
33
|
]);
|
|
33
34
|
} finally {
|
|
34
|
-
|
|
35
|
+
O(!1);
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
-
(e === "time-summary" || e === "billable-summary") &&
|
|
38
|
-
["Total hours", Math.round(
|
|
39
|
-
["Billable hours", Math.round(
|
|
40
|
-
["Total entries",
|
|
41
|
-
["Active timers",
|
|
42
|
-
]) : e === "work-pattern" &&
|
|
43
|
-
["Average score", Math.round(
|
|
44
|
-
["Highest score", Math.round(
|
|
45
|
-
["Lowest score", Math.round(
|
|
37
|
+
}, U = (e) => {
|
|
38
|
+
(e === "time-summary" || e === "billable-summary") && z ? T(`${e}.csv`, [
|
|
39
|
+
["Total hours", Math.round(z.totalHours)],
|
|
40
|
+
["Billable hours", Math.round(z.billableHours)],
|
|
41
|
+
["Total entries", z.totalEntries],
|
|
42
|
+
["Active timers", z.activeTimers]
|
|
43
|
+
]) : e === "work-pattern" && B ? T("work-pattern-analysis.csv", [["Average focus hours", B.averageFocusHours.toFixed(1)], ["Average productivity %", Math.round(B.averageProductivity)]]) : e === "focus-score" && V && T("focus-score-report.csv", [
|
|
44
|
+
["Average score", Math.round(V.averageScore)],
|
|
45
|
+
["Highest score", Math.round(V.highestScore)],
|
|
46
|
+
["Lowest score", Math.round(V.lowestScore)]
|
|
46
47
|
]);
|
|
47
48
|
};
|
|
48
|
-
if (k || N || I) return /* @__PURE__ */
|
|
49
|
+
if (A && !k || P && !N || L && !I) return /* @__PURE__ */ S(l, {
|
|
49
50
|
title: "Reports",
|
|
50
51
|
description: "Generate and view time tracking reports",
|
|
51
|
-
actions: /* @__PURE__ */
|
|
52
|
+
actions: /* @__PURE__ */ C("button", {
|
|
52
53
|
disabled: !0,
|
|
53
54
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70",
|
|
54
|
-
children: [/* @__PURE__ */ x
|
|
55
|
+
children: [/* @__PURE__ */ S(x, { className: "h-4 w-4" }), "Refresh"]
|
|
55
56
|
}),
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ S(r, {
|
|
57
58
|
variant: "list",
|
|
58
59
|
count: 4
|
|
59
60
|
})
|
|
60
61
|
});
|
|
61
|
-
if (
|
|
62
|
+
if (j) return /* @__PURE__ */ C(l, {
|
|
62
63
|
title: "Reports",
|
|
63
64
|
description: "Generate and view time tracking reports",
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ S("div", {
|
|
66
|
+
className: "mb-6",
|
|
67
|
+
children: /* @__PURE__ */ S(m, {})
|
|
68
|
+
}), /* @__PURE__ */ S("div", {
|
|
65
69
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
66
|
-
children: "Failed to load
|
|
67
|
-
})
|
|
70
|
+
children: "Failed to load the summary figures. Please try again later."
|
|
71
|
+
})]
|
|
68
72
|
});
|
|
69
|
-
let
|
|
70
|
-
...
|
|
73
|
+
let W = z ? Math.max(0, z.totalHours - z.billableHours) : 0, G = z && z.totalHours > 0 ? Math.round(z.billableHours / z.totalHours * 100) : 0, K = [
|
|
74
|
+
...z ? [{
|
|
71
75
|
id: "time-summary",
|
|
72
76
|
name: "Time Tracking Summary",
|
|
73
77
|
typeLabel: "Time",
|
|
74
78
|
typeVariant: "info",
|
|
75
|
-
period: `${n(
|
|
76
|
-
icon: /* @__PURE__ */
|
|
79
|
+
period: `${n(z.totalHours)} total · ${z.totalEntries} entries`,
|
|
80
|
+
icon: /* @__PURE__ */ S(v, { className: "h-5 w-5" }),
|
|
77
81
|
accent: "bg-status-info-bg text-status-info-text",
|
|
78
|
-
visual: /* @__PURE__ */
|
|
82
|
+
visual: /* @__PURE__ */ C("div", {
|
|
79
83
|
className: "space-y-2",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
-
value:
|
|
82
|
-
max:
|
|
84
|
+
children: [/* @__PURE__ */ S(p, {
|
|
85
|
+
value: z.billableHours,
|
|
86
|
+
max: z.totalHours > 0 ? z.totalHours : 1,
|
|
83
87
|
higherIsWorse: !1,
|
|
84
88
|
label: "Billable share",
|
|
85
89
|
format: n,
|
|
86
90
|
size: "md"
|
|
87
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ C("div", {
|
|
88
92
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ C("span", { children: [z.totalEntries, " entries logged"] }), /* @__PURE__ */ S("span", { children: z.activeTimers > 0 ? `${z.activeTimers} timer(s) running` : "No active timers" })]
|
|
90
94
|
})]
|
|
91
95
|
})
|
|
92
96
|
}, {
|
|
@@ -94,16 +98,16 @@ function T() {
|
|
|
94
98
|
name: "Billable Hours Report",
|
|
95
99
|
typeLabel: "Billing",
|
|
96
100
|
typeVariant: "success",
|
|
97
|
-
period: `${n(
|
|
98
|
-
icon: /* @__PURE__ */
|
|
101
|
+
period: `${n(z.billableHours)} billable · ${G}% of tracked`,
|
|
102
|
+
icon: /* @__PURE__ */ S(y, { className: "h-5 w-5" }),
|
|
99
103
|
accent: "bg-status-success-bg text-status-success-text",
|
|
100
|
-
visual: /* @__PURE__ */
|
|
104
|
+
visual: /* @__PURE__ */ S(d, {
|
|
101
105
|
data: [{
|
|
102
106
|
label: "Billable",
|
|
103
|
-
hours:
|
|
107
|
+
hours: z.billableHours
|
|
104
108
|
}, {
|
|
105
109
|
label: "Non-billable",
|
|
106
|
-
hours:
|
|
110
|
+
hours: W
|
|
107
111
|
}],
|
|
108
112
|
xKey: "label",
|
|
109
113
|
series: [{
|
|
@@ -118,49 +122,49 @@ function T() {
|
|
|
118
122
|
ariaLabel: "Billable versus non-billable hours"
|
|
119
123
|
})
|
|
120
124
|
}] : [],
|
|
121
|
-
...
|
|
125
|
+
...B ? [{
|
|
122
126
|
id: "work-pattern",
|
|
123
127
|
name: "Work Pattern Analysis",
|
|
124
128
|
typeLabel: "Patterns",
|
|
125
129
|
typeVariant: "default",
|
|
126
|
-
period: `${n(
|
|
127
|
-
icon: /* @__PURE__ */
|
|
130
|
+
period: `${n(B.averageFocusHours)} avg focus · ${Math.round(B.averageProductivity)}% productivity`,
|
|
131
|
+
icon: /* @__PURE__ */ S(_, { className: "h-5 w-5" }),
|
|
128
132
|
accent: "bg-action-primary-bg/10 text-primary",
|
|
129
|
-
visual: /* @__PURE__ */
|
|
133
|
+
visual: /* @__PURE__ */ C("div", {
|
|
130
134
|
className: "space-y-2",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
132
|
-
value:
|
|
135
|
+
children: [/* @__PURE__ */ S(p, {
|
|
136
|
+
value: B.averageProductivity,
|
|
133
137
|
max: 100,
|
|
134
138
|
higherIsWorse: !1,
|
|
135
139
|
label: "Productivity",
|
|
136
140
|
format: (e) => `${Math.round(e)}%`,
|
|
137
141
|
size: "md"
|
|
138
|
-
}), (
|
|
142
|
+
}), (B.mostProductiveDay || B.leastProductiveDay) && /* @__PURE__ */ C("div", {
|
|
139
143
|
className: "flex flex-wrap items-center gap-2",
|
|
140
|
-
children: [
|
|
144
|
+
children: [B.mostProductiveDay && /* @__PURE__ */ S(u, {
|
|
141
145
|
variant: "success",
|
|
142
|
-
label: `Peak: ${
|
|
143
|
-
}),
|
|
146
|
+
label: `Peak: ${B.mostProductiveDay}`
|
|
147
|
+
}), B.leastProductiveDay && /* @__PURE__ */ S(u, {
|
|
144
148
|
variant: "muted",
|
|
145
|
-
label: `Quietest: ${
|
|
149
|
+
label: `Quietest: ${B.leastProductiveDay}`
|
|
146
150
|
})]
|
|
147
151
|
})]
|
|
148
152
|
})
|
|
149
153
|
}] : [],
|
|
150
|
-
...
|
|
154
|
+
...V ? [{
|
|
151
155
|
id: "focus-score",
|
|
152
156
|
name: "Focus Score Report",
|
|
153
157
|
typeLabel: "Productivity",
|
|
154
158
|
typeVariant: "warning",
|
|
155
|
-
period: `Avg ${Math.round(
|
|
156
|
-
icon: /* @__PURE__ */
|
|
159
|
+
period: `Avg ${Math.round(V.averageScore)} · High ${Math.round(V.highestScore)} · Low ${Math.round(V.lowestScore)}`,
|
|
160
|
+
icon: /* @__PURE__ */ S(g, { className: "h-5 w-5" }),
|
|
157
161
|
accent: "bg-status-warning-bg text-status-warning-text",
|
|
158
|
-
visual: /* @__PURE__ */
|
|
162
|
+
visual: /* @__PURE__ */ C("div", {
|
|
159
163
|
className: "flex items-center gap-4",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ S("div", {
|
|
161
165
|
className: "shrink-0",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
value:
|
|
166
|
+
children: /* @__PURE__ */ S(f, {
|
|
167
|
+
value: V.averageScore,
|
|
164
168
|
min: 0,
|
|
165
169
|
max: 100,
|
|
166
170
|
label: "Avg",
|
|
@@ -171,37 +175,37 @@ function T() {
|
|
|
171
175
|
height: 128,
|
|
172
176
|
className: "w-32"
|
|
173
177
|
})
|
|
174
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ C("div", {
|
|
175
179
|
className: "min-w-0 flex-1 space-y-1.5 text-xs",
|
|
176
180
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ C("div", {
|
|
178
182
|
className: "flex items-center justify-between",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ S("span", {
|
|
180
184
|
className: "text-text-secondary",
|
|
181
185
|
children: "Highest"
|
|
182
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ S("span", {
|
|
183
187
|
className: "font-semibold tabular-nums text-text-primary",
|
|
184
|
-
children: Math.round(
|
|
188
|
+
children: Math.round(V.highestScore)
|
|
185
189
|
})]
|
|
186
190
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ C("div", {
|
|
188
192
|
className: "flex items-center justify-between",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ S("span", {
|
|
190
194
|
className: "text-text-secondary",
|
|
191
195
|
children: "Lowest"
|
|
192
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ S("span", {
|
|
193
197
|
className: "font-semibold tabular-nums text-text-primary",
|
|
194
|
-
children: Math.round(
|
|
198
|
+
children: Math.round(V.lowestScore)
|
|
195
199
|
})]
|
|
196
200
|
}),
|
|
197
|
-
|
|
201
|
+
V.trend && /* @__PURE__ */ C("div", {
|
|
198
202
|
className: "flex items-center justify-between",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ S("span", {
|
|
200
204
|
className: "text-text-secondary",
|
|
201
205
|
children: "Trend"
|
|
202
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ S("span", {
|
|
203
207
|
className: "font-medium capitalize text-text-primary",
|
|
204
|
-
children:
|
|
208
|
+
children: V.trend
|
|
205
209
|
})]
|
|
206
210
|
})
|
|
207
211
|
]
|
|
@@ -209,71 +213,81 @@ function T() {
|
|
|
209
213
|
})
|
|
210
214
|
}] : []
|
|
211
215
|
];
|
|
212
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ C(l, {
|
|
213
217
|
title: "Reports",
|
|
214
218
|
description: "Generate and view time tracking reports",
|
|
215
|
-
purpose: "Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions.
|
|
216
|
-
actions: /* @__PURE__ */
|
|
217
|
-
onClick:
|
|
218
|
-
disabled:
|
|
219
|
+
purpose: "Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Generate a full report from your complete records on the server, or grab a quick summary CSV of the figures below.",
|
|
220
|
+
actions: /* @__PURE__ */ C("button", {
|
|
221
|
+
onClick: H,
|
|
222
|
+
disabled: D,
|
|
219
223
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70",
|
|
220
|
-
children: [/* @__PURE__ */ x
|
|
224
|
+
children: [/* @__PURE__ */ S(x, { className: `h-4 w-4 ${D ? "motion-safe:animate-spin" : ""}` }), D ? "Refreshing..." : "Refresh"]
|
|
221
225
|
}),
|
|
222
|
-
children:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ S("div", {
|
|
228
|
+
className: "mb-6",
|
|
229
|
+
children: /* @__PURE__ */ S(m, {})
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ S("h2", {
|
|
232
|
+
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
233
|
+
children: "Summary snapshots"
|
|
234
|
+
}),
|
|
235
|
+
K.length === 0 ? /* @__PURE__ */ S(i, {
|
|
236
|
+
illustration: "empty-data",
|
|
237
|
+
title: "No report data available yet",
|
|
238
|
+
description: "Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here."
|
|
239
|
+
}) : /* @__PURE__ */ S("div", {
|
|
240
|
+
className: "grid grid-cols-1 gap-4 xl:grid-cols-2",
|
|
241
|
+
children: K.map((e) => /* @__PURE__ */ C(w, {
|
|
242
|
+
treatment: "glass",
|
|
243
|
+
className: "flex flex-col p-4 sm:p-5",
|
|
244
|
+
children: [/* @__PURE__ */ C("div", {
|
|
245
|
+
className: "flex items-start justify-between gap-3",
|
|
246
|
+
children: [/* @__PURE__ */ C("div", {
|
|
247
|
+
className: "flex min-w-0 items-start gap-3",
|
|
240
248
|
children: [/* @__PURE__ */ S("div", {
|
|
241
|
-
className: "flex
|
|
242
|
-
children:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg", e.accent),
|
|
250
|
+
children: e.icon
|
|
251
|
+
}), /* @__PURE__ */ C("div", {
|
|
252
|
+
className: "min-w-0",
|
|
253
|
+
children: [/* @__PURE__ */ C("div", {
|
|
254
|
+
className: "flex flex-wrap items-center gap-2",
|
|
255
|
+
children: [/* @__PURE__ */ S("p", {
|
|
256
|
+
className: "text-sm font-semibold text-text-primary",
|
|
257
|
+
children: e.name
|
|
258
|
+
}), /* @__PURE__ */ S(u, {
|
|
259
|
+
variant: e.typeVariant,
|
|
260
|
+
label: e.typeLabel
|
|
261
|
+
})]
|
|
262
|
+
}), /* @__PURE__ */ S("p", {
|
|
263
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
264
|
+
children: e.period
|
|
248
265
|
})]
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
|
|
266
|
+
})]
|
|
267
|
+
}), /* @__PURE__ */ C("div", {
|
|
268
|
+
className: "flex shrink-0 items-center gap-2",
|
|
269
|
+
children: [/* @__PURE__ */ S(u, {
|
|
270
|
+
variant: "success",
|
|
271
|
+
label: "Ready",
|
|
272
|
+
dot: !0
|
|
273
|
+
}), /* @__PURE__ */ C("button", {
|
|
274
|
+
onClick: () => U(e.id),
|
|
275
|
+
title: "Download summary as CSV",
|
|
276
|
+
"aria-label": `Download ${e.name} summary as CSV`,
|
|
277
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken",
|
|
278
|
+
children: [/* @__PURE__ */ S(b, { className: "h-4 w-4" }), "CSV"]
|
|
252
279
|
})]
|
|
253
280
|
})]
|
|
254
281
|
}), /* @__PURE__ */ S("div", {
|
|
255
|
-
className: "
|
|
256
|
-
children:
|
|
257
|
-
variant: "success",
|
|
258
|
-
label: "Ready",
|
|
259
|
-
dot: !0
|
|
260
|
-
}), /* @__PURE__ */ S("button", {
|
|
261
|
-
onClick: () => H(e.id),
|
|
262
|
-
title: "Download as CSV",
|
|
263
|
-
"aria-label": `Download ${e.name} as CSV`,
|
|
264
|
-
className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken",
|
|
265
|
-
children: [/* @__PURE__ */ x(y, { className: "h-4 w-4" }), "CSV"]
|
|
266
|
-
})]
|
|
282
|
+
className: "mt-4 border-t border-border-subtle pt-4",
|
|
283
|
+
children: e.visual
|
|
267
284
|
})]
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
})]
|
|
272
|
-
}, e.id))
|
|
273
|
-
})
|
|
285
|
+
}, e.id))
|
|
286
|
+
})
|
|
287
|
+
]
|
|
274
288
|
});
|
|
275
289
|
}
|
|
276
290
|
//#endregion
|
|
277
|
-
export {
|
|
291
|
+
export { E as ReportsPage };
|
|
278
292
|
|
|
279
293
|
//# sourceMappingURL=ReportsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsPage.js","names":[],"sources":["../../../../src/timecampus/pages/dashboard/ReportsPage.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport {\n RefreshCw,\n Download,\n Clock,\n DollarSign,\n CalendarRange,\n Brain,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n StatusBadge,\n ProgressMeter,\n RadialGauge,\n BarsChart,\n} from \"../../components\";\nimport { cn, formatHours } from \"../../utils/helpers\";\n\n/** Trigger a client-side CSV download from an array of [key, value] rows. */\nfunction downloadCsv(filename: string, rows: Array<[string, string | number]>) {\n const escape = (v: string | number) => `\"${String(v).replace(/\"/g, '\"\"')}\"`;\n const csv = [\n \"Metric,Value\",\n ...rows.map(([k, v]) => `${escape(k)},${escape(v)}`),\n ].join(\"\\n\");\n const blob = new Blob([csv], { type: \"text/csv;charset=utf-8;\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n}\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetTimeEntryStatsQuery,\n useGetWorkPatternSummaryQuery,\n useGetFocusScoreSummaryQuery,\n} from \"@/generated/wspace-operations\";\nimport { usePageViewed } from \"../../analytics\";\n\ntype ReportTypeVariant = \"info\" | \"success\" | \"warning\" | \"default\";\n\ninterface ReportCard {\n id: string;\n name: string;\n typeLabel: string;\n typeVariant: ReportTypeVariant;\n period: string;\n icon: ReactNode;\n accent: string;\n visual: ReactNode;\n}\n\nexport function ReportsPage() {\n usePageViewed(\"reports\");\n const { workspaceId = \"\" } = useTimeCampus();\n const [refreshing, setRefreshing] = useState(false);\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n refetch: refetchStats,\n } = useGetTimeEntryStatsQuery({\n skip: !workspaceId,\n });\n\n const {\n data: patternData,\n loading: patternLoading,\n refetch: refetchPattern,\n } = useGetWorkPatternSummaryQuery({\n skip: !workspaceId,\n });\n\n const {\n data: focusData,\n loading: focusLoading,\n refetch: refetchFocus,\n } = useGetFocusScoreSummaryQuery({\n skip: !workspaceId,\n });\n\n const stats = statsData?.timeEntryStats;\n const pattern = patternData?.workPatternSummary;\n const focus = focusData?.focusScoreSummary;\n\n const handleRefresh = async () => {\n setRefreshing(true);\n try {\n await Promise.all([refetchStats(), refetchPattern(), refetchFocus()]);\n } finally {\n setRefreshing(false);\n }\n };\n\n const handleDownload = (reportId: string) => {\n if (\n (reportId === \"time-summary\" || reportId === \"billable-summary\") &&\n stats\n ) {\n downloadCsv(`${reportId}.csv`, [\n [\"Total hours\", Math.round(stats.totalHours)],\n [\"Billable hours\", Math.round(stats.billableHours)],\n [\"Total entries\", stats.totalEntries],\n [\"Active timers\", stats.activeTimers],\n ]);\n } else if (reportId === \"work-pattern\" && pattern) {\n downloadCsv(\"work-pattern-analysis.csv\", [\n [\"Average focus hours\", pattern.averageFocusHours.toFixed(1)],\n [\"Average productivity %\", Math.round(pattern.averageProductivity)],\n ]);\n } else if (reportId === \"focus-score\" && focus) {\n downloadCsv(\"focus-score-report.csv\", [\n [\"Average score\", Math.round(focus.averageScore)],\n [\"Highest score\", Math.round(focus.highestScore)],\n [\"Lowest score\", Math.round(focus.lowestScore)],\n ]);\n }\n };\n\n const isLoading = statsLoading || patternLoading || focusLoading;\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n actions={\n <button\n disabled\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Refresh\n </button>\n }\n >\n <LoadingSkeleton variant=\"list\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n >\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load reports data. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n // Derived, real figures shared by the report visuals.\n const nonBillableHours = stats\n ? Math.max(0, stats.totalHours - stats.billableHours)\n : 0;\n const billablePct =\n stats && stats.totalHours > 0\n ? Math.round((stats.billableHours / stats.totalHours) * 100)\n : 0;\n\n // Build dynamic report cards from available analytics data. Each carries a\n // small, real visual fed only by the aggregate the page already fetched.\n const reports: ReportCard[] = [\n ...(stats\n ? [\n {\n id: \"time-summary\",\n name: \"Time Tracking Summary\",\n typeLabel: \"Time\",\n typeVariant: \"info\" as const,\n period: `${formatHours(stats.totalHours)} total · ${stats.totalEntries} entries`,\n icon: <Clock className=\"h-5 w-5\" />,\n accent: \"bg-status-info-bg text-status-info-text\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={stats.billableHours}\n max={stats.totalHours > 0 ? stats.totalHours : 1}\n higherIsWorse={false}\n label=\"Billable share\"\n format={formatHours}\n size=\"md\"\n />\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>{stats.totalEntries} entries logged</span>\n <span>\n {stats.activeTimers > 0\n ? `${stats.activeTimers} timer(s) running`\n : \"No active timers\"}\n </span>\n </div>\n </div>\n ),\n },\n {\n id: \"billable-summary\",\n name: \"Billable Hours Report\",\n typeLabel: \"Billing\",\n typeVariant: \"success\" as const,\n period: `${formatHours(stats.billableHours)} billable · ${billablePct}% of tracked`,\n icon: <DollarSign className=\"h-5 w-5\" />,\n accent: \"bg-status-success-bg text-status-success-text\",\n visual: (\n <BarsChart\n data={[\n { label: \"Billable\", hours: stats.billableHours },\n { label: \"Non-billable\", hours: nonBillableHours },\n ]}\n xKey=\"label\"\n series={[{ key: \"hours\", label: \"Hours\" }]}\n orientation=\"horizontal\"\n valueFormat={formatHours}\n categoryWidth={92}\n height={120}\n showGrid={false}\n ariaLabel=\"Billable versus non-billable hours\"\n />\n ),\n },\n ]\n : []),\n ...(pattern\n ? [\n {\n id: \"work-pattern\",\n name: \"Work Pattern Analysis\",\n typeLabel: \"Patterns\",\n typeVariant: \"default\" as const,\n period: `${formatHours(pattern.averageFocusHours)} avg focus · ${Math.round(pattern.averageProductivity)}% productivity`,\n icon: <CalendarRange className=\"h-5 w-5\" />,\n accent: \"bg-action-primary-bg/10 text-primary\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={pattern.averageProductivity}\n max={100}\n higherIsWorse={false}\n label=\"Productivity\"\n format={(v) => `${Math.round(v)}%`}\n size=\"md\"\n />\n {(pattern.mostProductiveDay || pattern.leastProductiveDay) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {pattern.mostProductiveDay && (\n <StatusBadge\n variant=\"success\"\n label={`Peak: ${pattern.mostProductiveDay}`}\n />\n )}\n {pattern.leastProductiveDay && (\n <StatusBadge\n variant=\"muted\"\n label={`Quietest: ${pattern.leastProductiveDay}`}\n />\n )}\n </div>\n )}\n </div>\n ),\n },\n ]\n : []),\n ...(focus\n ? [\n {\n id: \"focus-score\",\n name: \"Focus Score Report\",\n typeLabel: \"Productivity\",\n typeVariant: \"warning\" as const,\n period: `Avg ${Math.round(focus.averageScore)} · High ${Math.round(focus.highestScore)} · Low ${Math.round(focus.lowestScore)}`,\n icon: <Brain className=\"h-5 w-5\" />,\n accent: \"bg-status-warning-bg text-status-warning-text\",\n visual: (\n <div className=\"flex items-center gap-4\">\n <div className=\"shrink-0\">\n <RadialGauge\n value={focus.averageScore}\n min={0}\n max={100}\n label=\"Avg\"\n thresholds={{ warning: 75, danger: 50 }}\n height={128}\n className=\"w-32\"\n />\n </div>\n <div className=\"min-w-0 flex-1 space-y-1.5 text-xs\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Highest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.highestScore)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Lowest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.lowestScore)}\n </span>\n </div>\n {focus.trend && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Trend</span>\n <span className=\"font-medium capitalize text-text-primary\">\n {focus.trend}\n </span>\n </div>\n )}\n </div>\n </div>\n ),\n },\n ]\n : []),\n ];\n\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n purpose=\"Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Reports build automatically from your data; refresh to pull the latest, and download any report as CSV.\"\n actions={\n <button\n onClick={handleRefresh}\n disabled={refreshing}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70\"\n >\n <RefreshCw\n className={`h-4 w-4 ${refreshing ? \"motion-safe:animate-spin\" : \"\"}`}\n />\n {refreshing ? \"Refreshing...\" : \"Refresh\"}\n </button>\n }\n >\n {reports.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No report data available yet\"\n description=\"Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here.\"\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 xl:grid-cols-2\">\n {reports.map((report) => (\n <GlassCard\n key={report.id}\n treatment=\"glass\"\n className=\"flex flex-col p-4 sm:p-5\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-3\">\n <div\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg\",\n report.accent,\n )}\n >\n {report.icon}\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">\n {report.name}\n </p>\n <StatusBadge\n variant={report.typeVariant}\n label={report.typeLabel}\n />\n </div>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {report.period}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <StatusBadge variant=\"success\" label=\"Ready\" dot />\n <button\n onClick={() => handleDownload(report.id)}\n title=\"Download as CSV\"\n aria-label={`Download ${report.name} as CSV`}\n className=\"inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken\"\n >\n <Download className=\"h-4 w-4\" />\n CSV\n </button>\n </div>\n </div>\n <div className=\"mt-4 border-t border-border-subtle pt-4\">\n {report.visual}\n </div>\n </GlassCard>\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,SAAS,EAAY,GAAkB,GAAwC;CAC7E,IAAM,KAAU,MAAuB,IAAI,O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EAAe,EAAO,EAAE;OACvC,OAAM;OACN,cAAY,YAAY,EAAO,KAAK;OACpC,WAAU;OAJZ,UAAA,CAME,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA,GAAC,KAE1B;MACL,CAAA,CAAA;KACF,CAAA,CAAA;IACL,CAAA,GAAA,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAA,EAAO;IACL,CAAA,CACI;GA7CJ,GAAA,EAAO,EA6CH,CACZ;EACE,CAAA;CAEG,CAAA;AAEhB"}
|
|
1
|
+
{"version":3,"file":"ReportsPage.js","names":[],"sources":["../../../../src/timecampus/pages/dashboard/ReportsPage.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport {\n RefreshCw,\n Download,\n Clock,\n DollarSign,\n CalendarRange,\n Brain,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n StatusBadge,\n ProgressMeter,\n RadialGauge,\n BarsChart,\n} from \"../../components\";\nimport { cn, formatHours } from \"../../utils/helpers\";\nimport { ServerReportExports } from \"./ServerReportExports\";\n\n/** Trigger a client-side CSV download from an array of [key, value] rows. */\nfunction downloadCsv(filename: string, rows: Array<[string, string | number]>) {\n const escape = (v: string | number) => `\"${String(v).replace(/\"/g, '\"\"')}\"`;\n const csv = [\n \"Metric,Value\",\n ...rows.map(([k, v]) => `${escape(k)},${escape(v)}`),\n ].join(\"\\n\");\n const blob = new Blob([csv], { type: \"text/csv;charset=utf-8;\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n}\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetTimeEntryStatsQuery,\n useGetWorkPatternSummaryQuery,\n useGetFocusScoreSummaryQuery,\n} from \"@/generated/wspace-operations\";\nimport { usePageViewed } from \"../../analytics\";\n\ntype ReportTypeVariant = \"info\" | \"success\" | \"warning\" | \"default\";\n\ninterface ReportCard {\n id: string;\n name: string;\n typeLabel: string;\n typeVariant: ReportTypeVariant;\n period: string;\n icon: ReactNode;\n accent: string;\n visual: ReactNode;\n}\n\nexport function ReportsPage() {\n usePageViewed(\"reports\");\n const { workspaceId = \"\" } = useTimeCampus();\n const [refreshing, setRefreshing] = useState(false);\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n refetch: refetchStats,\n } = useGetTimeEntryStatsQuery({\n skip: !workspaceId,\n });\n\n const {\n data: patternData,\n loading: patternLoading,\n refetch: refetchPattern,\n } = useGetWorkPatternSummaryQuery({\n skip: !workspaceId,\n });\n\n const {\n data: focusData,\n loading: focusLoading,\n refetch: refetchFocus,\n } = useGetFocusScoreSummaryQuery({\n skip: !workspaceId,\n });\n\n const stats = statsData?.timeEntryStats;\n const pattern = patternData?.workPatternSummary;\n const focus = focusData?.focusScoreSummary;\n\n const handleRefresh = async () => {\n setRefreshing(true);\n try {\n await Promise.all([refetchStats(), refetchPattern(), refetchFocus()]);\n } finally {\n setRefreshing(false);\n }\n };\n\n const handleDownload = (reportId: string) => {\n if (\n (reportId === \"time-summary\" || reportId === \"billable-summary\") &&\n stats\n ) {\n downloadCsv(`${reportId}.csv`, [\n [\"Total hours\", Math.round(stats.totalHours)],\n [\"Billable hours\", Math.round(stats.billableHours)],\n [\"Total entries\", stats.totalEntries],\n [\"Active timers\", stats.activeTimers],\n ]);\n } else if (reportId === \"work-pattern\" && pattern) {\n downloadCsv(\"work-pattern-analysis.csv\", [\n [\"Average focus hours\", pattern.averageFocusHours.toFixed(1)],\n [\"Average productivity %\", Math.round(pattern.averageProductivity)],\n ]);\n } else if (reportId === \"focus-score\" && focus) {\n downloadCsv(\"focus-score-report.csv\", [\n [\"Average score\", Math.round(focus.averageScore)],\n [\"Highest score\", Math.round(focus.highestScore)],\n [\"Lowest score\", Math.round(focus.lowestScore)],\n ]);\n }\n };\n\n // Gate the skeleton on the first load only. A Refresh refetch must not\n // swap the page for a skeleton, or the report builder below would unmount\n // and lose the exports generated this session.\n const isLoading =\n (statsLoading && !statsData) ||\n (patternLoading && !patternData) ||\n (focusLoading && !focusData);\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n actions={\n <button\n disabled\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Refresh\n </button>\n }\n >\n <LoadingSkeleton variant=\"list\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n >\n <div className=\"mb-6\">\n <ServerReportExports />\n </div>\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load the summary figures. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n // Derived, real figures shared by the report visuals.\n const nonBillableHours = stats\n ? Math.max(0, stats.totalHours - stats.billableHours)\n : 0;\n const billablePct =\n stats && stats.totalHours > 0\n ? Math.round((stats.billableHours / stats.totalHours) * 100)\n : 0;\n\n // Build dynamic report cards from available analytics data. Each carries a\n // small, real visual fed only by the aggregate the page already fetched.\n const reports: ReportCard[] = [\n ...(stats\n ? [\n {\n id: \"time-summary\",\n name: \"Time Tracking Summary\",\n typeLabel: \"Time\",\n typeVariant: \"info\" as const,\n period: `${formatHours(stats.totalHours)} total · ${stats.totalEntries} entries`,\n icon: <Clock className=\"h-5 w-5\" />,\n accent: \"bg-status-info-bg text-status-info-text\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={stats.billableHours}\n max={stats.totalHours > 0 ? stats.totalHours : 1}\n higherIsWorse={false}\n label=\"Billable share\"\n format={formatHours}\n size=\"md\"\n />\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>{stats.totalEntries} entries logged</span>\n <span>\n {stats.activeTimers > 0\n ? `${stats.activeTimers} timer(s) running`\n : \"No active timers\"}\n </span>\n </div>\n </div>\n ),\n },\n {\n id: \"billable-summary\",\n name: \"Billable Hours Report\",\n typeLabel: \"Billing\",\n typeVariant: \"success\" as const,\n period: `${formatHours(stats.billableHours)} billable · ${billablePct}% of tracked`,\n icon: <DollarSign className=\"h-5 w-5\" />,\n accent: \"bg-status-success-bg text-status-success-text\",\n visual: (\n <BarsChart\n data={[\n { label: \"Billable\", hours: stats.billableHours },\n { label: \"Non-billable\", hours: nonBillableHours },\n ]}\n xKey=\"label\"\n series={[{ key: \"hours\", label: \"Hours\" }]}\n orientation=\"horizontal\"\n valueFormat={formatHours}\n categoryWidth={92}\n height={120}\n showGrid={false}\n ariaLabel=\"Billable versus non-billable hours\"\n />\n ),\n },\n ]\n : []),\n ...(pattern\n ? [\n {\n id: \"work-pattern\",\n name: \"Work Pattern Analysis\",\n typeLabel: \"Patterns\",\n typeVariant: \"default\" as const,\n period: `${formatHours(pattern.averageFocusHours)} avg focus · ${Math.round(pattern.averageProductivity)}% productivity`,\n icon: <CalendarRange className=\"h-5 w-5\" />,\n accent: \"bg-action-primary-bg/10 text-primary\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={pattern.averageProductivity}\n max={100}\n higherIsWorse={false}\n label=\"Productivity\"\n format={(v) => `${Math.round(v)}%`}\n size=\"md\"\n />\n {(pattern.mostProductiveDay || pattern.leastProductiveDay) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {pattern.mostProductiveDay && (\n <StatusBadge\n variant=\"success\"\n label={`Peak: ${pattern.mostProductiveDay}`}\n />\n )}\n {pattern.leastProductiveDay && (\n <StatusBadge\n variant=\"muted\"\n label={`Quietest: ${pattern.leastProductiveDay}`}\n />\n )}\n </div>\n )}\n </div>\n ),\n },\n ]\n : []),\n ...(focus\n ? [\n {\n id: \"focus-score\",\n name: \"Focus Score Report\",\n typeLabel: \"Productivity\",\n typeVariant: \"warning\" as const,\n period: `Avg ${Math.round(focus.averageScore)} · High ${Math.round(focus.highestScore)} · Low ${Math.round(focus.lowestScore)}`,\n icon: <Brain className=\"h-5 w-5\" />,\n accent: \"bg-status-warning-bg text-status-warning-text\",\n visual: (\n <div className=\"flex items-center gap-4\">\n <div className=\"shrink-0\">\n <RadialGauge\n value={focus.averageScore}\n min={0}\n max={100}\n label=\"Avg\"\n thresholds={{ warning: 75, danger: 50 }}\n height={128}\n className=\"w-32\"\n />\n </div>\n <div className=\"min-w-0 flex-1 space-y-1.5 text-xs\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Highest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.highestScore)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Lowest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.lowestScore)}\n </span>\n </div>\n {focus.trend && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Trend</span>\n <span className=\"font-medium capitalize text-text-primary\">\n {focus.trend}\n </span>\n </div>\n )}\n </div>\n </div>\n ),\n },\n ]\n : []),\n ];\n\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n purpose=\"Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Generate a full report from your complete records on the server, or grab a quick summary CSV of the figures below.\"\n actions={\n <button\n onClick={handleRefresh}\n disabled={refreshing}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70\"\n >\n <RefreshCw\n className={`h-4 w-4 ${refreshing ? \"motion-safe:animate-spin\" : \"\"}`}\n />\n {refreshing ? \"Refreshing...\" : \"Refresh\"}\n </button>\n }\n >\n <div className=\"mb-6\">\n <ServerReportExports />\n </div>\n <h2 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Summary snapshots\n </h2>\n {reports.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No report data available yet\"\n description=\"Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here.\"\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 xl:grid-cols-2\">\n {reports.map((report) => (\n <GlassCard\n key={report.id}\n treatment=\"glass\"\n className=\"flex flex-col p-4 sm:p-5\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-3\">\n <div\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg\",\n report.accent,\n )}\n >\n {report.icon}\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">\n {report.name}\n </p>\n <StatusBadge\n variant={report.typeVariant}\n label={report.typeLabel}\n />\n </div>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {report.period}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <StatusBadge variant=\"success\" label=\"Ready\" dot />\n <button\n onClick={() => handleDownload(report.id)}\n title=\"Download summary as CSV\"\n aria-label={`Download ${report.name} summary as CSV`}\n className=\"inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken\"\n >\n <Download className=\"h-4 w-4\" />\n CSV\n </button>\n </div>\n </div>\n <div className=\"mt-4 border-t border-border-subtle pt-4\">\n {report.visual}\n </div>\n </GlassCard>\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,SAAS,EAAY,GAAkB,GAAwC;CAC7E,IAAM,KAAU,MAAuB,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,MAAI,EAAE,IACnE,IAAM,CACV,gBACA,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AO;QACP,CAAA,CACA;OACF,CAAA,CAAA;MACL,CAAA,GAAA,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,GAAD;QAAa,SAAQ;QAAU,OAAM;QAAQ,KAAA;OAAK,CAAA,GAClD,kBAAC,UAAD;QACE,eAAe,EAAe,EAAO,EAAE;QACvC,OAAM;QACN,cAAY,YAAY,EAAO,KAAK;QACpC,WAAU;QAJZ,UAAA,CAME,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA,GAAC,KAE1B;OACL,CAAA,CAAA;MACF,CAAA,CAAA;KACL,CAAA,GAAA,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,EAAO;KACL,CAAA,CACI;IA7CJ,GAAA,EAAO,EA6CH,CACZ;GACE,CAAA;EAEG;;AAEhB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side report builder: pick a template, a period and a format, and
|
|
3
|
+
* wspace-export-svc builds the full dataset asynchronously.
|
|
4
|
+
*/
|
|
5
|
+
export declare function ServerReportExports(): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ServerReportExports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerReportExports.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/dashboard/ServerReportExports.tsx"],"names":[],"mappings":"AAoLA;;;GAGG;AACH,wBAAgB,mBAAmB,gCA4JlC"}
|