@burdenoff/microfe-movethewheels 2026.722.1 → 2026.726.1
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/hooks/useEntityDocuments.js +4 -4
- package/dist/hooks/useOrders.js +119 -100
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +17 -1
- package/dist/movethewheels/types/index.d.ts +1 -3
- package/dist/pages/CreateOrderPage.js +53 -79
- package/dist/pages/OrderDetailsPage.js +19 -20
- package/dist/pages/OrdersListPage.js +82 -113
- package/package.json +4 -3
- package/src/movethewheels/hooks/useEntityDocuments.ts +30 -12
- package/src/movethewheels/hooks/useOrders.ts +83 -208
- package/src/movethewheels/pages/CreateOrderPage.tsx +1 -19
- package/src/movethewheels/pages/OrderDetailsPage.tsx +1 -7
- package/src/movethewheels/pages/OrdersListPage.tsx +3 -31
- package/src/movethewheels/types/index.ts +1 -3
|
@@ -20,15 +20,15 @@ import { useOrder as ue, useOrders as de } from "../hooks/useOrders.js";
|
|
|
20
20
|
import { useFleet as fe } from "../hooks/useFleet.js";
|
|
21
21
|
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Label as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y, Separator as b, Table as pe, TableBody as me, TableCell as x, TableHead as S, TableHeader as he, TableRow as C } from "../components/ui.js";
|
|
22
22
|
import { ErrorState as ge, LoadingState as _e, PageLayout as ve } from "../components/PageLayout.js";
|
|
23
|
-
import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as w
|
|
24
|
-
import { FormError as
|
|
25
|
-
import { Notice as
|
|
23
|
+
import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as w } from "../components/StatusBadge.js";
|
|
24
|
+
import { FormError as xe } from "../components/FormError.js";
|
|
25
|
+
import { Notice as Se, useNotice as T } from "../components/Notice.js";
|
|
26
26
|
import { formatAddress as E, formatCurrency as D, formatDate as O } from "../utils/formatters.js";
|
|
27
|
-
import { DocumentsCard as
|
|
27
|
+
import { DocumentsCard as Ce } from "../components/DocumentsCard.js";
|
|
28
28
|
import { useState as k } from "react";
|
|
29
|
-
import { useParams as
|
|
29
|
+
import { useParams as we } from "react-router-dom";
|
|
30
30
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
31
|
-
import { EmphasisPanel as
|
|
31
|
+
import { EmphasisPanel as Te, NextSteps as Ee, PagePurpose as De } from "@burdenoff/fe-libs/ui";
|
|
32
32
|
//#region src/movethewheels/pages/OrderDetailsPage.tsx
|
|
33
33
|
var M = [
|
|
34
34
|
"pending",
|
|
@@ -49,19 +49,19 @@ var M = [
|
|
|
49
49
|
cancelled: "Cancelled",
|
|
50
50
|
failed: "Failed"
|
|
51
51
|
};
|
|
52
|
-
function
|
|
52
|
+
function Oe(e) {
|
|
53
53
|
let t = M.indexOf(e);
|
|
54
54
|
return t === -1 || t >= M.length - 1 ? null : M[t + 1];
|
|
55
55
|
}
|
|
56
56
|
function P() {
|
|
57
|
-
let { orderId: M } =
|
|
57
|
+
let { orderId: M } = we(), { basePath: P, navigate: F } = le(), { order: I, isLoading: ke, error: Ae, refetch: L } = ue(M), { updateOrder: je, updateOrderStatus: Me } = de(), { vehicles: Ne, drivers: Pe } = fe(), { message: R, notify: z } = T(), [B, V] = k(""), [H, U] = k(""), [W, G] = k(!1), [K, q] = k(!1), [J, Y] = k(null), X = Ne.filter((e) => e.status === "available" || e.id === I?.vehicleId), Z = Pe.filter((e) => e.status === "available" || e.id === I?.driverId), Fe = async () => {
|
|
58
58
|
if (!M || !B && !H) {
|
|
59
59
|
Y("Pick a vehicle and/or a driver to assign.");
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
G(!0), Y(null);
|
|
63
63
|
try {
|
|
64
|
-
await
|
|
64
|
+
await je(M, {
|
|
65
65
|
vehicleId: B || void 0,
|
|
66
66
|
driverId: H || void 0
|
|
67
67
|
}), z("Assignment updated."), V(""), U(""), L();
|
|
@@ -74,7 +74,7 @@ function P() {
|
|
|
74
74
|
if (M) {
|
|
75
75
|
q(!0), Y(null);
|
|
76
76
|
try {
|
|
77
|
-
await
|
|
77
|
+
await Me(M, e), z(t), L();
|
|
78
78
|
} catch (e) {
|
|
79
79
|
Y(e instanceof Error ? e.message : "Failed to update status.");
|
|
80
80
|
} finally {
|
|
@@ -84,7 +84,7 @@ function P() {
|
|
|
84
84
|
}, $ = (e) => {
|
|
85
85
|
F && F(s(P, e));
|
|
86
86
|
};
|
|
87
|
-
return
|
|
87
|
+
return ke ? /* @__PURE__ */ A(_e, { message: "Loading order details..." }) : Ae || !I ? /* @__PURE__ */ A(ge, {
|
|
88
88
|
title: "Order not found",
|
|
89
89
|
message: "The order you're looking for doesn't exist or has been removed.",
|
|
90
90
|
onRetry: L
|
|
@@ -120,16 +120,15 @@ function P() {
|
|
|
120
120
|
type: "order"
|
|
121
121
|
}),
|
|
122
122
|
/* @__PURE__ */ A(be, { priority: I.priority }),
|
|
123
|
-
/* @__PURE__ */ A(xe, { type: I.orderType }),
|
|
124
123
|
/* @__PURE__ */ A(ye, { status: I.pricing.paymentStatus })
|
|
125
124
|
]
|
|
126
125
|
}),
|
|
127
126
|
children: [
|
|
128
|
-
/* @__PURE__ */ A(
|
|
127
|
+
/* @__PURE__ */ A(De, {
|
|
129
128
|
icon: /* @__PURE__ */ A(i, { size: 18 }),
|
|
130
129
|
children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
|
|
131
130
|
}),
|
|
132
|
-
/* @__PURE__ */ A(
|
|
131
|
+
/* @__PURE__ */ A(Ee, {
|
|
133
132
|
storageKey: "movethewheels-order-details",
|
|
134
133
|
steps: [
|
|
135
134
|
{
|
|
@@ -359,7 +358,7 @@ function P() {
|
|
|
359
358
|
}), /* @__PURE__ */ j("div", {
|
|
360
359
|
className: "space-y-6",
|
|
361
360
|
children: [
|
|
362
|
-
/* @__PURE__ */ j(
|
|
361
|
+
/* @__PURE__ */ j(Te, { children: [/* @__PURE__ */ j("h2", {
|
|
363
362
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
364
363
|
children: [/* @__PURE__ */ A(ne, { size: 18 }), "Order Summary"]
|
|
365
364
|
}), /* @__PURE__ */ j("div", {
|
|
@@ -426,8 +425,8 @@ function P() {
|
|
|
426
425
|
}) }), /* @__PURE__ */ A(d, { children: /* @__PURE__ */ j("div", {
|
|
427
426
|
className: "space-y-4",
|
|
428
427
|
children: [
|
|
429
|
-
J && /* @__PURE__ */ A(
|
|
430
|
-
R && /* @__PURE__ */ A(
|
|
428
|
+
J && /* @__PURE__ */ A(xe, { message: J }),
|
|
429
|
+
R && /* @__PURE__ */ A(Se, { message: R }),
|
|
431
430
|
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
432
431
|
className: "text-sm text-text-secondary",
|
|
433
432
|
children: "Tracking Number"
|
|
@@ -493,7 +492,7 @@ function P() {
|
|
|
493
492
|
}),
|
|
494
493
|
/* @__PURE__ */ j(l, {
|
|
495
494
|
className: "w-full",
|
|
496
|
-
onClick:
|
|
495
|
+
onClick: Fe,
|
|
497
496
|
disabled: W || !B && !H,
|
|
498
497
|
children: [/* @__PURE__ */ A(se, { size: 16 }), W ? "Assigning…" : "Assign driver & vehicle"]
|
|
499
498
|
})
|
|
@@ -515,7 +514,7 @@ function P() {
|
|
|
515
514
|
]
|
|
516
515
|
}),
|
|
517
516
|
(() => {
|
|
518
|
-
let e =
|
|
517
|
+
let e = Oe(I.status);
|
|
519
518
|
return e ? /* @__PURE__ */ j(l, {
|
|
520
519
|
variant: "outline",
|
|
521
520
|
className: "w-full",
|
|
@@ -541,7 +540,7 @@ function P() {
|
|
|
541
540
|
})
|
|
542
541
|
]
|
|
543
542
|
}) })] }),
|
|
544
|
-
/* @__PURE__ */ A(
|
|
543
|
+
/* @__PURE__ */ A(Ce, {
|
|
545
544
|
entityType: "order",
|
|
546
545
|
entityId: I.id
|
|
547
546
|
}),
|
|
@@ -6,44 +6,43 @@ import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/packag
|
|
|
6
6
|
import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
7
7
|
import { RefreshCw as a } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
8
8
|
import { Truck as o } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
9
|
-
import { UserCheck as
|
|
10
|
-
import { UserPlus as
|
|
11
|
-
import { joinPath as
|
|
12
|
-
import { useMoveTheWheels as
|
|
13
|
-
import { useOrderStats as
|
|
14
|
-
import { Badge as
|
|
15
|
-
import { PageLayout as
|
|
16
|
-
import { MetricCard as
|
|
17
|
-
import { PriorityBadge as
|
|
9
|
+
import { UserCheck as s } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
10
|
+
import { UserPlus as c } from "../node_modules/lucide-react/dist/esm/icons/user-plus.js";
|
|
11
|
+
import { joinPath as l } from "../utils/navigation.js";
|
|
12
|
+
import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
|
|
13
|
+
import { useOrderStats as d, useOrders as f } from "../hooks/useOrders.js";
|
|
14
|
+
import { Badge as p, Button as m, Card as te, CardContent as ne, Select as re, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../components/ui.js";
|
|
15
|
+
import { PageLayout as y } from "../components/PageLayout.js";
|
|
16
|
+
import { MetricCard as b, MetricGrid as x } from "../components/MetricCard.js";
|
|
17
|
+
import { PriorityBadge as S, StatusBadge as C } from "../components/StatusBadge.js";
|
|
18
18
|
import { DataTable as w } from "../components/DataTable.js";
|
|
19
|
-
import { formatCurrency as
|
|
20
|
-
import { useState as
|
|
21
|
-
import { jsx as
|
|
22
|
-
import { CTAOverflowMenu as
|
|
19
|
+
import { formatCurrency as ie, formatDate as T } from "../utils/formatters.js";
|
|
20
|
+
import { useState as E } from "react";
|
|
21
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
22
|
+
import { CTAOverflowMenu as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
|
|
23
23
|
import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
24
24
|
//#region src/movethewheels/pages/OrdersListPage.tsx
|
|
25
25
|
function M() {
|
|
26
26
|
let { t: M } = j(), N = (e, t) => {
|
|
27
27
|
let n = M(e);
|
|
28
28
|
return n === e ? t : n;
|
|
29
|
-
}, { basePath: P, navigate: F } =
|
|
29
|
+
}, { basePath: P, navigate: F } = u(), [I, L] = E("all"), [R, z] = E(!1), [B, V] = E(0), [H, U] = E(25), W = I !== "all" || R, { orders: G, hasMore: K, isLoading: q, error: J, refetch: Y } = f({
|
|
30
30
|
filters: {
|
|
31
31
|
status: I === "all" ? void 0 : I,
|
|
32
|
-
|
|
33
|
-
unassigned: B || void 0
|
|
32
|
+
unassigned: R || void 0
|
|
34
33
|
},
|
|
35
|
-
limit:
|
|
36
|
-
offset:
|
|
37
|
-
}), { stats: X } =
|
|
38
|
-
F && F(
|
|
39
|
-
}, $ = () =>
|
|
34
|
+
limit: H,
|
|
35
|
+
offset: B * H
|
|
36
|
+
}), { stats: X } = d(), Z = X.total, Q = (e) => {
|
|
37
|
+
F && F(l(P, e));
|
|
38
|
+
}, $ = () => V(0), ae = [
|
|
40
39
|
{
|
|
41
40
|
id: "orderNumber",
|
|
42
41
|
header: N("movethewheels.orders.table.orderNumber", "Order #"),
|
|
43
42
|
accessorKey: "orderNumber",
|
|
44
43
|
sortable: !0,
|
|
45
44
|
className: "min-w-[100px] whitespace-nowrap",
|
|
46
|
-
cell: (e) => /* @__PURE__ */
|
|
45
|
+
cell: (e) => /* @__PURE__ */ D("span", {
|
|
47
46
|
className: "font-medium text-primary",
|
|
48
47
|
children: e.orderNumber
|
|
49
48
|
})
|
|
@@ -52,12 +51,12 @@ function M() {
|
|
|
52
51
|
id: "customer",
|
|
53
52
|
header: N("movethewheels.orders.table.customer", "Customer"),
|
|
54
53
|
className: "min-w-[180px] max-w-[220px]",
|
|
55
|
-
cell: (e) => /* @__PURE__ */
|
|
54
|
+
cell: (e) => /* @__PURE__ */ O("div", {
|
|
56
55
|
className: "min-w-0",
|
|
57
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ D("p", {
|
|
58
57
|
className: "font-medium truncate",
|
|
59
58
|
children: e.customerInfo.name
|
|
60
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ D("p", {
|
|
61
60
|
className: "text-sm text-text-secondary truncate",
|
|
62
61
|
children: e.customerInfo.email
|
|
63
62
|
})]
|
|
@@ -69,31 +68,24 @@ function M() {
|
|
|
69
68
|
accessorKey: "status",
|
|
70
69
|
sortable: !0,
|
|
71
70
|
className: "min-w-[130px] whitespace-nowrap",
|
|
72
|
-
cell: (e) => /* @__PURE__ */
|
|
71
|
+
cell: (e) => /* @__PURE__ */ D(C, {
|
|
73
72
|
status: e.status,
|
|
74
73
|
type: "order"
|
|
75
74
|
})
|
|
76
75
|
},
|
|
77
|
-
{
|
|
78
|
-
id: "type",
|
|
79
|
-
header: N("movethewheels.orders.table.type", "Type"),
|
|
80
|
-
accessorKey: "orderType",
|
|
81
|
-
className: "min-w-[70px] whitespace-nowrap",
|
|
82
|
-
cell: (e) => /* @__PURE__ */ O(C, { type: e.orderType })
|
|
83
|
-
},
|
|
84
76
|
{
|
|
85
77
|
id: "priority",
|
|
86
78
|
header: N("movethewheels.orders.table.priority", "Priority"),
|
|
87
79
|
accessorKey: "priority",
|
|
88
80
|
sortable: !0,
|
|
89
81
|
className: "min-w-[90px] whitespace-nowrap",
|
|
90
|
-
cell: (e) => /* @__PURE__ */
|
|
82
|
+
cell: (e) => /* @__PURE__ */ D(S, { priority: e.priority })
|
|
91
83
|
},
|
|
92
84
|
{
|
|
93
85
|
id: "items",
|
|
94
86
|
header: N("movethewheels.orders.table.items", "Items"),
|
|
95
87
|
className: "min-w-[80px] whitespace-nowrap",
|
|
96
|
-
cell: (e) => /* @__PURE__ */
|
|
88
|
+
cell: (e) => /* @__PURE__ */ O(p, {
|
|
97
89
|
variant: "secondary",
|
|
98
90
|
children: [
|
|
99
91
|
e.items.length,
|
|
@@ -108,9 +100,9 @@ function M() {
|
|
|
108
100
|
accessorKey: "pricing",
|
|
109
101
|
sortable: !0,
|
|
110
102
|
className: "min-w-[100px] whitespace-nowrap text-right",
|
|
111
|
-
cell: (e) => /* @__PURE__ */
|
|
103
|
+
cell: (e) => /* @__PURE__ */ D("span", {
|
|
112
104
|
className: "font-medium",
|
|
113
|
-
children:
|
|
105
|
+
children: ie(e.pricing.total)
|
|
114
106
|
})
|
|
115
107
|
},
|
|
116
108
|
{
|
|
@@ -119,7 +111,7 @@ function M() {
|
|
|
119
111
|
accessorKey: "scheduledDelivery",
|
|
120
112
|
sortable: !0,
|
|
121
113
|
className: "min-w-[110px] whitespace-nowrap",
|
|
122
|
-
cell: (e) => e.scheduledDelivery ?
|
|
114
|
+
cell: (e) => e.scheduledDelivery ? T(e.scheduledDelivery) : "-"
|
|
123
115
|
},
|
|
124
116
|
{
|
|
125
117
|
id: "createdAt",
|
|
@@ -127,32 +119,32 @@ function M() {
|
|
|
127
119
|
accessorKey: "createdAt",
|
|
128
120
|
sortable: !0,
|
|
129
121
|
className: "min-w-[100px] whitespace-nowrap",
|
|
130
|
-
cell: (e) =>
|
|
122
|
+
cell: (e) => T(e.createdAt, "relative")
|
|
131
123
|
},
|
|
132
124
|
{
|
|
133
125
|
id: "driver",
|
|
134
126
|
header: N("movethewheels.orders.table.driver", "Driver"),
|
|
135
127
|
className: "min-w-[120px] whitespace-nowrap",
|
|
136
|
-
cell: (e) => e.driverId ? /* @__PURE__ */
|
|
128
|
+
cell: (e) => e.driverId ? /* @__PURE__ */ O("span", {
|
|
137
129
|
className: "inline-flex items-center gap-1 text-sm text-status-success-text",
|
|
138
130
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ D(s, { size: 14 }),
|
|
140
132
|
" ",
|
|
141
133
|
N("movethewheels.orders.table.assigned", "Assigned")
|
|
142
134
|
]
|
|
143
|
-
}) : /* @__PURE__ */
|
|
135
|
+
}) : /* @__PURE__ */ O(m, {
|
|
144
136
|
variant: "outline",
|
|
145
137
|
size: "sm",
|
|
146
138
|
onClick: (t) => {
|
|
147
139
|
t.stopPropagation(), Q(`orders/${e.id}`);
|
|
148
140
|
},
|
|
149
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ D(c, {
|
|
150
142
|
size: 14,
|
|
151
143
|
className: "mr-1"
|
|
152
144
|
}), N("movethewheels.orders.table.assign", "Assign")]
|
|
153
145
|
})
|
|
154
146
|
}
|
|
155
|
-
],
|
|
147
|
+
], oe = [
|
|
156
148
|
{
|
|
157
149
|
value: "all",
|
|
158
150
|
label: N("movethewheels.orders.filters.allStatuses", "All Statuses")
|
|
@@ -194,142 +186,119 @@ function M() {
|
|
|
194
186
|
label: N("movethewheels.orders.status.failed", "Failed")
|
|
195
187
|
}
|
|
196
188
|
];
|
|
197
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ O(y, {
|
|
198
190
|
title: N("movethewheels.orders.title", "Orders"),
|
|
199
191
|
subtitle: `${Z} ${N("movethewheels.orders.subtitle", "total orders")}`,
|
|
200
|
-
icon: /* @__PURE__ */
|
|
201
|
-
headerActions: /* @__PURE__ */
|
|
192
|
+
icon: /* @__PURE__ */ D(r, { size: 24 }),
|
|
193
|
+
headerActions: /* @__PURE__ */ D(k, {
|
|
202
194
|
primary: {
|
|
203
195
|
label: N("movethewheels.orders.actions.newOrder", "New Order"),
|
|
204
|
-
icon: /* @__PURE__ */
|
|
196
|
+
icon: /* @__PURE__ */ D(i, { size: 16 }),
|
|
205
197
|
onSelect: () => Q("orders/new")
|
|
206
198
|
},
|
|
207
199
|
actions: [{
|
|
208
200
|
label: N("movethewheels.orders.actions.refresh", "Refresh"),
|
|
209
|
-
icon: /* @__PURE__ */
|
|
201
|
+
icon: /* @__PURE__ */ D(a, { size: 16 }),
|
|
210
202
|
onSelect: () => Y()
|
|
211
203
|
}, {
|
|
212
204
|
label: N("movethewheels.orders.actions.export", "Export"),
|
|
213
|
-
icon: /* @__PURE__ */
|
|
205
|
+
icon: /* @__PURE__ */ D(n, { size: 16 }),
|
|
214
206
|
onSelect: () => Q("import-export")
|
|
215
207
|
}]
|
|
216
208
|
}),
|
|
217
209
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
icon: /* @__PURE__ */
|
|
220
|
-
children: N("movethewheels.orders.purpose", "Every delivery job lives here —
|
|
210
|
+
/* @__PURE__ */ D(A, {
|
|
211
|
+
icon: /* @__PURE__ */ D(r, { size: 18 }),
|
|
212
|
+
children: N("movethewheels.orders.purpose", "Every delivery job lives here — their status, priority and value. Use this list to find an order, filter by status, and open one to assign a driver, track it, or update fulfilment.")
|
|
221
213
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
223
215
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
224
216
|
children: N("movethewheels.orders.glance.title", "Pipeline at a glance")
|
|
225
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ O(x, {
|
|
226
218
|
columns: 4,
|
|
227
219
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ D(b, {
|
|
229
221
|
label: N("movethewheels.orders.glance.total", "Total orders"),
|
|
230
222
|
value: Z,
|
|
231
|
-
icon: /* @__PURE__ */
|
|
223
|
+
icon: /* @__PURE__ */ D(r, { size: 20 }),
|
|
232
224
|
accent: "brand"
|
|
233
225
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ D(b, {
|
|
235
227
|
label: N("movethewheels.orders.glance.pending", "Pending"),
|
|
236
228
|
value: X.byStatus.pending,
|
|
237
|
-
icon: /* @__PURE__ */
|
|
229
|
+
icon: /* @__PURE__ */ D(t, { size: 20 }),
|
|
238
230
|
accent: "warning",
|
|
239
231
|
subtitle: N("movethewheels.orders.glance.pendingSub", "Awaiting fulfilment")
|
|
240
232
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ D(b, {
|
|
242
234
|
label: N("movethewheels.orders.glance.inTransit", "In transit"),
|
|
243
235
|
value: X.byStatus.in_transit + X.byStatus.out_for_delivery,
|
|
244
|
-
icon: /* @__PURE__ */
|
|
236
|
+
icon: /* @__PURE__ */ D(o, { size: 20 }),
|
|
245
237
|
accent: "blue",
|
|
246
238
|
subtitle: N("movethewheels.orders.glance.inTransitSub", "On the road now")
|
|
247
239
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ D(b, {
|
|
249
241
|
label: N("movethewheels.orders.glance.delivered", "Delivered"),
|
|
250
242
|
value: X.byStatus.delivered,
|
|
251
|
-
icon: /* @__PURE__ */
|
|
243
|
+
icon: /* @__PURE__ */ D(e, { size: 20 }),
|
|
252
244
|
accent: "success"
|
|
253
245
|
})
|
|
254
246
|
]
|
|
255
247
|
})] }),
|
|
256
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ D(te, { children: /* @__PURE__ */ D(ne, {
|
|
257
249
|
className: "p-4",
|
|
258
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ O("div", {
|
|
259
251
|
className: "flex flex-wrap items-center gap-4",
|
|
260
252
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ O("div", {
|
|
262
254
|
className: "flex items-center gap-2",
|
|
263
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ D(ee, {
|
|
264
256
|
size: 16,
|
|
265
257
|
className: "text-text-secondary"
|
|
266
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ D("span", {
|
|
267
259
|
className: "text-sm font-medium",
|
|
268
260
|
children: N("movethewheels.orders.filters.label", "Filters:")
|
|
269
261
|
})]
|
|
270
262
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ O(re, {
|
|
272
264
|
value: I,
|
|
273
265
|
onValueChange: (e) => {
|
|
274
266
|
L(e), $();
|
|
275
267
|
},
|
|
276
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ D(_, {
|
|
277
269
|
className: "w-[180px]",
|
|
278
|
-
children: /* @__PURE__ */
|
|
279
|
-
}), /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ D(v, { placeholder: N("movethewheels.orders.filters.status", "Status") })
|
|
271
|
+
}), /* @__PURE__ */ D(h, { children: oe.map((e) => /* @__PURE__ */ D(g, {
|
|
280
272
|
value: e.value,
|
|
281
273
|
children: e.label
|
|
282
274
|
}, e.value)) })]
|
|
283
275
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
|
|
286
|
-
onValueChange: (e) => {
|
|
287
|
-
z(e), $();
|
|
288
|
-
},
|
|
289
|
-
children: [/* @__PURE__ */ O(g, {
|
|
290
|
-
className: "w-[150px]",
|
|
291
|
-
children: /* @__PURE__ */ O(_, { placeholder: N("movethewheels.orders.filters.type", "Type") })
|
|
292
|
-
}), /* @__PURE__ */ k(m, { children: [
|
|
293
|
-
/* @__PURE__ */ O(h, {
|
|
294
|
-
value: "all",
|
|
295
|
-
children: N("movethewheels.orders.filters.allTypes", "All Types")
|
|
296
|
-
}),
|
|
297
|
-
/* @__PURE__ */ O(h, {
|
|
298
|
-
value: "b2b",
|
|
299
|
-
children: "B2B"
|
|
300
|
-
}),
|
|
301
|
-
/* @__PURE__ */ O(h, {
|
|
302
|
-
value: "b2c",
|
|
303
|
-
children: "B2C"
|
|
304
|
-
})
|
|
305
|
-
] })]
|
|
306
|
-
}),
|
|
307
|
-
/* @__PURE__ */ k(u, {
|
|
308
|
-
variant: B ? "default" : "outline",
|
|
276
|
+
/* @__PURE__ */ O(m, {
|
|
277
|
+
variant: R ? "default" : "outline",
|
|
309
278
|
size: "sm",
|
|
310
279
|
onClick: () => {
|
|
311
|
-
|
|
280
|
+
z((e) => !e), $();
|
|
312
281
|
},
|
|
313
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ D(c, {
|
|
314
283
|
size: 14,
|
|
315
284
|
className: "mr-1"
|
|
316
285
|
}), N("movethewheels.orders.filters.unassigned", "Needs driver")]
|
|
317
286
|
}),
|
|
318
|
-
|
|
287
|
+
W && /* @__PURE__ */ D(m, {
|
|
319
288
|
variant: "ghost",
|
|
320
289
|
size: "sm",
|
|
321
290
|
onClick: () => {
|
|
322
|
-
L("all"), z(
|
|
291
|
+
L("all"), z(!1), $();
|
|
323
292
|
},
|
|
324
293
|
children: N("movethewheels.orders.filters.clear", "Clear filters")
|
|
325
294
|
})
|
|
326
295
|
]
|
|
327
296
|
})
|
|
328
297
|
}) }),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
columns:
|
|
331
|
-
data:
|
|
332
|
-
isLoading:
|
|
298
|
+
/* @__PURE__ */ D(w, {
|
|
299
|
+
columns: ae,
|
|
300
|
+
data: G,
|
|
301
|
+
isLoading: q,
|
|
333
302
|
error: J,
|
|
334
303
|
onRetry: Y,
|
|
335
304
|
searchable: !0,
|
|
@@ -337,21 +306,21 @@ function M() {
|
|
|
337
306
|
searchFields: ["orderNumber", "customerInfo"],
|
|
338
307
|
onRowClick: (e) => Q(`orders/${e.id}`),
|
|
339
308
|
getRowId: (e) => e.id,
|
|
340
|
-
pageIndex:
|
|
341
|
-
pageSize:
|
|
342
|
-
onPageChange:
|
|
309
|
+
pageIndex: B,
|
|
310
|
+
pageSize: H,
|
|
311
|
+
onPageChange: V,
|
|
343
312
|
onPageSizeChange: (e) => {
|
|
344
|
-
|
|
313
|
+
U(e), V(0);
|
|
345
314
|
},
|
|
346
|
-
totalItems:
|
|
347
|
-
hasNextPage:
|
|
315
|
+
totalItems: W ? void 0 : Z,
|
|
316
|
+
hasNextPage: K,
|
|
348
317
|
emptyMessage: N("movethewheels.orders.empty", "No orders found"),
|
|
349
318
|
emptyIllustration: "empty-data",
|
|
350
319
|
emptyTitle: N("movethewheels.orders.emptyTitle", "No orders yet"),
|
|
351
320
|
emptyDescription: N("movethewheels.orders.emptyDescription", "Create your first order to start moving shipments through the pipeline."),
|
|
352
|
-
emptyAction: /* @__PURE__ */
|
|
321
|
+
emptyAction: /* @__PURE__ */ O(m, {
|
|
353
322
|
onClick: () => Q("orders/new"),
|
|
354
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ D(i, {
|
|
355
324
|
size: 16,
|
|
356
325
|
className: "mr-1.5"
|
|
357
326
|
}), N("movethewheels.orders.actions.newOrder", "New Order")]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-movethewheels",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.726.1",
|
|
4
4
|
"description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"lint:sanity": "if [ \"${CI:-}\" = \"true\" ]; then bun run lint; else bun run lint -- --cache --cache-location .eslintcache; fi",
|
|
32
32
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
33
33
|
"type:check": "tsc --noEmit",
|
|
34
|
-
"
|
|
34
|
+
"validate:schema-drift": "graphql-schema-drift",
|
|
35
|
+
"sanity": "bun run codegen && bun run validate:schema-drift && bun run lint:sanity && bun run format && bun run type:check && bun run build && bun run build-storybook",
|
|
35
36
|
"storybook": "storybook dev -p 6006",
|
|
36
37
|
"build-storybook": "storybook build",
|
|
37
38
|
"test:storybook": "test-storybook",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@apollo/client": "^4.0.11",
|
|
50
|
-
"@burdenoff/fe-libs": "2026.
|
|
51
|
+
"@burdenoff/fe-libs": "2026.726.1",
|
|
51
52
|
"@react-leaflet/core": "^3.0.0",
|
|
52
53
|
"@tanstack/react-query": "^5.90.16",
|
|
53
54
|
"clsx": "^2.1.1",
|
|
@@ -5,10 +5,26 @@
|
|
|
5
5
|
* driver or order live in the platform Files module (wspace-files-svc), which
|
|
6
6
|
* federates into the same workspace gateway. We tag each uploaded file with two
|
|
7
7
|
* marqueue entity tags — `mtwEntityType` and `mtwEntityId` — and list them back
|
|
8
|
-
* here through
|
|
8
|
+
* here through `getFiles(filter:{ tags:[...] })`.
|
|
9
9
|
*
|
|
10
10
|
* There is no upload UI here (out of scope): uploading/managing happens in the
|
|
11
11
|
* Files module, deep-linked from DocumentsCard. This hook is read-only.
|
|
12
|
+
*
|
|
13
|
+
* BOFF-3922 fix (2026-07-26): this previously called a non-existent root field
|
|
14
|
+
* `files(...)` — the wspace gateway only exposes `Workspace.files` (nested) and
|
|
15
|
+
* root fields `getFiles`/`searchFiles`/`ownedFiles`/`uploadedFiles`, none named
|
|
16
|
+
* bare `files`. Fixed to `getFiles(...): FileList!` (unwrapping `.files`), the
|
|
17
|
+
* root field whose `folderId` arg is optional so it supports a workspace-wide
|
|
18
|
+
* filter-only lookup. Caught by the new graphql-schema-drift CI guard, which
|
|
19
|
+
* had zero prior coverage on this repo — this bug would otherwise have shipped
|
|
20
|
+
* to prod undetected, same as BOFF-3915/BOFF-4703/BOFF-3529.
|
|
21
|
+
*
|
|
22
|
+
* NOT verified by this fix: whether `TagFilterInput.label` (renamed here from
|
|
23
|
+
* the nonexistent `.value`) actually produces the intended
|
|
24
|
+
* mtwEntityType+mtwEntityId AND-filter semantics against wspace-files-svc's
|
|
25
|
+
* tag-matching resolver — that's a wspace-files-svc/wspace-tags-svc business-
|
|
26
|
+
* logic question outside a schema-shape validator's reach (it operates on
|
|
27
|
+
* runtime variable values, not the query document). Flagged as follow-up.
|
|
12
28
|
*/
|
|
13
29
|
|
|
14
30
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
@@ -46,13 +62,15 @@ interface UseEntityDocumentsResult {
|
|
|
46
62
|
|
|
47
63
|
const LIST_ENTITY_FILES_QUERY = `
|
|
48
64
|
query ListEntityDocuments($filter: FileFilterInput, $pagination: PaginationInput) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
getFiles(filter: $filter, pagination: $pagination) {
|
|
66
|
+
files {
|
|
67
|
+
id
|
|
68
|
+
name
|
|
69
|
+
size
|
|
70
|
+
mimeType
|
|
71
|
+
createdAt
|
|
72
|
+
downloadUrl
|
|
73
|
+
}
|
|
56
74
|
}
|
|
57
75
|
}
|
|
58
76
|
`;
|
|
@@ -98,20 +116,20 @@ export function useEntityDocuments(
|
|
|
98
116
|
setIsLoading(true);
|
|
99
117
|
setError(null);
|
|
100
118
|
try {
|
|
101
|
-
const data = await executeGraphQL<{ files: ApiFile[] }>(
|
|
119
|
+
const data = await executeGraphQL<{ getFiles: { files: ApiFile[] } }>(
|
|
102
120
|
graphQLOptions,
|
|
103
121
|
LIST_ENTITY_FILES_QUERY,
|
|
104
122
|
{
|
|
105
123
|
filter: {
|
|
106
124
|
tags: [
|
|
107
|
-
{ key: 'mtwEntityType',
|
|
108
|
-
{ key: 'mtwEntityId',
|
|
125
|
+
{ key: 'mtwEntityType', label: entityType },
|
|
126
|
+
{ key: 'mtwEntityId', label: entityId },
|
|
109
127
|
],
|
|
110
128
|
},
|
|
111
129
|
pagination: { limit: 50, offset: 0 },
|
|
112
130
|
}
|
|
113
131
|
);
|
|
114
|
-
setDocuments((data.files ?? []).map(mapFile));
|
|
132
|
+
setDocuments((data.getFiles?.files ?? []).map(mapFile));
|
|
115
133
|
} catch (fetchError) {
|
|
116
134
|
setError(fetchError instanceof Error ? fetchError : new Error('Failed to load documents'));
|
|
117
135
|
setDocuments([]);
|