@burdenoff/microfe-movethewheels 2026.1031.1 → 2026.1031.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 +144 -136
- package/dist/MoveTheWheelsRoutes.js +61 -57
- package/dist/components/ShipmentRiskDialog.js +228 -0
- package/dist/components/TrackingAlertList.js +149 -0
- package/dist/generated/tracking-quality-operations.d.ts +1154 -2
- package/dist/generated/wspace-types.d.ts +2895 -50
- package/dist/hooks/useEntityImport.js +68 -0
- package/dist/hooks/useShipmentRisk.js +72 -0
- package/dist/hooks/useTracking.js +96 -82
- package/dist/movethewheels/components/ShipmentRiskDialog.d.ts +20 -0
- package/dist/movethewheels/components/TrackingAlertList.d.ts +14 -0
- package/dist/movethewheels/hooks/useEntityImport.d.ts +19 -0
- package/dist/movethewheels/hooks/useShipmentRisk.d.ts +41 -0
- package/dist/movethewheels/pages/ImportExportPage.d.ts +9 -0
- package/dist/movethewheels/types/index.d.ts +15 -1
- package/dist/movethewheels/utils/entityImport.d.ts +109 -0
- package/dist/movethewheels/utils/trackingAlerts.d.ts +36 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-up.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/file-up.js +22 -0
- package/dist/pages/CustomersPage.js +88 -79
- package/dist/pages/DashboardPage.js +147 -151
- package/dist/pages/DriversPage.js +115 -106
- package/dist/pages/ImportExportPage.js +435 -0
- package/dist/pages/LiveTrackingPage.js +169 -169
- package/dist/pages/ProductsPage.js +85 -76
- package/dist/pages/VehiclesPage.js +99 -90
- package/dist/pages/WarehousesPage.js +97 -88
- package/dist/utils/entityImport.js +73 -0
- package/dist/utils/trackingAlerts.js +86 -0
- package/package.json +4 -2
- package/src/generated/tracking-quality-operations.ts +1519 -1
- package/src/generated/wspace-types.ts +3248 -51
- package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
- package/src/movethewheels/components/ShipmentRiskDialog.tsx +315 -0
- package/src/movethewheels/components/TrackingAlertList.tsx +188 -0
- package/src/movethewheels/hooks/useEntityImport.ts +108 -0
- package/src/movethewheels/hooks/useShipmentRisk.ts +195 -0
- package/src/movethewheels/hooks/useTracking.ts +66 -22
- package/src/movethewheels/pages/CustomersPage.tsx +6 -1
- package/src/movethewheels/pages/DashboardPage.tsx +10 -20
- package/src/movethewheels/pages/DriversPage.tsx +6 -0
- package/src/movethewheels/pages/ImportExportPage.tsx +483 -0
- package/src/movethewheels/pages/LiveTrackingPage.tsx +20 -22
- package/src/movethewheels/pages/ProductsPage.tsx +14 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +6 -0
- package/src/movethewheels/pages/WarehousesPage.tsx +6 -1
- package/src/movethewheels/types/index.ts +16 -1
- package/src/movethewheels/utils/entityImport.ts +239 -0
- package/src/movethewheels/utils/trackingAlerts.ts +151 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
2
|
+
import { Clock as t } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
3
|
+
import { Gauge as n } from "../node_modules/lucide-react/dist/esm/icons/gauge.js";
|
|
4
|
+
import { formatSlip as r, predictedSlipMinutes as i, riskSignalLabel as a } from "../utils/trackingAlerts.js";
|
|
5
|
+
import { Badge as o, Button as s } from "./ui.js";
|
|
6
|
+
import { formatDateTime as c } from "../utils/formatters.js";
|
|
7
|
+
import { ShipmentRiskDialog as l } from "./ShipmentRiskDialog.js";
|
|
8
|
+
import { useState as u } from "react";
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
//#region src/movethewheels/components/TrackingAlertList.tsx
|
|
11
|
+
var m = {
|
|
12
|
+
critical: "bg-status-error-bg-subtle border-status-error-border",
|
|
13
|
+
high: "bg-status-error-bg-subtle border-status-error-border",
|
|
14
|
+
medium: "bg-status-warning-bg-subtle border-status-warning-border",
|
|
15
|
+
low: "bg-surface-secondary border-border-primary"
|
|
16
|
+
};
|
|
17
|
+
function h({ alert: e, t }) {
|
|
18
|
+
let n = e.severity === "high" || e.severity === "critical", r = e.kind === "AT_RISK" ? t("movethewheels.alerts.kind.atRisk", "At risk") : t("movethewheels.alerts.kind.delayed", "Delayed");
|
|
19
|
+
return /* @__PURE__ */ p(o, {
|
|
20
|
+
variant: n ? "destructive" : "secondary",
|
|
21
|
+
className: "shrink-0",
|
|
22
|
+
children: [r, e.kind === "AT_RISK" && typeof e.riskScore == "number" ? ` · ${e.riskScore}` : ""]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function g({ alert: e, t: a }) {
|
|
26
|
+
let o = i(e);
|
|
27
|
+
return !e.promisedDelivery && !e.predictedDelivery ? null : /* @__PURE__ */ p("dl", {
|
|
28
|
+
className: "mt-2 grid grid-cols-1 gap-x-4 gap-y-1 text-xs text-text-secondary sm:grid-cols-2",
|
|
29
|
+
children: [e.promisedDelivery && /* @__PURE__ */ p("div", {
|
|
30
|
+
className: "flex items-center gap-1",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ f(t, {
|
|
33
|
+
size: 12,
|
|
34
|
+
"aria-hidden": "true"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ p("dt", { children: [a("movethewheels.alerts.promised", "Promised"), ":"] }),
|
|
37
|
+
/* @__PURE__ */ f("dd", {
|
|
38
|
+
className: "text-text-primary",
|
|
39
|
+
children: c(e.promisedDelivery)
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}), e.predictedDelivery && /* @__PURE__ */ p("div", {
|
|
43
|
+
className: "flex items-center gap-1",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ f(n, {
|
|
46
|
+
size: 12,
|
|
47
|
+
"aria-hidden": "true"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ p("dt", { children: [a("movethewheels.alerts.predicted", "Predicted"), ":"] }),
|
|
50
|
+
/* @__PURE__ */ p("dd", {
|
|
51
|
+
className: "text-text-primary",
|
|
52
|
+
children: [c(e.predictedDelivery), o !== null && /* @__PURE__ */ p("span", {
|
|
53
|
+
className: "ml-1 text-status-error-text",
|
|
54
|
+
children: [
|
|
55
|
+
"(+",
|
|
56
|
+
r(o),
|
|
57
|
+
")"
|
|
58
|
+
]
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function _({ alerts: t, limit: n, t: r, onAcknowledge: i, onOpenOrder: o, onChanged: c }) {
|
|
66
|
+
let [_, v] = u(null), [y, b] = u(null), [x, S] = u(null), C = async (e) => {
|
|
67
|
+
v(e), b(null);
|
|
68
|
+
try {
|
|
69
|
+
await i(e);
|
|
70
|
+
} catch (e) {
|
|
71
|
+
b(e instanceof Error ? e.message : r("movethewheels.alerts.ackFailed", "Could not acknowledge the alert"));
|
|
72
|
+
} finally {
|
|
73
|
+
v(null);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return /* @__PURE__ */ p(d, { children: [
|
|
77
|
+
y && /* @__PURE__ */ f("p", {
|
|
78
|
+
role: "alert",
|
|
79
|
+
className: "mb-2 text-xs text-status-error-text",
|
|
80
|
+
children: y
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ f("ul", {
|
|
83
|
+
className: "space-y-3",
|
|
84
|
+
"aria-label": r("movethewheels.alerts.listLabel", "Shipment alerts"),
|
|
85
|
+
children: t.slice(0, n).map((t) => /* @__PURE__ */ p("li", {
|
|
86
|
+
"data-testid": "tracking-alert",
|
|
87
|
+
"data-alert-kind": t.kind,
|
|
88
|
+
className: `rounded-lg border p-3 text-sm ${m[t.severity]}`,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ p("div", {
|
|
91
|
+
className: "flex items-start justify-between gap-2",
|
|
92
|
+
children: [/* @__PURE__ */ p("p", {
|
|
93
|
+
className: "font-medium",
|
|
94
|
+
children: [t.shipmentNumber ? `${t.shipmentNumber}: ` : "", t.message]
|
|
95
|
+
}), /* @__PURE__ */ f(h, {
|
|
96
|
+
alert: t,
|
|
97
|
+
t: r
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ f(g, {
|
|
101
|
+
alert: t,
|
|
102
|
+
t: r
|
|
103
|
+
}),
|
|
104
|
+
t.signals && t.signals.length > 0 && /* @__PURE__ */ f("ul", {
|
|
105
|
+
className: "mt-2 flex flex-wrap gap-1",
|
|
106
|
+
"aria-label": r("movethewheels.alerts.signals", "Risk signals"),
|
|
107
|
+
children: t.signals.map((e) => /* @__PURE__ */ f("li", {
|
|
108
|
+
className: "rounded-full border border-border-primary bg-surface-primary px-2 py-0.5 text-xs text-text-secondary",
|
|
109
|
+
children: a(e, r)
|
|
110
|
+
}, e))
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ p("div", {
|
|
113
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
114
|
+
children: [t.shipmentId && /* @__PURE__ */ f(s, {
|
|
115
|
+
size: "sm",
|
|
116
|
+
variant: "outline",
|
|
117
|
+
onClick: () => S(t),
|
|
118
|
+
children: r("movethewheels.alerts.viewRisk", "View risk")
|
|
119
|
+
}), t.shipmentId && t.kind && /* @__PURE__ */ p(s, {
|
|
120
|
+
size: "sm",
|
|
121
|
+
variant: "ghost",
|
|
122
|
+
disabled: _ === t.id,
|
|
123
|
+
onClick: () => void C(t.id),
|
|
124
|
+
children: [/* @__PURE__ */ f(e, {
|
|
125
|
+
size: 14,
|
|
126
|
+
"aria-hidden": "true"
|
|
127
|
+
}), _ === t.id ? r("movethewheels.alerts.acknowledging", "Acknowledging…") : r("movethewheels.alerts.acknowledge", "Acknowledge")]
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
}, t.id))
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ f(l, {
|
|
134
|
+
shipmentId: x?.shipmentId,
|
|
135
|
+
shipmentNumber: x?.shipmentNumber,
|
|
136
|
+
open: x !== null,
|
|
137
|
+
onOpenChange: (e) => {
|
|
138
|
+
e || S(null);
|
|
139
|
+
},
|
|
140
|
+
t: r,
|
|
141
|
+
onOpenOrder: (e) => {
|
|
142
|
+
S(null), o(e);
|
|
143
|
+
},
|
|
144
|
+
onChanged: c
|
|
145
|
+
})
|
|
146
|
+
] });
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { _ as TrackingAlertList };
|