@burdenoff/microfe-movethewheels 2026.626.2 → 2026.703.2
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/{AIAssistantPage-AvsMbunM.js → AIAssistantPage-C3cPsWt-.js} +100 -73
- package/dist/AnalyticsPage-Dz6g2MvK.js +215 -0
- package/dist/{CreateOrderPage-CjlnEtk3.js → CreateOrderPage-C5iwnjp4.js} +36 -67
- package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
- package/dist/{CustomersPage-CGGfD4ki.js → CustomersPage-2Y05LVyh.js} +26 -28
- package/dist/{DashboardPage-D2HRqwg9.js → DashboardPage-BVjQi0EB.js} +85 -83
- package/dist/{DataTable-CD9ZhpLB.js → DataTable-DmciIKKM.js} +3 -3
- package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
- package/dist/{DriversPage-DKiynISH.js → DriversPage-B0Zpx8OQ.js} +25 -27
- package/dist/{FinancePage-Vg8WPs38.js → FinancePage-DEDykSOP.js} +9 -9
- package/dist/FleetPage-DqkFi3s3.js +365 -0
- package/dist/FormError-BlOjnXOq.js +15 -0
- package/dist/ImportExportPage-DKJRCezl.js +290 -0
- package/dist/InventoryPage-DwfgCUQq.js +253 -0
- package/dist/{LiveTrackingPage-DQ1q4Id3.js → LiveTrackingPage-DCX-K-LR.js} +60 -56
- package/dist/MarketplacePage-CIQ97_zp.js +247 -0
- package/dist/{MetricCard-B7yMyvMX.js → MetricCard-BY0QrMD4.js} +1 -1
- package/dist/{OrderDetailsPage-CFASgsYX.js → OrderDetailsPage-DYiZ-9UK.js} +83 -85
- package/dist/{OrdersListPage-BHeT8S5o.js → OrdersListPage-BjDlCKJd.js} +31 -33
- package/dist/{PageLayout-D3N8MCTm.js → PageLayout-D4LDHJJq.js} +483 -422
- package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
- package/dist/{ProductsPage--xEpbQ8A.js → ProductsPage-C1G9h7Xd.js} +22 -24
- package/dist/ReportsPage-Zp53q3_8.js +284 -0
- package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
- package/dist/RoutesPage-DMfoicM1.js +144 -0
- package/dist/SettingsPage-Bn-v0mbQ.js +421 -0
- package/dist/StatusBadge-BZurYHMy.js +152 -0
- package/dist/{TrackingPage-CcRc_dva.js → TrackingPage-W-jtdM3Y.js} +59 -61
- package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
- package/dist/{VehiclesPage-UlxPWP9K.js → VehiclesPage-VBtOep91.js} +20 -22
- package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
- package/dist/{WarehousesPage-CuTO-OPp.js → WarehousesPage-DCbXXXWE.js} +16 -18
- package/dist/{arrow-left-CBpZKkpq.js → arrow-left-n48Y-Wis.js} +1 -1
- package/dist/{box-CAaiElsb.js → box-D9Pal4HM.js} +1 -1
- package/dist/{chart-column-D1Ym15-S.js → chart-column-BFIJysDR.js} +1 -1
- package/dist/{chevron-right-BIFGi0UA.js → chevron-right-EMIIyyJ1.js} +1 -1
- package/dist/{circle-alert-DjmNo5_L.js → circle-alert-iY24lSlp.js} +1 -1
- package/dist/{circle-check-big-CjuPVo3_.js → circle-check-big-w0TrLKMF.js} +1 -1
- package/dist/{clock-BjkdnddD.js → clock-DJZtdl8u.js} +1 -1
- package/dist/{dollar-sign-IB4O0wuQ.js → dollar-sign-CgKQRz_e.js} +1 -1
- package/dist/{download-Dpa9vqoG.js → download-DRXxoiQR.js} +1 -1
- package/dist/{file-text-C8Uioy11.js → file-text-DWWY6_f5.js} +1 -1
- package/dist/{filter-Da5OZaHI.js → filter-DloLC2eE.js} +1 -1
- package/dist/index.js +186 -162
- package/dist/{map-_Per4sT9.js → map-CkJaULb2.js} +1 -1
- package/dist/{map-pin-BSaf5IDL.js → map-pin-BGiCvyCs.js} +1 -1
- package/dist/{navigation-DaTbrhw2.js → navigation-D36prnAn.js} +1 -1
- package/dist/{package-BE7U0wQE.js → package-BChUzpJS.js} +1 -1
- package/dist/{phone-DV4StZiA.js → phone-Ac9s3mo_.js} +1 -1
- package/dist/{plus-Dl1rLeJR.js → plus-Z76q-FZm.js} +1 -1
- package/dist/{refresh-cw-CWfERAit.js → refresh-cw-DKt6f5T6.js} +1 -1
- package/dist/{save-XH8vydOn.js → save-CojywNhG.js} +1 -1
- package/dist/{search-OxoIiL_C.js → search-CDGefqb3.js} +1 -1
- package/dist/{square-pen-hLIbFQFV.js → square-pen-CopE9GmB.js} +1 -1
- package/dist/{star-YsVV3MNQ.js → star-nHlLjDKR.js} +1 -1
- package/dist/{store-RCBl7HB-.js → store-BR9Voi5E.js} +1 -1
- package/dist/trash-2-BKhar6Hs.js +32 -0
- package/dist/{trending-up-C-85AwGT.js → trending-up-Dohgd4t_.js} +1 -1
- package/dist/{triangle-alert-BOhfGgmh.js → triangle-alert-i-XQL9Rd.js} +1 -1
- package/dist/{truck-CtDjNFbi.js → truck-C0v_hbLR.js} +1 -1
- package/dist/{useAnalytics-ph7eTIK6.js → useAnalytics-DS8n0xgg.js} +40 -40
- package/dist/useAssistant-D4v3oxD3.js +84 -0
- package/dist/{useCustomers-bS3a4ytk.js → useCustomers-BmTNGxiI.js} +24 -24
- package/dist/{useFleet-BdETplNE.js → useFleet-DKqXZ16m.js} +133 -109
- package/dist/useImportExport-DHr-SWSw.js +55 -0
- package/dist/{useInventory-Dwn18FPz.js → useInventory-DkyiVY_A.js} +95 -75
- package/dist/{useOrders-D_3_hGMp.js → useOrders-Cfk1GLiq.js} +42 -42
- package/dist/useReports-CTqZr-AB.js +78 -0
- package/dist/{useRoutes-v4aBaS-E.js → useRoutes-BQWO607N.js} +31 -31
- package/dist/useSettings-CkDH_-gM.js +81 -0
- package/dist/{useTracking-De2KIUNu.js → useTracking-B-va1kO3.js} +22 -22
- package/dist/{user-Dz5TJZFs.js → user-jyFU3lXk.js} +1 -1
- package/dist/{users-g2N0eL-Z.js → users-DZ-ilS6B.js} +1 -1
- package/dist/{warehouse-D3WWDeTX.js → warehouse-6m5kXMLu.js} +1 -1
- package/dist/{wrench-CmxY1n4I.js → wrench-CANXWxF-.js} +1 -1
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +31 -3
- package/src/movethewheels/components/FormError.tsx +25 -0
- package/src/movethewheels/components/StatusBadge.tsx +18 -37
- package/src/movethewheels/constants/index.ts +67 -26
- package/src/movethewheels/hooks/index.ts +12 -0
- package/src/movethewheels/hooks/useAnalytics.ts +20 -6
- package/src/movethewheels/hooks/useAssistant.ts +74 -0
- package/src/movethewheels/hooks/useFleet.ts +170 -59
- package/src/movethewheels/hooks/useImportExport.ts +101 -0
- package/src/movethewheels/hooks/useInventory.ts +107 -0
- package/src/movethewheels/hooks/useReports.ts +158 -0
- package/src/movethewheels/hooks/useSettings.ts +120 -0
- package/src/movethewheels/pages/AIAssistantPage.tsx +53 -15
- package/src/movethewheels/pages/AnalyticsPage.tsx +67 -64
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +154 -21
- package/src/movethewheels/pages/CustomersPage.tsx +1 -1
- package/src/movethewheels/pages/DashboardPage.tsx +42 -22
- package/src/movethewheels/pages/DriverDetailsPage.tsx +160 -3
- package/src/movethewheels/pages/DriversPage.tsx +6 -2
- package/src/movethewheels/pages/FleetPage.tsx +96 -38
- package/src/movethewheels/pages/ImportExportPage.tsx +174 -68
- package/src/movethewheels/pages/InventoryPage.tsx +66 -28
- package/src/movethewheels/pages/LiveTrackingPage.tsx +12 -3
- package/src/movethewheels/pages/MarketplacePage.tsx +87 -45
- package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -2
- package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
- package/src/movethewheels/pages/ProductsPage.tsx +5 -1
- package/src/movethewheels/pages/ReportsPage.tsx +194 -90
- package/src/movethewheels/pages/RouteDetailsPage.tsx +290 -36
- package/src/movethewheels/pages/RoutesPage.tsx +4 -9
- package/src/movethewheels/pages/SettingsPage.tsx +234 -56
- package/src/movethewheels/pages/TrackingPage.tsx +6 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +5 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
- package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +7 -6
- package/src/movethewheels/store/movethewheelsStore.ts +1 -1
- package/dist/AnalyticsPage-CCLfHgQZ.js +0 -212
- package/dist/CustomerDetailsPage-I6cdDHUi.js +0 -265
- package/dist/DriverDetailsPage-rg_pGNuP.js +0 -330
- package/dist/FleetPage-DddXt8r8.js +0 -332
- package/dist/ImportExportPage-BW6qO3kc.js +0 -248
- package/dist/InventoryPage-rMGuaJN-.js +0 -222
- package/dist/MarketplacePage-DKrXAv62.js +0 -219
- package/dist/ProductDetailsPage-CFGcbaHo.js +0 -195
- package/dist/ReportsPage-Bb7_90rK.js +0 -235
- package/dist/RouteDetailsPage-CVtDVb1N.js +0 -282
- package/dist/RoutesPage-s57PtgcQ.js +0 -163
- package/dist/SettingsPage-BYNCBOpN.js +0 -298
- package/dist/StatusBadge-CijYQXtb.js +0 -209
- package/dist/VehicleDetailsPage-3YDMPsPs.js +0 -220
- package/dist/WarehouseDetailsPage-Db7KeN-d.js +0 -238
- package/dist/graphqlClient-CdJyR_ed.js +0 -55
- package/dist/navigation-BgnOfsVd.js +0 -6
- package/dist/route-Dp9JiN_E.js +0 -51
- package/dist/settings-3Rw5NwFF.js +0 -28
- package/src/movethewheels/constants/mockData.ts +0 -1342
- /package/dist/{formatters-_vJlC-47.js → formatters-CF2S2l1m.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useRoutes.ts
|
|
4
4
|
var o = "\n query ListRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {\n routes(filter: $filter, pagination: $pagination) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", s = "\n query GetRoute($id: ID!) {\n route(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", c = "\n mutation CreateRoute($input: CreateRouteInput!) {\n createRoute(input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", l = "\n mutation UpdateRoute($id: ID!, $input: UpdateRouteInput!) {\n updateRoute(id: $id, input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", u = "\n mutation DeleteRoute($id: ID!) {\n deleteRoute(id: $id)\n }\n", d = "\n mutation OptimizeRoute($id: ID!) {\n optimizeRoute(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n";
|
|
@@ -62,16 +62,16 @@ function h(e) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
function g() {
|
|
65
|
-
let { apiGatewayUrl:
|
|
65
|
+
let { apiGatewayUrl: e, authToken: n, workspaceToken: r, workspaceId: a, tenantId: o, currentUser: s } = t();
|
|
66
66
|
return i(() => ({
|
|
67
|
-
apiGatewayUrl:
|
|
67
|
+
apiGatewayUrl: e,
|
|
68
68
|
authToken: n,
|
|
69
69
|
workspaceToken: r,
|
|
70
70
|
workspaceId: a,
|
|
71
71
|
tenantId: o,
|
|
72
72
|
actorId: s?.id
|
|
73
73
|
}), [
|
|
74
|
-
|
|
74
|
+
e,
|
|
75
75
|
n,
|
|
76
76
|
r,
|
|
77
77
|
a,
|
|
@@ -79,11 +79,11 @@ function g() {
|
|
|
79
79
|
s?.id
|
|
80
80
|
]);
|
|
81
81
|
}
|
|
82
|
-
function _(
|
|
83
|
-
let { driverId: i, vehicleId: s, status: f } =
|
|
82
|
+
function _(t = {}) {
|
|
83
|
+
let { driverId: i, vehicleId: s, status: f } = t, m = g(), [_, v] = a([]), [y, b] = a(!1), [x, S] = a(null), C = n(async () => {
|
|
84
84
|
b(!0), S(null);
|
|
85
85
|
try {
|
|
86
|
-
v((await
|
|
86
|
+
v((await e(m, o, {
|
|
87
87
|
filter: {
|
|
88
88
|
driverId: i,
|
|
89
89
|
vehicleId: s,
|
|
@@ -110,23 +110,23 @@ function _(e = {}) {
|
|
|
110
110
|
}, [C]);
|
|
111
111
|
let w = n(() => {
|
|
112
112
|
C();
|
|
113
|
-
}, [C]), T = n(async (
|
|
114
|
-
let n = h((await
|
|
115
|
-
name:
|
|
116
|
-
status: p(
|
|
113
|
+
}, [C]), T = n(async (t) => {
|
|
114
|
+
let n = h((await e(m, c, { input: {
|
|
115
|
+
name: t.name ?? `Route ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
|
|
116
|
+
status: p(t.status),
|
|
117
117
|
shipmentId: void 0,
|
|
118
|
-
vehicleId:
|
|
119
|
-
driverId:
|
|
120
|
-
waypoints:
|
|
121
|
-
estimatedDistance:
|
|
122
|
-
estimatedDuration:
|
|
123
|
-
actualDistance:
|
|
124
|
-
actualDuration:
|
|
118
|
+
vehicleId: t.vehicleId,
|
|
119
|
+
driverId: t.driverId,
|
|
120
|
+
waypoints: t.stops ?? [],
|
|
121
|
+
estimatedDistance: t.distance ?? 0,
|
|
122
|
+
estimatedDuration: t.estimatedDuration ?? 0,
|
|
123
|
+
actualDistance: t.distance,
|
|
124
|
+
actualDuration: t.actualDuration
|
|
125
125
|
} })).createRoute);
|
|
126
126
|
return v((e) => [n, ...e]), n;
|
|
127
|
-
}, [m]), E = n(async (
|
|
128
|
-
let r = h((await
|
|
129
|
-
id:
|
|
127
|
+
}, [m]), E = n(async (t, n) => {
|
|
128
|
+
let r = h((await e(m, l, {
|
|
129
|
+
id: t,
|
|
130
130
|
input: {
|
|
131
131
|
name: n.name,
|
|
132
132
|
status: p(n.status),
|
|
@@ -140,15 +140,15 @@ function _(e = {}) {
|
|
|
140
140
|
actualDuration: n.actualDuration
|
|
141
141
|
}
|
|
142
142
|
})).updateRoute);
|
|
143
|
-
return v((
|
|
144
|
-
}, [m]), D = n(async (
|
|
145
|
-
await
|
|
146
|
-
}, [m]), O = n(async (
|
|
143
|
+
return v((e) => e.map((e) => e.id === t ? r : e)), r;
|
|
144
|
+
}, [m]), D = n(async (t) => {
|
|
145
|
+
await e(m, u, { id: t }), v((e) => e.filter((e) => e.id !== t));
|
|
146
|
+
}, [m]), O = n(async (t) => {
|
|
147
147
|
let n = {
|
|
148
|
-
...h((await
|
|
148
|
+
...h((await e(m, d, { id: t })).optimizeRoute),
|
|
149
149
|
optimized: !0
|
|
150
150
|
};
|
|
151
|
-
return v((
|
|
151
|
+
return v((e) => e.map((e) => e.id === t ? n : e)), n;
|
|
152
152
|
}, [m]), k = n(async (e, t, n) => {
|
|
153
153
|
let r = _.find((t) => t.id === e);
|
|
154
154
|
if (!r) throw Error("Route not found");
|
|
@@ -175,22 +175,22 @@ function _(e = {}) {
|
|
|
175
175
|
updateStopStatus: k
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function v(
|
|
178
|
+
function v(t) {
|
|
179
179
|
let i = g(), [o, c] = a(null), [l, u] = a(!1), [d, f] = a(null), p = n(async () => {
|
|
180
|
-
if (!
|
|
180
|
+
if (!t) {
|
|
181
181
|
c(null);
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
u(!0), f(null);
|
|
185
185
|
try {
|
|
186
|
-
let n = await
|
|
186
|
+
let n = await e(i, s, { id: t });
|
|
187
187
|
c(n.route ? h(n.route) : null);
|
|
188
188
|
} catch (e) {
|
|
189
189
|
f(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load route"));
|
|
190
190
|
} finally {
|
|
191
191
|
u(!1);
|
|
192
192
|
}
|
|
193
|
-
}, [i,
|
|
193
|
+
}, [i, t]);
|
|
194
194
|
return r(() => {
|
|
195
195
|
p();
|
|
196
196
|
}, [p]), {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { it as e, lt as t, ot as n } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
+
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
3
|
+
//#region node_modules/lucide-react/dist/esm/icons/globe.js
|
|
4
|
+
var s = t("Globe", [
|
|
5
|
+
["circle", {
|
|
6
|
+
cx: "12",
|
|
7
|
+
cy: "12",
|
|
8
|
+
r: "10",
|
|
9
|
+
key: "1mglay"
|
|
10
|
+
}],
|
|
11
|
+
["path", {
|
|
12
|
+
d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",
|
|
13
|
+
key: "13o1zl"
|
|
14
|
+
}],
|
|
15
|
+
["path", {
|
|
16
|
+
d: "M2 12h20",
|
|
17
|
+
key: "9i4pu4"
|
|
18
|
+
}]
|
|
19
|
+
]), c = t("Settings", [["path", {
|
|
20
|
+
d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
|
|
21
|
+
key: "1qme2f"
|
|
22
|
+
}], ["circle", {
|
|
23
|
+
cx: "12",
|
|
24
|
+
cy: "12",
|
|
25
|
+
r: "3",
|
|
26
|
+
key: "1v7zrd"
|
|
27
|
+
}]]), l = "\n query MovethewheelsModuleSettings {\n moduleSettings {\n preferences\n updatedAt\n workspaceId\n }\n }\n", u = "\n mutation UpdateMovethewheelsModuleSettings($input: UpdateMovethewheelsModuleSettingsInput!) {\n updateModuleSettings(input: $input) {\n preferences\n updatedAt\n workspaceId\n }\n }\n";
|
|
28
|
+
function d() {
|
|
29
|
+
let { apiGatewayUrl: t, authToken: s, workspaceToken: c, workspaceId: d, tenantId: f, currentUser: p } = n(), [m, h] = o(null), [g, _] = o(!1), [v, y] = o(!1), [b, x] = o(null), S = a(() => ({
|
|
30
|
+
apiGatewayUrl: t,
|
|
31
|
+
authToken: s,
|
|
32
|
+
workspaceToken: c,
|
|
33
|
+
workspaceId: d,
|
|
34
|
+
tenantId: f,
|
|
35
|
+
actorId: p?.id
|
|
36
|
+
}), [
|
|
37
|
+
t,
|
|
38
|
+
s,
|
|
39
|
+
c,
|
|
40
|
+
d,
|
|
41
|
+
f,
|
|
42
|
+
p?.id
|
|
43
|
+
]), C = r(async () => {
|
|
44
|
+
_(!0), x(null);
|
|
45
|
+
try {
|
|
46
|
+
h((await e(S, l)).moduleSettings);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
x(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load settings"));
|
|
49
|
+
} finally {
|
|
50
|
+
_(!1);
|
|
51
|
+
}
|
|
52
|
+
}, [S]);
|
|
53
|
+
i(() => {
|
|
54
|
+
C();
|
|
55
|
+
}, [C]);
|
|
56
|
+
let w = r(() => {
|
|
57
|
+
C();
|
|
58
|
+
}, [C]), T = r(async (t) => {
|
|
59
|
+
y(!0), x(null);
|
|
60
|
+
try {
|
|
61
|
+
let n = await e(S, u, { input: { preferences: t } });
|
|
62
|
+
return h(n.updateModuleSettings), n.updateModuleSettings;
|
|
63
|
+
} catch (e) {
|
|
64
|
+
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save settings");
|
|
65
|
+
throw x(t), t;
|
|
66
|
+
} finally {
|
|
67
|
+
y(!1);
|
|
68
|
+
}
|
|
69
|
+
}, [S]);
|
|
70
|
+
return {
|
|
71
|
+
settings: m,
|
|
72
|
+
preferences: m?.preferences ?? {},
|
|
73
|
+
isLoading: g,
|
|
74
|
+
isSaving: v,
|
|
75
|
+
error: b,
|
|
76
|
+
refetch: w,
|
|
77
|
+
savePreferences: T
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { c as n, s as r, d as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as n, t as r } from "./useOrders-
|
|
3
|
-
import { a as i, n as a, o, t as s } from "./useFleet-
|
|
1
|
+
import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
+
import { r as n, t as r } from "./useOrders-Cfk1GLiq.js";
|
|
3
|
+
import { a as i, n as a, o, t as s } from "./useFleet-DKqXZ16m.js";
|
|
4
4
|
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
5
5
|
//#region src/movethewheels/hooks/useTracking.ts
|
|
6
6
|
var f = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", p = "\n query GetShipment($id: ID!) {\n shipment(id: $id) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n trackingEvents {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n }\n", m = "\n query GetOrderTracking($orderId: ID!) {\n orderTracking(orderId: $orderId) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n", h = "\n query GetActiveDeliveries {\n activeDeliveries {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", g = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
|
|
@@ -25,16 +25,16 @@ function _(e, t) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function v() {
|
|
28
|
-
let { apiGatewayUrl:
|
|
28
|
+
let { apiGatewayUrl: e, authToken: n, workspaceToken: r, workspaceId: i, tenantId: a, currentUser: o } = t();
|
|
29
29
|
return u(() => ({
|
|
30
|
-
apiGatewayUrl:
|
|
30
|
+
apiGatewayUrl: e,
|
|
31
31
|
authToken: n,
|
|
32
32
|
workspaceToken: r,
|
|
33
33
|
workspaceId: i,
|
|
34
34
|
tenantId: a,
|
|
35
35
|
actorId: o?.id
|
|
36
36
|
}), [
|
|
37
|
-
|
|
37
|
+
e,
|
|
38
38
|
n,
|
|
39
39
|
r,
|
|
40
40
|
i,
|
|
@@ -42,11 +42,11 @@ function v() {
|
|
|
42
42
|
o?.id
|
|
43
43
|
]);
|
|
44
44
|
}
|
|
45
|
-
function y(
|
|
46
|
-
let { entityId: n, entityType: r } =
|
|
45
|
+
function y(t = {}) {
|
|
46
|
+
let { entityId: n, entityType: r } = t, i = v(), [a, o] = d([]), [s, u] = d(!1), [p, m] = d(null), h = c(async () => {
|
|
47
47
|
u(!0), m(null);
|
|
48
48
|
try {
|
|
49
|
-
o((await
|
|
49
|
+
o((await e(i, f, { pagination: {
|
|
50
50
|
limit: 200,
|
|
51
51
|
offset: 0
|
|
52
52
|
} })).shipments.map((e) => ({
|
|
@@ -84,22 +84,22 @@ function y(e = {}) {
|
|
|
84
84
|
refetch: () => void h()
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function b(
|
|
88
|
-
let n = v(), { order: i } = r(
|
|
89
|
-
if (!
|
|
87
|
+
function b(t) {
|
|
88
|
+
let n = v(), { order: i } = r(t), [a, o] = d(null), [s, u] = d(!1), [f, p] = d(null), h = c(async () => {
|
|
89
|
+
if (!t) {
|
|
90
90
|
o(null);
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
u(!0), p(null);
|
|
94
94
|
try {
|
|
95
|
-
let r = await
|
|
96
|
-
o(i ? _(i,
|
|
95
|
+
let r = await e(n, m, { orderId: t }), i = r.orderTracking[r.orderTracking.length - 1];
|
|
96
|
+
o(i ? _(i, t) : null);
|
|
97
97
|
} catch (e) {
|
|
98
98
|
p(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order tracking"));
|
|
99
99
|
} finally {
|
|
100
100
|
u(!1);
|
|
101
101
|
}
|
|
102
|
-
}, [n,
|
|
102
|
+
}, [n, t]);
|
|
103
103
|
return l(() => {
|
|
104
104
|
h();
|
|
105
105
|
}, [h]), {
|
|
@@ -149,12 +149,12 @@ function S(e) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
function C() {
|
|
152
|
-
let
|
|
152
|
+
let t = v(), { orders: r } = n(), { vehicles: i } = o(), { drivers: s } = a(), [u, f] = d([]), [m, g] = d(!1), [y, b] = d(null), x = c(async () => {
|
|
153
153
|
g(!0), b(null);
|
|
154
154
|
try {
|
|
155
|
-
let n = await t
|
|
155
|
+
let n = await e(t, h);
|
|
156
156
|
f((await Promise.all(n.activeDeliveries.map(async (n) => {
|
|
157
|
-
let a = (await t
|
|
157
|
+
let a = (await e(t, p, { id: n.id })).shipment?.trackingEvents ?? [], o = a[a.length - 1], c = r.find((e) => e.id === n.orderId);
|
|
158
158
|
return c ? {
|
|
159
159
|
order: c,
|
|
160
160
|
driver: c.driverId ? s.find((e) => e.id === c.driverId || e.userId === c.driverId) ?? null : null,
|
|
@@ -170,7 +170,7 @@ function C() {
|
|
|
170
170
|
}
|
|
171
171
|
}, [
|
|
172
172
|
s,
|
|
173
|
-
|
|
173
|
+
t,
|
|
174
174
|
r,
|
|
175
175
|
i
|
|
176
176
|
]);
|
|
@@ -184,10 +184,10 @@ function C() {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
function w() {
|
|
187
|
-
let
|
|
187
|
+
let t = v(), [n, r] = d([]), [i, a] = d(!1), [o, s] = d(null), f = c(async () => {
|
|
188
188
|
a(!0), s(null);
|
|
189
189
|
try {
|
|
190
|
-
r((await t
|
|
190
|
+
r((await e(t, g)).trackingAlerts.map((e) => ({
|
|
191
191
|
id: `${e.shipmentId}-${e.alertType}`,
|
|
192
192
|
type: "delay",
|
|
193
193
|
severity: "medium",
|
|
@@ -200,7 +200,7 @@ function w() {
|
|
|
200
200
|
} finally {
|
|
201
201
|
a(!1);
|
|
202
202
|
}
|
|
203
|
-
}, [
|
|
203
|
+
}, [t]);
|
|
204
204
|
return l(() => {
|
|
205
205
|
f();
|
|
206
206
|
}, [f]), {
|
package/package.json
CHANGED
|
@@ -5,8 +5,32 @@
|
|
|
5
5
|
* Uses lazy loading for code splitting.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { Routes, Route,
|
|
8
|
+
import { Routes, Route, useNavigate } from 'react-router-dom';
|
|
9
9
|
import { lazy, Suspense } from 'react';
|
|
10
|
+
import { NotFoundPage } from '@burdenoff/fe-libs/shared/pages';
|
|
11
|
+
import { useMoveTheWheels } from './providers/MoveTheWheelsProvider';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Catch-all 404 rendered inside the content area (previously a redirect to ""
|
|
15
|
+
* that left the page blank). "Back to MoveTheWheels" returns to the overview
|
|
16
|
+
* via the host navigation when mounted, or the router root in standalone dev.
|
|
17
|
+
*/
|
|
18
|
+
function MoveTheWheelsNotFound() {
|
|
19
|
+
const { navigate, basePath } = useMoveTheWheels();
|
|
20
|
+
const routerNavigate = useNavigate();
|
|
21
|
+
return (
|
|
22
|
+
<NotFoundPage
|
|
23
|
+
homeLabel="Back to MoveTheWheels"
|
|
24
|
+
onGoHome={() => {
|
|
25
|
+
if (navigate) {
|
|
26
|
+
navigate(basePath || '/');
|
|
27
|
+
} else {
|
|
28
|
+
routerNavigate('/');
|
|
29
|
+
}
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
10
34
|
|
|
11
35
|
// Loading fallback
|
|
12
36
|
function PageLoader() {
|
|
@@ -69,15 +93,19 @@ export function MoveTheWheelsRoutes() {
|
|
|
69
93
|
{/* Fleet */}
|
|
70
94
|
<Route path="fleet" element={<FleetPage />} />
|
|
71
95
|
<Route path="fleet/vehicles" element={<VehiclesPage />} />
|
|
96
|
+
<Route path="fleet/vehicles/new" element={<VehicleDetailsPage />} />
|
|
72
97
|
<Route path="fleet/vehicles/:vehicleId" element={<VehicleDetailsPage />} />
|
|
73
98
|
<Route path="fleet/drivers" element={<DriversPage />} />
|
|
99
|
+
<Route path="fleet/drivers/new" element={<DriverDetailsPage />} />
|
|
74
100
|
<Route path="fleet/drivers/:driverId" element={<DriverDetailsPage />} />
|
|
75
101
|
|
|
76
102
|
{/* Inventory */}
|
|
77
103
|
<Route path="inventory" element={<InventoryPage />} />
|
|
78
104
|
<Route path="inventory/products" element={<ProductsPage />} />
|
|
105
|
+
<Route path="inventory/products/new" element={<ProductDetailsPage />} />
|
|
79
106
|
<Route path="inventory/products/:productId" element={<ProductDetailsPage />} />
|
|
80
107
|
<Route path="inventory/warehouses" element={<WarehousesPage />} />
|
|
108
|
+
<Route path="inventory/warehouses/new" element={<WarehouseDetailsPage />} />
|
|
81
109
|
<Route path="inventory/warehouses/:warehouseId" element={<WarehouseDetailsPage />} />
|
|
82
110
|
|
|
83
111
|
{/* Customers */}
|
|
@@ -111,8 +139,8 @@ export function MoveTheWheelsRoutes() {
|
|
|
111
139
|
{/* Settings */}
|
|
112
140
|
<Route path="settings" element={<SettingsPage />} />
|
|
113
141
|
|
|
114
|
-
{/* Catch-all -
|
|
115
|
-
<Route path="*" element={<
|
|
142
|
+
{/* Catch-all - friendly 404 */}
|
|
143
|
+
<Route path="*" element={<MoveTheWheelsNotFound />} />
|
|
116
144
|
</Routes>
|
|
117
145
|
</Suspense>
|
|
118
146
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormError — inline error banner for create/edit forms.
|
|
3
|
+
*
|
|
4
|
+
* Renders nothing when there is no message, so it can be dropped into a form
|
|
5
|
+
* unconditionally. Uses semantic status tokens so it themes correctly.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AlertCircle } from 'lucide-react';
|
|
9
|
+
|
|
10
|
+
interface FormErrorProps {
|
|
11
|
+
message?: string | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function FormError({ message }: FormErrorProps) {
|
|
15
|
+
if (!message) return null;
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
role="alert"
|
|
19
|
+
className="flex items-start gap-2 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text"
|
|
20
|
+
>
|
|
21
|
+
<AlertCircle size={18} className="mt-0.5 shrink-0" />
|
|
22
|
+
<span>{message}</span>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { cn } from '../utils/cn';
|
|
2
2
|
import { Badge } from './ui';
|
|
3
3
|
import type { OrderStatus, VehicleStatus, DriverStatus } from '../types';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ORDER_STATUS_COLORS,
|
|
6
|
+
VEHICLE_STATUS_COLORS,
|
|
7
|
+
DRIVER_STATUS_COLORS,
|
|
8
|
+
PRIORITY_COLORS,
|
|
9
|
+
} from '../constants';
|
|
5
10
|
|
|
6
11
|
type StatusType = 'order' | 'vehicle' | 'driver' | 'custom';
|
|
7
12
|
|
|
@@ -37,28 +42,20 @@ export function StatusBadge({
|
|
|
37
42
|
// Get colors based on type
|
|
38
43
|
let colors = customColors;
|
|
39
44
|
|
|
45
|
+
const neutral = { bg: 'bg-bg-sunken', text: 'text-text-secondary' };
|
|
40
46
|
if (!colors) {
|
|
41
47
|
switch (type) {
|
|
42
48
|
case 'order':
|
|
43
|
-
colors = ORDER_STATUS_COLORS[status as OrderStatus] ||
|
|
44
|
-
bg: 'bg-gray-100',
|
|
45
|
-
text: 'text-gray-700',
|
|
46
|
-
};
|
|
49
|
+
colors = ORDER_STATUS_COLORS[status as OrderStatus] || neutral;
|
|
47
50
|
break;
|
|
48
51
|
case 'vehicle':
|
|
49
|
-
colors = VEHICLE_STATUS_COLORS[status as VehicleStatus] ||
|
|
50
|
-
bg: 'bg-gray-100',
|
|
51
|
-
text: 'text-gray-700',
|
|
52
|
-
};
|
|
52
|
+
colors = VEHICLE_STATUS_COLORS[status as VehicleStatus] || neutral;
|
|
53
53
|
break;
|
|
54
54
|
case 'driver':
|
|
55
|
-
colors = DRIVER_STATUS_COLORS[status as DriverStatus] ||
|
|
56
|
-
bg: 'bg-gray-100',
|
|
57
|
-
text: 'text-gray-700',
|
|
58
|
-
};
|
|
55
|
+
colors = DRIVER_STATUS_COLORS[status as DriverStatus] || neutral;
|
|
59
56
|
break;
|
|
60
57
|
default:
|
|
61
|
-
colors =
|
|
58
|
+
colors = neutral;
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
|
|
@@ -102,17 +99,7 @@ export function PriorityBadge({
|
|
|
102
99
|
size?: 'sm' | 'md' | 'lg';
|
|
103
100
|
className?: string;
|
|
104
101
|
}) {
|
|
105
|
-
const
|
|
106
|
-
low: { bg: 'bg-gray-100 dark:bg-gray-800', text: 'text-gray-600 dark:text-gray-400' },
|
|
107
|
-
normal: { bg: 'bg-blue-100 dark:bg-blue-900/30', text: 'text-blue-700 dark:text-blue-400' },
|
|
108
|
-
high: {
|
|
109
|
-
bg: 'bg-orange-100 dark:bg-orange-900/30',
|
|
110
|
-
text: 'text-orange-700 dark:text-orange-400',
|
|
111
|
-
},
|
|
112
|
-
urgent: { bg: 'bg-red-100 dark:bg-red-900/30', text: 'text-red-700 dark:text-red-400' },
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const colors = priorityColors[priority];
|
|
102
|
+
const colors = PRIORITY_COLORS[priority];
|
|
116
103
|
|
|
117
104
|
return (
|
|
118
105
|
<Badge
|
|
@@ -143,11 +130,8 @@ export function TypeBadge({
|
|
|
143
130
|
className?: string;
|
|
144
131
|
}) {
|
|
145
132
|
const typeColors = {
|
|
146
|
-
b2b: {
|
|
147
|
-
|
|
148
|
-
text: 'text-purple-700 dark:text-purple-400',
|
|
149
|
-
},
|
|
150
|
-
b2c: { bg: 'bg-teal-100 dark:bg-teal-900/30', text: 'text-teal-700 dark:text-teal-400' },
|
|
133
|
+
b2b: { bg: 'bg-status-info-bg-subtle', text: 'text-status-info-text' },
|
|
134
|
+
b2c: { bg: 'bg-status-success-bg-subtle', text: 'text-status-success-text' },
|
|
151
135
|
};
|
|
152
136
|
|
|
153
137
|
const colors = typeColors[type];
|
|
@@ -181,13 +165,10 @@ export function PaymentStatusBadge({
|
|
|
181
165
|
className?: string;
|
|
182
166
|
}) {
|
|
183
167
|
const statusColors = {
|
|
184
|
-
pending: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
paid: { bg: 'bg-green-100 dark:bg-green-900/30', text: 'text-green-700 dark:text-green-400' },
|
|
189
|
-
failed: { bg: 'bg-red-100 dark:bg-red-900/30', text: 'text-red-700 dark:text-red-400' },
|
|
190
|
-
refunded: { bg: 'bg-gray-100 dark:bg-gray-800', text: 'text-gray-700 dark:text-gray-400' },
|
|
168
|
+
pending: { bg: 'bg-status-warning-bg-subtle', text: 'text-status-warning-text' },
|
|
169
|
+
paid: { bg: 'bg-status-success-bg-subtle', text: 'text-status-success-text' },
|
|
170
|
+
failed: { bg: 'bg-status-error-bg-subtle', text: 'text-status-error-text' },
|
|
171
|
+
refunded: { bg: 'bg-bg-sunken', text: 'text-text-secondary' },
|
|
191
172
|
};
|
|
192
173
|
|
|
193
174
|
const colors = statusColors[status];
|