@burdenoff/microfe-movethewheels 2026.1026.2 → 2026.1026.3
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/MoveTheWheelsRoot.js +126 -159
- package/dist/MoveTheWheelsRoutes.js +16 -32
- package/dist/hooks/index.js +0 -3
- package/dist/index.js +27 -30
- package/dist/movethewheels/hooks/index.d.ts +0 -3
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoot.tsx +2 -46
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +0 -16
- package/src/movethewheels/hooks/index.ts +0 -9
- package/dist/hooks/useImportExport.js +0 -27
- package/dist/hooks/useReports.js +0 -75
- package/dist/hooks/useSettings.js +0 -67
- package/dist/movethewheels/hooks/useImportExport.d.ts +0 -23
- package/dist/movethewheels/hooks/useReports.d.ts +0 -39
- package/dist/movethewheels/hooks/useSettings.d.ts +0 -17
- package/dist/movethewheels/pages/ImportExportPage.d.ts +0 -8
- package/dist/movethewheels/pages/MarketplacePage.d.ts +0 -12
- package/dist/movethewheels/pages/ReportsPage.d.ts +0 -8
- package/dist/movethewheels/pages/SettingsPage.d.ts +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +0 -11
- package/dist/node_modules/lucide-react/dist/esm/icons/file-chart-column-increasing.js +0 -26
- package/dist/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js +0 -30
- package/dist/node_modules/lucide-react/dist/esm/icons/globe.js +0 -20
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +0 -13
- package/dist/node_modules/lucide-react/dist/esm/icons/shield.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/store.js +0 -26
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +0 -18
- package/dist/pages/ImportExportPage.js +0 -245
- package/dist/pages/MarketplacePage.js +0 -23
- package/dist/pages/ReportsPage.js +0 -328
- package/dist/pages/SettingsPage.js +0 -404
- package/dist/utils/download.js +0 -22
- package/src/movethewheels/hooks/useImportExport.ts +0 -65
- package/src/movethewheels/hooks/useReports.ts +0 -154
- package/src/movethewheels/hooks/useSettings.ts +0 -124
- package/src/movethewheels/pages/ImportExportPage.tsx +0 -288
- package/src/movethewheels/pages/MarketplacePage.tsx +0 -36
- package/src/movethewheels/pages/ReportsPage.tsx +0 -379
- package/src/movethewheels/pages/SettingsPage.tsx +0 -548
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +0 -59
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +0 -93
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +0 -58
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
-
//#region node_modules/lucide-react/dist/esm/icons/shield.js
|
|
3
|
-
var t = e("Shield", [["path", {
|
|
4
|
-
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
5
|
-
key: "oel41y"
|
|
6
|
-
}]]);
|
|
7
|
-
//#endregion
|
|
8
|
-
export { t as Shield };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
-
//#region node_modules/lucide-react/dist/esm/icons/store.js
|
|
3
|
-
var t = e("Store", [
|
|
4
|
-
["path", {
|
|
5
|
-
d: "m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",
|
|
6
|
-
key: "ztvudi"
|
|
7
|
-
}],
|
|
8
|
-
["path", {
|
|
9
|
-
d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",
|
|
10
|
-
key: "1b2hhj"
|
|
11
|
-
}],
|
|
12
|
-
["path", {
|
|
13
|
-
d: "M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",
|
|
14
|
-
key: "2ebpfo"
|
|
15
|
-
}],
|
|
16
|
-
["path", {
|
|
17
|
-
d: "M2 7h20",
|
|
18
|
-
key: "1fcdvo"
|
|
19
|
-
}],
|
|
20
|
-
["path", {
|
|
21
|
-
d: "M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",
|
|
22
|
-
key: "6c3vgh"
|
|
23
|
-
}]
|
|
24
|
-
]);
|
|
25
|
-
//#endregion
|
|
26
|
-
export { t as Store };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
-
//#region node_modules/lucide-react/dist/esm/icons/webhook.js
|
|
3
|
-
var t = e("Webhook", [
|
|
4
|
-
["path", {
|
|
5
|
-
d: "M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",
|
|
6
|
-
key: "q3hayz"
|
|
7
|
-
}],
|
|
8
|
-
["path", {
|
|
9
|
-
d: "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",
|
|
10
|
-
key: "1go1hn"
|
|
11
|
-
}],
|
|
12
|
-
["path", {
|
|
13
|
-
d: "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",
|
|
14
|
-
key: "qlwsc0"
|
|
15
|
-
}]
|
|
16
|
-
]);
|
|
17
|
-
//#endregion
|
|
18
|
-
export { t as Webhook };
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { Check as e } from "../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
2
|
-
import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/download.js";
|
|
3
|
-
import { FileSpreadsheet as n } from "../node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js";
|
|
4
|
-
import { FileText as r } from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
|
|
5
|
-
import { Upload as i } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
|
|
6
|
-
import { X as a } from "../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
7
|
-
import { useImportExport as o } from "../hooks/useImportExport.js";
|
|
8
|
-
import { Badge as s, Button as c, Card as l, CardContent as u, CardHeader as d, CardTitle as f } from "../components/ui.js";
|
|
9
|
-
import { PageLayout as p } from "../components/PageLayout.js";
|
|
10
|
-
import { useRef as m, useState as h } from "react";
|
|
11
|
-
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
|
-
import { EmphasisPanel as v, IllustratedEmptyState as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
13
|
-
//#region src/movethewheels/pages/ImportExportPage.tsx
|
|
14
|
-
var x = [
|
|
15
|
-
{
|
|
16
|
-
name: "Orders",
|
|
17
|
-
description: "Import orders from CSV or JSON",
|
|
18
|
-
resource: "orders"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "Customers",
|
|
22
|
-
description: "Import customer database",
|
|
23
|
-
resource: "customers"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "Products",
|
|
27
|
-
description: "Import product catalog",
|
|
28
|
-
resource: "products"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "Inventory",
|
|
32
|
-
description: "Import inventory levels",
|
|
33
|
-
resource: "inventory"
|
|
34
|
-
}
|
|
35
|
-
], S = [
|
|
36
|
-
{
|
|
37
|
-
name: "Orders Report",
|
|
38
|
-
description: "Export all orders data",
|
|
39
|
-
resource: "orders",
|
|
40
|
-
formats: ["CSV", "JSON"]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: "Financial Report",
|
|
44
|
-
description: "Export revenue and payments",
|
|
45
|
-
resource: "finance",
|
|
46
|
-
formats: ["CSV", "JSON"]
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "Fleet Report",
|
|
50
|
-
description: "Export vehicle and driver data",
|
|
51
|
-
resource: "fleet",
|
|
52
|
-
formats: ["CSV", "JSON"]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: "Analytics Report",
|
|
56
|
-
description: "Export performance metrics",
|
|
57
|
-
resource: "analytics",
|
|
58
|
-
formats: ["CSV", "JSON"]
|
|
59
|
-
}
|
|
60
|
-
];
|
|
61
|
-
function C() {
|
|
62
|
-
let { exportData: C, importData: w, isBusy: T } = o(), [E, D] = h([]), [O, k] = h(null), A = m(null), j = m(null), M = (e) => D((t) => [e, ...t]), N = async (e, t) => {
|
|
63
|
-
k(`${e.resource}:${t}`);
|
|
64
|
-
try {
|
|
65
|
-
let n = await C(e.resource, t);
|
|
66
|
-
if (n.success && n.payload) {
|
|
67
|
-
let r = JSON.stringify(n.payload, null, 2), i = new Blob([r], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
68
|
-
o.href = a, o.download = `${e.resource}-export.${t.toLowerCase() === "csv" ? "csv" : "json"}`, document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(a);
|
|
69
|
-
}
|
|
70
|
-
M({
|
|
71
|
-
type: "export",
|
|
72
|
-
name: `${e.name} (${t})`,
|
|
73
|
-
at: /* @__PURE__ */ new Date(),
|
|
74
|
-
success: n.success,
|
|
75
|
-
message: n.message
|
|
76
|
-
});
|
|
77
|
-
} catch (n) {
|
|
78
|
-
M({
|
|
79
|
-
type: "export",
|
|
80
|
-
name: `${e.name} (${t})`,
|
|
81
|
-
at: /* @__PURE__ */ new Date(),
|
|
82
|
-
success: !1,
|
|
83
|
-
message: n instanceof Error ? n.message : "Export failed"
|
|
84
|
-
});
|
|
85
|
-
} finally {
|
|
86
|
-
k(null);
|
|
87
|
-
}
|
|
88
|
-
}, P = (e) => {
|
|
89
|
-
j.current = e, A.current?.click();
|
|
90
|
-
};
|
|
91
|
-
return /* @__PURE__ */ _(p, {
|
|
92
|
-
title: "Import / Export",
|
|
93
|
-
subtitle: "Import and export your data",
|
|
94
|
-
icon: /* @__PURE__ */ g(r, { size: 24 }),
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ g(b, {
|
|
97
|
-
icon: /* @__PURE__ */ g(r, { size: 18 }),
|
|
98
|
-
children: "Move data in and out in bulk. Import orders, customers, products or inventory from CSV/JSON to onboard or migrate without re-keying, and export any dataset for accounting, BI tools or backups — no manual copy-paste required."
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ g("input", {
|
|
101
|
-
ref: A,
|
|
102
|
-
type: "file",
|
|
103
|
-
accept: ".csv,.json,application/json,text/csv",
|
|
104
|
-
className: "hidden",
|
|
105
|
-
onChange: async (e) => {
|
|
106
|
-
let t = e.target.files?.[0], n = j.current;
|
|
107
|
-
if (e.target.value = "", !(!t || !n)) {
|
|
108
|
-
k(`import:${n.resource}`);
|
|
109
|
-
try {
|
|
110
|
-
let e = await t.text(), r = await w(n.resource, {
|
|
111
|
-
filename: t.name,
|
|
112
|
-
content: e
|
|
113
|
-
});
|
|
114
|
-
M({
|
|
115
|
-
type: "import",
|
|
116
|
-
name: `${n.name} — ${t.name}`,
|
|
117
|
-
at: /* @__PURE__ */ new Date(),
|
|
118
|
-
success: r.success,
|
|
119
|
-
message: r.message
|
|
120
|
-
});
|
|
121
|
-
} catch (e) {
|
|
122
|
-
M({
|
|
123
|
-
type: "import",
|
|
124
|
-
name: `${n.name} — ${t.name}`,
|
|
125
|
-
at: /* @__PURE__ */ new Date(),
|
|
126
|
-
success: !1,
|
|
127
|
-
message: e instanceof Error ? e.message : "Import failed"
|
|
128
|
-
});
|
|
129
|
-
} finally {
|
|
130
|
-
k(null);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ _("div", {
|
|
136
|
-
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
137
|
-
children: [/* @__PURE__ */ _(v, {
|
|
138
|
-
className: "space-y-4",
|
|
139
|
-
children: [/* @__PURE__ */ _("h2", {
|
|
140
|
-
className: "flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
141
|
-
children: [/* @__PURE__ */ g(i, { size: 18 }), " Import Data"]
|
|
142
|
-
}), /* @__PURE__ */ g("div", {
|
|
143
|
-
className: "space-y-4",
|
|
144
|
-
children: x.map((e) => /* @__PURE__ */ _("div", {
|
|
145
|
-
className: "flex items-center justify-between p-4 border rounded-lg hover:border-primary/50 transition-colors",
|
|
146
|
-
children: [/* @__PURE__ */ _("div", {
|
|
147
|
-
className: "flex items-center gap-3",
|
|
148
|
-
children: [/* @__PURE__ */ g("div", {
|
|
149
|
-
className: "w-10 h-10 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
150
|
-
children: /* @__PURE__ */ g(n, {
|
|
151
|
-
size: 20,
|
|
152
|
-
className: "text-primary"
|
|
153
|
-
})
|
|
154
|
-
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
155
|
-
className: "font-medium",
|
|
156
|
-
children: e.name
|
|
157
|
-
}), /* @__PURE__ */ g("p", {
|
|
158
|
-
className: "text-sm text-text-secondary",
|
|
159
|
-
children: e.description
|
|
160
|
-
})] })]
|
|
161
|
-
}), /* @__PURE__ */ _("div", {
|
|
162
|
-
className: "text-right",
|
|
163
|
-
children: [/* @__PURE__ */ g(s, {
|
|
164
|
-
variant: "outline",
|
|
165
|
-
children: "CSV, JSON"
|
|
166
|
-
}), /* @__PURE__ */ g(c, {
|
|
167
|
-
variant: "outline",
|
|
168
|
-
size: "sm",
|
|
169
|
-
className: "ml-2",
|
|
170
|
-
"aria-label": `Import ${e.name}`,
|
|
171
|
-
disabled: T,
|
|
172
|
-
onClick: () => P(e),
|
|
173
|
-
children: /* @__PURE__ */ g(i, { size: 14 })
|
|
174
|
-
})]
|
|
175
|
-
})]
|
|
176
|
-
}, e.name))
|
|
177
|
-
})]
|
|
178
|
-
}), /* @__PURE__ */ _(l, { children: [/* @__PURE__ */ g(d, { children: /* @__PURE__ */ _(f, {
|
|
179
|
-
className: "flex items-center gap-2",
|
|
180
|
-
children: [/* @__PURE__ */ g(t, { size: 18 }), " Export Data"]
|
|
181
|
-
}) }), /* @__PURE__ */ g(u, {
|
|
182
|
-
className: "space-y-4",
|
|
183
|
-
children: S.map((e) => /* @__PURE__ */ _("div", {
|
|
184
|
-
className: "flex items-center justify-between p-4 border rounded-lg hover:border-primary/50 transition-colors",
|
|
185
|
-
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
186
|
-
className: "font-medium",
|
|
187
|
-
children: e.name
|
|
188
|
-
}), /* @__PURE__ */ g("p", {
|
|
189
|
-
className: "text-sm text-text-secondary",
|
|
190
|
-
children: e.description
|
|
191
|
-
})] }), /* @__PURE__ */ g("div", {
|
|
192
|
-
className: "flex gap-1",
|
|
193
|
-
children: e.formats.map((t) => /* @__PURE__ */ g(c, {
|
|
194
|
-
variant: "outline",
|
|
195
|
-
size: "sm",
|
|
196
|
-
disabled: O === `${e.resource}:${t}`,
|
|
197
|
-
onClick: () => void N(e, t),
|
|
198
|
-
children: t
|
|
199
|
-
}, t))
|
|
200
|
-
})]
|
|
201
|
-
}, e.name))
|
|
202
|
-
})] })]
|
|
203
|
-
}),
|
|
204
|
-
/* @__PURE__ */ _(l, { children: [/* @__PURE__ */ g(d, { children: /* @__PURE__ */ g(f, { children: "Recent Activity" }) }), /* @__PURE__ */ g(u, { children: E.length === 0 ? /* @__PURE__ */ g(y, {
|
|
205
|
-
illustration: "empty-data",
|
|
206
|
-
title: "No import or export activity yet",
|
|
207
|
-
description: "Your recent imports and exports will show up here once you run one."
|
|
208
|
-
}) : /* @__PURE__ */ g("div", {
|
|
209
|
-
className: "space-y-3",
|
|
210
|
-
children: E.map((n, r) => /* @__PURE__ */ _("div", {
|
|
211
|
-
className: "flex items-center justify-between p-3 bg-bg-sunken/50 rounded-lg",
|
|
212
|
-
children: [/* @__PURE__ */ _("div", {
|
|
213
|
-
className: "flex items-center gap-3",
|
|
214
|
-
children: [n.type === "import" ? /* @__PURE__ */ g(i, {
|
|
215
|
-
size: 16,
|
|
216
|
-
className: "text-primary"
|
|
217
|
-
}) : /* @__PURE__ */ g(t, {
|
|
218
|
-
size: 16,
|
|
219
|
-
className: "text-primary"
|
|
220
|
-
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
221
|
-
className: "font-medium",
|
|
222
|
-
children: n.name
|
|
223
|
-
}), /* @__PURE__ */ _("p", {
|
|
224
|
-
className: "text-sm text-text-secondary",
|
|
225
|
-
children: [
|
|
226
|
-
n.type === "import" ? "Imported" : "Exported",
|
|
227
|
-
" at",
|
|
228
|
-
" ",
|
|
229
|
-
n.at.toLocaleTimeString(),
|
|
230
|
-
" — ",
|
|
231
|
-
n.message
|
|
232
|
-
]
|
|
233
|
-
})] })]
|
|
234
|
-
}), /* @__PURE__ */ _(s, {
|
|
235
|
-
variant: n.success ? "default" : "destructive",
|
|
236
|
-
className: "gap-1",
|
|
237
|
-
children: [n.success ? /* @__PURE__ */ g(e, { size: 12 }) : /* @__PURE__ */ g(a, { size: 12 }), n.success ? "done" : "failed"]
|
|
238
|
-
})]
|
|
239
|
-
}, r))
|
|
240
|
-
}) })] })
|
|
241
|
-
]
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
//#endregion
|
|
245
|
-
export { C as default };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Store as e } from "../node_modules/lucide-react/dist/esm/icons/store.js";
|
|
2
|
-
import { Card as t, CardContent as n } from "../components/ui.js";
|
|
3
|
-
import { PageLayout as r } from "../components/PageLayout.js";
|
|
4
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
-
import { IllustratedEmptyState as a } from "@burdenoff/fe-libs/ui";
|
|
6
|
-
//#region src/movethewheels/pages/MarketplacePage.tsx
|
|
7
|
-
function o() {
|
|
8
|
-
return /* @__PURE__ */ i(r, {
|
|
9
|
-
title: "Marketplace",
|
|
10
|
-
subtitle: "Find logistics service providers",
|
|
11
|
-
icon: /* @__PURE__ */ i(e, { size: 24 }),
|
|
12
|
-
children: /* @__PURE__ */ i(t, { children: /* @__PURE__ */ i(n, {
|
|
13
|
-
className: "p-0",
|
|
14
|
-
children: /* @__PURE__ */ i(a, {
|
|
15
|
-
illustration: "empty-people",
|
|
16
|
-
title: "Marketplace is coming soon",
|
|
17
|
-
description: "The collaborative logistics marketplace is not open yet. Check back after it launches to browse verified third-party service providers."
|
|
18
|
-
})
|
|
19
|
-
}) })
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { o as default };
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { Calendar as e } from "../node_modules/lucide-react/dist/esm/icons/calendar.js";
|
|
2
|
-
import { ChevronLeft as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
3
|
-
import { ChevronRight as n } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
4
|
-
import { Clock as r } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
5
|
-
import { Download as i } from "../node_modules/lucide-react/dist/esm/icons/download.js";
|
|
6
|
-
import { FileChartColumnIncreasing as a } from "../node_modules/lucide-react/dist/esm/icons/file-chart-column-increasing.js";
|
|
7
|
-
import { Filter as o } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
|
|
8
|
-
import { Plus as s } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
9
|
-
import { useAnalytics as ee } from "../hooks/useAnalytics.js";
|
|
10
|
-
import { useReports as c } from "../hooks/useReports.js";
|
|
11
|
-
import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Select as te, SelectContent as ne, SelectItem as re, SelectTrigger as ie, SelectValue as ae, Skeleton as oe } from "../components/ui.js";
|
|
12
|
-
import { PageLayout as h } from "../components/PageLayout.js";
|
|
13
|
-
import { VolumeBar as g } from "../components/charts/VolumeBar.js";
|
|
14
|
-
import "../components/charts/index.js";
|
|
15
|
-
import { formatDate as _ } from "../utils/formatters.js";
|
|
16
|
-
import { UpcomingDemandPanel as v } from "../components/UpcomingDemandPanel.js";
|
|
17
|
-
import { useDemandForecast as y } from "../hooks/useDemandForecast.js";
|
|
18
|
-
import { downloadFile as b, downloadJson as x, recordToCsv as se, slugifyForFilename as ce } from "../utils/download.js";
|
|
19
|
-
import { useState as S } from "react";
|
|
20
|
-
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
21
|
-
import { EmphasisPanel as T, IllustratedEmptyState as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
|
|
22
|
-
//#region src/movethewheels/pages/ReportsPage.tsx
|
|
23
|
-
var O = [
|
|
24
|
-
{
|
|
25
|
-
value: "operations",
|
|
26
|
-
label: "Operations Summary"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: "finance",
|
|
30
|
-
label: "Financial Report"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: "fleet",
|
|
34
|
-
label: "Fleet Utilization"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: "customers",
|
|
38
|
-
label: "Customer Analytics"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
value: "inventory",
|
|
42
|
-
label: "Inventory Status"
|
|
43
|
-
}
|
|
44
|
-
], k = 10;
|
|
45
|
-
function A() {
|
|
46
|
-
let [A, j] = S(0), { reports: M, hasMore: N, isLoading: P, error: F, refetch: I, createReport: L, generateReport: le } = c({
|
|
47
|
-
limit: k,
|
|
48
|
-
offset: A * k
|
|
49
|
-
}), { analytics: R } = ee(), z = R.trends.dailyOrders.slice(-7), { laneForecast: B, customerForecast: V, laneVariance: H, customerVariance: U, isLoading: W, error: ue, refetch: de } = y(4, 8), [G, fe] = S("operations"), [pe, K] = S(null), [q, J] = S(!1), [Y, X] = S(null), Z = (e) => O.find((t) => t.value === e)?.label ?? e, Q = async (e) => {
|
|
50
|
-
J(!0), X(null);
|
|
51
|
-
let t = {
|
|
52
|
-
name: `${Z(G)}${e ? " (Scheduled)" : ""}`,
|
|
53
|
-
type: G,
|
|
54
|
-
description: `${Z(G)} generated from live operational data`,
|
|
55
|
-
...e ? { schedule: e } : {}
|
|
56
|
-
};
|
|
57
|
-
try {
|
|
58
|
-
await L(t), X({
|
|
59
|
-
tone: "success",
|
|
60
|
-
text: e ? "Scheduled report created." : "Report created."
|
|
61
|
-
});
|
|
62
|
-
} catch (e) {
|
|
63
|
-
X({
|
|
64
|
-
tone: "error",
|
|
65
|
-
text: e instanceof Error ? e.message : "Could not create report."
|
|
66
|
-
});
|
|
67
|
-
} finally {
|
|
68
|
-
J(!1);
|
|
69
|
-
}
|
|
70
|
-
}, me = async (e) => {
|
|
71
|
-
K(e), X(null);
|
|
72
|
-
try {
|
|
73
|
-
let t = await le(e), n = `${ce(t.report.name)}-${t.generatedAt.slice(0, 10)}`, r = se(t.result ?? null);
|
|
74
|
-
r ? b(`${n}.csv`, r, "text/csv") : x(`${n}.json`, t), X({
|
|
75
|
-
tone: "success",
|
|
76
|
-
text: "Report generated and downloaded."
|
|
77
|
-
});
|
|
78
|
-
} catch (e) {
|
|
79
|
-
X({
|
|
80
|
-
tone: "error",
|
|
81
|
-
text: e instanceof Error ? e.message : "Could not generate report."
|
|
82
|
-
});
|
|
83
|
-
} finally {
|
|
84
|
-
K(null);
|
|
85
|
-
}
|
|
86
|
-
}, $ = M.filter((e) => e.schedule);
|
|
87
|
-
return /* @__PURE__ */ w(h, {
|
|
88
|
-
title: "Reports",
|
|
89
|
-
subtitle: "Generate and schedule reports",
|
|
90
|
-
icon: /* @__PURE__ */ C(a, { size: 24 }),
|
|
91
|
-
headerActions: /* @__PURE__ */ w("div", {
|
|
92
|
-
className: "flex gap-2",
|
|
93
|
-
children: [/* @__PURE__ */ w(te, {
|
|
94
|
-
value: G,
|
|
95
|
-
onValueChange: fe,
|
|
96
|
-
children: [/* @__PURE__ */ C(ie, {
|
|
97
|
-
className: "w-[190px]",
|
|
98
|
-
children: /* @__PURE__ */ C(ae, {})
|
|
99
|
-
}), /* @__PURE__ */ C(ne, { children: O.map((e) => /* @__PURE__ */ C(re, {
|
|
100
|
-
value: e.value,
|
|
101
|
-
children: e.label
|
|
102
|
-
}, e.value)) })]
|
|
103
|
-
}), /* @__PURE__ */ w(u, {
|
|
104
|
-
onClick: () => void Q(),
|
|
105
|
-
disabled: q,
|
|
106
|
-
children: [/* @__PURE__ */ C(s, { size: 16 }), " Create Report"]
|
|
107
|
-
})]
|
|
108
|
-
}),
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ C(D, {
|
|
111
|
-
icon: /* @__PURE__ */ C(a, { size: 18 }),
|
|
112
|
-
children: "Turn your operational data into shareable summaries. Generate one-off reports on orders, finance, fleet, customers or inventory, or schedule them to land in inboxes automatically — so stakeholders always have the latest numbers without logging in."
|
|
113
|
-
}),
|
|
114
|
-
Y && /* @__PURE__ */ C("div", {
|
|
115
|
-
role: "status",
|
|
116
|
-
className: `rounded-lg p-3 text-sm ${Y.tone === "success" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-error-bg-subtle text-status-error-text"}`,
|
|
117
|
-
children: Y.text
|
|
118
|
-
}),
|
|
119
|
-
/* @__PURE__ */ w("div", {
|
|
120
|
-
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
121
|
-
children: [/* @__PURE__ */ w("div", {
|
|
122
|
-
className: "lg:col-span-2 space-y-4",
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ C("h3", {
|
|
125
|
-
className: "font-semibold",
|
|
126
|
-
children: "Available Reports"
|
|
127
|
-
}),
|
|
128
|
-
P ? /* @__PURE__ */ C("div", {
|
|
129
|
-
className: "space-y-3",
|
|
130
|
-
children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ C(oe, { className: "h-20 w-full rounded-lg" }, t))
|
|
131
|
-
}) : F ? /* @__PURE__ */ C(d, {
|
|
132
|
-
className: "border-status-error-border",
|
|
133
|
-
children: /* @__PURE__ */ w(f, {
|
|
134
|
-
className: "p-6 text-center space-y-3",
|
|
135
|
-
children: [
|
|
136
|
-
/* @__PURE__ */ C("p", {
|
|
137
|
-
className: "text-status-error-text font-medium",
|
|
138
|
-
children: "Couldn't load reports"
|
|
139
|
-
}),
|
|
140
|
-
/* @__PURE__ */ C("p", {
|
|
141
|
-
className: "text-sm text-text-secondary",
|
|
142
|
-
children: F.message
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ C(u, {
|
|
145
|
-
variant: "outline",
|
|
146
|
-
onClick: I,
|
|
147
|
-
children: "Retry"
|
|
148
|
-
})
|
|
149
|
-
]
|
|
150
|
-
})
|
|
151
|
-
}) : M.length === 0 ? /* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, {
|
|
152
|
-
className: "p-0",
|
|
153
|
-
children: /* @__PURE__ */ C(E, {
|
|
154
|
-
illustration: "empty-data",
|
|
155
|
-
title: "No reports yet",
|
|
156
|
-
description: "Create your first report to turn live operational data into a shareable summary.",
|
|
157
|
-
action: /* @__PURE__ */ w(u, {
|
|
158
|
-
onClick: () => void Q(),
|
|
159
|
-
disabled: q,
|
|
160
|
-
children: [/* @__PURE__ */ C(s, {
|
|
161
|
-
size: 16,
|
|
162
|
-
className: "mr-1.5"
|
|
163
|
-
}), " Create Report"]
|
|
164
|
-
})
|
|
165
|
-
})
|
|
166
|
-
}) }) : M.map((e) => /* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, {
|
|
167
|
-
className: "p-4",
|
|
168
|
-
children: /* @__PURE__ */ w("div", {
|
|
169
|
-
className: "flex items-center justify-between",
|
|
170
|
-
children: [/* @__PURE__ */ w("div", {
|
|
171
|
-
className: "flex items-center gap-3",
|
|
172
|
-
children: [/* @__PURE__ */ C("div", {
|
|
173
|
-
className: "w-10 h-10 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
174
|
-
children: /* @__PURE__ */ C(a, {
|
|
175
|
-
size: 20,
|
|
176
|
-
className: "text-primary"
|
|
177
|
-
})
|
|
178
|
-
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
179
|
-
className: "font-medium",
|
|
180
|
-
children: e.name
|
|
181
|
-
}), /* @__PURE__ */ C("p", {
|
|
182
|
-
className: "text-sm text-text-secondary",
|
|
183
|
-
children: e.description ?? Z(e.type)
|
|
184
|
-
})] })]
|
|
185
|
-
}), /* @__PURE__ */ w("div", {
|
|
186
|
-
className: "flex items-center gap-3",
|
|
187
|
-
children: [/* @__PURE__ */ w("div", {
|
|
188
|
-
className: "text-right",
|
|
189
|
-
children: [/* @__PURE__ */ C(l, {
|
|
190
|
-
variant: "outline",
|
|
191
|
-
children: e.schedule ?? "On demand"
|
|
192
|
-
}), e.lastGenerated && /* @__PURE__ */ w("p", {
|
|
193
|
-
className: "text-xs text-text-secondary mt-1",
|
|
194
|
-
children: ["Last: ", _(new Date(e.lastGenerated), "short")]
|
|
195
|
-
})]
|
|
196
|
-
}), /* @__PURE__ */ C(u, {
|
|
197
|
-
variant: "outline",
|
|
198
|
-
size: "sm",
|
|
199
|
-
"aria-label": `Generate ${e.name}`,
|
|
200
|
-
disabled: pe === e.id,
|
|
201
|
-
onClick: () => void me(e.id),
|
|
202
|
-
children: /* @__PURE__ */ C(i, { size: 14 })
|
|
203
|
-
})]
|
|
204
|
-
})]
|
|
205
|
-
})
|
|
206
|
-
}) }, e.id)),
|
|
207
|
-
!P && !F && (M.length > 0 || A > 0) && /* @__PURE__ */ w("div", {
|
|
208
|
-
className: "flex flex-wrap items-center justify-between gap-3 pt-1",
|
|
209
|
-
children: [/* @__PURE__ */ w("span", {
|
|
210
|
-
className: "text-sm text-text-secondary",
|
|
211
|
-
children: [
|
|
212
|
-
"Showing ",
|
|
213
|
-
M.length === 0 ? 0 : A * k + 1,
|
|
214
|
-
" to",
|
|
215
|
-
" ",
|
|
216
|
-
A * k + M.length
|
|
217
|
-
]
|
|
218
|
-
}), /* @__PURE__ */ w("div", {
|
|
219
|
-
className: "flex items-center gap-1",
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ C(u, {
|
|
222
|
-
variant: "outline",
|
|
223
|
-
size: "icon",
|
|
224
|
-
className: "h-8 w-8",
|
|
225
|
-
"aria-label": "Previous page",
|
|
226
|
-
onClick: () => j((e) => Math.max(0, e - 1)),
|
|
227
|
-
disabled: A === 0,
|
|
228
|
-
children: /* @__PURE__ */ C(t, { className: "h-4 w-4" })
|
|
229
|
-
}),
|
|
230
|
-
/* @__PURE__ */ w("span", {
|
|
231
|
-
className: "px-3 text-sm",
|
|
232
|
-
children: ["Page ", A + 1]
|
|
233
|
-
}),
|
|
234
|
-
/* @__PURE__ */ C(u, {
|
|
235
|
-
variant: "outline",
|
|
236
|
-
size: "icon",
|
|
237
|
-
className: "h-8 w-8",
|
|
238
|
-
"aria-label": "Next page",
|
|
239
|
-
onClick: () => j((e) => e + 1),
|
|
240
|
-
disabled: !N,
|
|
241
|
-
children: /* @__PURE__ */ C(n, { className: "h-4 w-4" })
|
|
242
|
-
})
|
|
243
|
-
]
|
|
244
|
-
})]
|
|
245
|
-
})
|
|
246
|
-
]
|
|
247
|
-
}), /* @__PURE__ */ w("div", {
|
|
248
|
-
className: "space-y-6",
|
|
249
|
-
children: [
|
|
250
|
-
/* @__PURE__ */ C(v, {
|
|
251
|
-
laneForecast: B,
|
|
252
|
-
customerForecast: V,
|
|
253
|
-
laneVariance: H,
|
|
254
|
-
customerVariance: U,
|
|
255
|
-
isLoading: W,
|
|
256
|
-
error: ue,
|
|
257
|
-
onRetry: de
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ w(d, { children: [/* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, {
|
|
260
|
-
className: "text-base",
|
|
261
|
-
children: "Data preview"
|
|
262
|
-
}) }), /* @__PURE__ */ w(f, { children: [/* @__PURE__ */ C("p", {
|
|
263
|
-
className: "mb-2 text-xs text-text-secondary",
|
|
264
|
-
children: "Order volume · last 7 days"
|
|
265
|
-
}), /* @__PURE__ */ C(g, {
|
|
266
|
-
xKey: "date",
|
|
267
|
-
height: 160,
|
|
268
|
-
showLegend: !1,
|
|
269
|
-
data: z,
|
|
270
|
-
series: [{
|
|
271
|
-
dataKey: "orders",
|
|
272
|
-
name: "Orders"
|
|
273
|
-
}],
|
|
274
|
-
emptyMessage: "No order data to preview yet"
|
|
275
|
-
})] })] }),
|
|
276
|
-
/* @__PURE__ */ w(T, {
|
|
277
|
-
className: "space-y-3",
|
|
278
|
-
children: [
|
|
279
|
-
/* @__PURE__ */ w("h2", {
|
|
280
|
-
className: "flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
281
|
-
children: [/* @__PURE__ */ C(r, { size: 18 }), " Scheduled Reports"]
|
|
282
|
-
}),
|
|
283
|
-
$.length === 0 ? /* @__PURE__ */ C("p", {
|
|
284
|
-
className: "text-sm text-text-secondary",
|
|
285
|
-
children: "No scheduled reports yet. Schedule one to have it generated automatically."
|
|
286
|
-
}) : $.map((e) => /* @__PURE__ */ w("div", {
|
|
287
|
-
className: "p-3 border border-border-seam rounded-lg",
|
|
288
|
-
children: [/* @__PURE__ */ C("p", {
|
|
289
|
-
className: "font-medium",
|
|
290
|
-
children: e.name
|
|
291
|
-
}), /* @__PURE__ */ w("p", {
|
|
292
|
-
className: "text-sm text-text-secondary",
|
|
293
|
-
children: ["Schedule: ", e.schedule]
|
|
294
|
-
})]
|
|
295
|
-
}, e.id)),
|
|
296
|
-
/* @__PURE__ */ C(u, {
|
|
297
|
-
variant: "outline",
|
|
298
|
-
className: "w-full",
|
|
299
|
-
disabled: q,
|
|
300
|
-
onClick: () => void Q("daily"),
|
|
301
|
-
children: "Schedule New Report"
|
|
302
|
-
})
|
|
303
|
-
]
|
|
304
|
-
}),
|
|
305
|
-
/* @__PURE__ */ w(d, { children: [/* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, { children: "Quick Actions" }) }), /* @__PURE__ */ w(f, {
|
|
306
|
-
className: "space-y-2",
|
|
307
|
-
children: [/* @__PURE__ */ w(u, {
|
|
308
|
-
variant: "outline",
|
|
309
|
-
className: "w-full justify-start",
|
|
310
|
-
disabled: q,
|
|
311
|
-
onClick: () => void Q("weekly"),
|
|
312
|
-
children: [/* @__PURE__ */ C(e, { size: 16 }), " Schedule Report"]
|
|
313
|
-
}), /* @__PURE__ */ w(u, {
|
|
314
|
-
variant: "outline",
|
|
315
|
-
className: "w-full justify-start",
|
|
316
|
-
disabled: q,
|
|
317
|
-
onClick: () => void Q(),
|
|
318
|
-
children: [/* @__PURE__ */ C(o, { size: 16 }), " Custom Report"]
|
|
319
|
-
})]
|
|
320
|
-
})] })
|
|
321
|
-
]
|
|
322
|
-
})]
|
|
323
|
-
})
|
|
324
|
-
]
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
//#endregion
|
|
328
|
-
export { A as default };
|