@burdenoff/microfe-movethewheels 2026.930.1 → 2026.930.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/hooks/useRefetchOnLeaveEdit.js +10 -0
- package/dist/movethewheels/hooks/useRefetchOnLeaveEdit.d.ts +7 -0
- package/dist/pages/DriverDetailsPage.js +238 -235
- package/dist/pages/ProductDetailsPage.js +22 -19
- package/dist/pages/RouteDetailsPage.js +274 -271
- package/dist/pages/VehicleDetailsPage.js +28 -25
- package/package.json +1 -1
- package/src/movethewheels/hooks/useRefetchOnLeaveEdit.ts +18 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/ProductDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +2 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +2 -0
|
@@ -16,12 +16,13 @@ import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b,
|
|
|
16
16
|
import { ErrorState as E, LoadingState as ee, PageLayout as D } from "../components/PageLayout.js";
|
|
17
17
|
import { FormError as O } from "../components/FormError.js";
|
|
18
18
|
import { formatCurrency as te } from "../utils/formatters.js";
|
|
19
|
+
import { useRefetchOnLeaveEdit as ne } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
19
20
|
import { useEffect as k, useState as A } from "react";
|
|
20
|
-
import { useLocation as j, useParams as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { EmphasisPanel as P, NextSteps as
|
|
21
|
+
import { useLocation as j, useParams as re } from "react-router";
|
|
22
|
+
import { Fragment as ie, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
23
|
+
import { EmphasisPanel as P, NextSteps as ae, PagePurpose as F, ResponsiveDialog as oe, ResponsiveDialogContent as se, ResponsiveDialogDescription as ce, ResponsiveDialogFooter as le, ResponsiveDialogHeader as ue, ResponsiveDialogTitle as de } from "@burdenoff/fe-libs/ui";
|
|
23
24
|
//#region src/movethewheels/pages/ProductDetailsPage.tsx
|
|
24
|
-
function
|
|
25
|
+
function I({ editId: t }) {
|
|
25
26
|
let { basePath: n, navigate: r } = f(), { createProduct: i, updateProduct: s } = p(), { product: c } = m(t), l = !!t, [u, h] = A({
|
|
26
27
|
name: "",
|
|
27
28
|
sku: "",
|
|
@@ -316,8 +317,10 @@ function L({ editId: t }) {
|
|
|
316
317
|
})]
|
|
317
318
|
});
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
-
let { productId: o } =
|
|
320
|
+
function L() {
|
|
321
|
+
let { productId: o } = re(), { basePath: S, navigate: C } = f(), { product: w, isLoading: T, error: L, refetch: R } = m(o), { deleteProduct: fe } = p(), z = j().pathname.endsWith("/edit");
|
|
322
|
+
ne(z, R);
|
|
323
|
+
let [B, V] = A(!1), [H, U] = A(!1), [pe, W] = A(null), [G, K] = A(0), { levels: q, totalLevels: J, totalAvailable: me, hasMore: Y, isLoading: X, error: Z } = h(z ? void 0 : o, {
|
|
321
324
|
limit: 20,
|
|
322
325
|
offset: G * 20
|
|
323
326
|
});
|
|
@@ -325,9 +328,9 @@ function R() {
|
|
|
325
328
|
K(0);
|
|
326
329
|
}, [o]);
|
|
327
330
|
let Q = () => C?.(d(S, "inventory/products")), $ = (e) => C?.(d(S, e));
|
|
328
|
-
return o ? z ? /* @__PURE__ */ M(
|
|
331
|
+
return o ? z ? /* @__PURE__ */ M(I, { editId: o }) : T ? /* @__PURE__ */ M(ee, { message: "Loading product details..." }) : L || !w ? /* @__PURE__ */ M(E, {
|
|
329
332
|
title: "Product not found",
|
|
330
|
-
onRetry:
|
|
333
|
+
onRetry: R
|
|
331
334
|
}) : /* @__PURE__ */ N(D, {
|
|
332
335
|
title: w.name,
|
|
333
336
|
subtitle: `SKU: ${w.sku}`,
|
|
@@ -373,7 +376,7 @@ function R() {
|
|
|
373
376
|
icon: /* @__PURE__ */ M(a, { size: 18 }),
|
|
374
377
|
children: "The catalog record for this item — its dimensions, weight, value and handling flags. These drive how it's packed, priced and routed, so keep them accurate before adding the product to an order or stocking it in a warehouse."
|
|
375
378
|
}),
|
|
376
|
-
/* @__PURE__ */ M(
|
|
379
|
+
/* @__PURE__ */ M(ae, {
|
|
377
380
|
storageKey: "movethewheels-product-details",
|
|
378
381
|
steps: [{
|
|
379
382
|
id: "order",
|
|
@@ -485,7 +488,7 @@ function R() {
|
|
|
485
488
|
onClick: () => $("inventory/warehouses"),
|
|
486
489
|
children: "View warehouses"
|
|
487
490
|
})]
|
|
488
|
-
}) : /* @__PURE__ */ N(
|
|
491
|
+
}) : /* @__PURE__ */ N(ie, { children: [
|
|
489
492
|
q.map((e) => /* @__PURE__ */ N("div", {
|
|
490
493
|
className: "flex items-baseline justify-between gap-3",
|
|
491
494
|
children: [/* @__PURE__ */ N("div", {
|
|
@@ -542,7 +545,7 @@ function R() {
|
|
|
542
545
|
children: "Available across the network"
|
|
543
546
|
}), /* @__PURE__ */ M("span", {
|
|
544
547
|
className: "font-bold",
|
|
545
|
-
children:
|
|
548
|
+
children: me.toLocaleString()
|
|
546
549
|
})]
|
|
547
550
|
})
|
|
548
551
|
] })
|
|
@@ -581,20 +584,20 @@ function R() {
|
|
|
581
584
|
]
|
|
582
585
|
})]
|
|
583
586
|
}),
|
|
584
|
-
/* @__PURE__ */ M(
|
|
587
|
+
/* @__PURE__ */ M(oe, {
|
|
585
588
|
open: B,
|
|
586
589
|
onOpenChange: V,
|
|
587
|
-
children: /* @__PURE__ */ N(
|
|
588
|
-
/* @__PURE__ */ N(
|
|
590
|
+
children: /* @__PURE__ */ N(se, { children: [
|
|
591
|
+
/* @__PURE__ */ N(ue, { children: [/* @__PURE__ */ M(de, { children: "Delete this product?" }), /* @__PURE__ */ N(ce, { children: [
|
|
589
592
|
"This removes ",
|
|
590
593
|
w.name,
|
|
591
594
|
" from the catalog and cannot be undone from here."
|
|
592
595
|
] })] }),
|
|
593
596
|
/* @__PURE__ */ M("div", {
|
|
594
597
|
className: "px-1",
|
|
595
|
-
children: /* @__PURE__ */ M(O, { message:
|
|
598
|
+
children: /* @__PURE__ */ M(O, { message: pe })
|
|
596
599
|
}),
|
|
597
|
-
/* @__PURE__ */ N(
|
|
600
|
+
/* @__PURE__ */ N(le, { children: [/* @__PURE__ */ M(_, {
|
|
598
601
|
variant: "outline",
|
|
599
602
|
onClick: () => V(!1),
|
|
600
603
|
disabled: H,
|
|
@@ -605,7 +608,7 @@ function R() {
|
|
|
605
608
|
if (o) {
|
|
606
609
|
U(!0), W(null);
|
|
607
610
|
try {
|
|
608
|
-
await
|
|
611
|
+
await fe(o), V(!1), Q();
|
|
609
612
|
} catch (e) {
|
|
610
613
|
W(e instanceof Error ? e.message : "Failed to delete product."), U(!1);
|
|
611
614
|
}
|
|
@@ -617,7 +620,7 @@ function R() {
|
|
|
617
620
|
] })
|
|
618
621
|
})
|
|
619
622
|
]
|
|
620
|
-
}) : /* @__PURE__ */ M(
|
|
623
|
+
}) : /* @__PURE__ */ M(I, {});
|
|
621
624
|
}
|
|
622
625
|
//#endregion
|
|
623
|
-
export {
|
|
626
|
+
export { L as default };
|