@mercurjs/admin 2.3.4 → 2.3.5
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.
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
// src/pages/orders/order-detail/order-detail.tsx
|
|
119
119
|
import { Children } from "react";
|
|
120
120
|
import { useLoaderData, useParams as useParams2 } from "react-router-dom";
|
|
121
|
-
import { useLinkQuery, WidgetZone } from "@mercurjs/dashboard-shared";
|
|
121
|
+
import { useLinkQuery, WidgetZone as WidgetZone2 } from "@mercurjs/dashboard-shared";
|
|
122
122
|
|
|
123
123
|
// src/pages/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx
|
|
124
124
|
import { ExclamationCircle } from "@medusajs/icons";
|
|
@@ -463,6 +463,7 @@ import { Button as Button5, Text as Text6, Tooltip, clx, toast as toast5, usePro
|
|
|
463
463
|
import { Collapsible as RadixCollapsible } from "radix-ui";
|
|
464
464
|
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
465
465
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
466
|
+
import { useExtensionActivity } from "@mercurjs/dashboard-shared";
|
|
466
467
|
|
|
467
468
|
// src/pages/orders/order-detail/components/order-activity-section/activity-items.tsx
|
|
468
469
|
import { Popover, Text as Text4 } from "@medusajs/ui";
|
|
@@ -654,6 +655,7 @@ var OrderTimeline = ({ order }) => {
|
|
|
654
655
|
};
|
|
655
656
|
var useActivityItems = (order) => {
|
|
656
657
|
const { t } = useTranslation7();
|
|
658
|
+
const extensionActivity = useExtensionActivity("order", order);
|
|
657
659
|
const { order_changes: orderChanges = [] } = useOrderChanges(order.id, {
|
|
658
660
|
change_type: [
|
|
659
661
|
"edit",
|
|
@@ -969,6 +971,7 @@ var useActivityItems = (order) => {
|
|
|
969
971
|
timestamp: order.canceled_at
|
|
970
972
|
});
|
|
971
973
|
}
|
|
974
|
+
items.push(...extensionActivity);
|
|
972
975
|
const sortedActivities = items.sort((a, b) => {
|
|
973
976
|
return new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime();
|
|
974
977
|
});
|
|
@@ -987,6 +990,7 @@ var useActivityItems = (order) => {
|
|
|
987
990
|
isLoading,
|
|
988
991
|
itemsMap,
|
|
989
992
|
claims,
|
|
993
|
+
extensionActivity,
|
|
990
994
|
t
|
|
991
995
|
]);
|
|
992
996
|
};
|
|
@@ -1033,8 +1037,7 @@ var OrderActivityItem = ({
|
|
|
1033
1037
|
itemsToSend,
|
|
1034
1038
|
itemsToReturn,
|
|
1035
1039
|
itemsMap
|
|
1036
|
-
}
|
|
1037
|
-
title
|
|
1040
|
+
}
|
|
1038
1041
|
) : /* @__PURE__ */ jsx7(
|
|
1039
1042
|
Text6,
|
|
1040
1043
|
{
|
|
@@ -2441,7 +2444,9 @@ import {
|
|
|
2441
2444
|
import {
|
|
2442
2445
|
DisplayExtensionZone as DisplayExtensionZone5,
|
|
2443
2446
|
isOrderActionable as isOrderActionable2,
|
|
2444
|
-
isOrderAwaitingAction
|
|
2447
|
+
isOrderAwaitingAction,
|
|
2448
|
+
useActionLocks,
|
|
2449
|
+
WidgetZone
|
|
2445
2450
|
} from "@mercurjs/dashboard-shared";
|
|
2446
2451
|
import { format as format3 } from "date-fns";
|
|
2447
2452
|
|
|
@@ -2678,6 +2683,11 @@ var Header3 = ({
|
|
|
2678
2683
|
orderPreview
|
|
2679
2684
|
}) => {
|
|
2680
2685
|
const { t } = useTranslation17();
|
|
2686
|
+
const lock = useActionLocks("order", order);
|
|
2687
|
+
const editLock = lock("edit");
|
|
2688
|
+
const returnLock = lock("return");
|
|
2689
|
+
const exchangeLock = lock("exchange");
|
|
2690
|
+
const claimLock = lock("claim");
|
|
2681
2691
|
const shouldDisableReturn = order.items.every(
|
|
2682
2692
|
(i) => !(getReturnableQuantity(i) > 0)
|
|
2683
2693
|
);
|
|
@@ -2702,8 +2712,8 @@ var Header3 = ({
|
|
|
2702
2712
|
),
|
|
2703
2713
|
to: `/orders/${order.id}/edits`,
|
|
2704
2714
|
icon: /* @__PURE__ */ jsx17(PencilSquare, {}),
|
|
2705
|
-
disabledTooltip: isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0,
|
|
2706
|
-
disabled: !isOrderActionable2(order) || orderPreview?.order_change && orderPreview?.order_change?.change_type !== "edit" || orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "requested"
|
|
2715
|
+
disabledTooltip: editLock ?? (isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0),
|
|
2716
|
+
disabled: !!editLock || !isOrderActionable2(order) || orderPreview?.order_change && orderPreview?.order_change?.change_type !== "edit" || orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "requested"
|
|
2707
2717
|
}
|
|
2708
2718
|
]
|
|
2709
2719
|
},
|
|
@@ -2713,22 +2723,22 @@ var Header3 = ({
|
|
|
2713
2723
|
label: t("orders.returns.create"),
|
|
2714
2724
|
to: `/orders/${order.id}/returns`,
|
|
2715
2725
|
icon: /* @__PURE__ */ jsx17(ArrowUturnLeft2, {}),
|
|
2716
|
-
disabledTooltip: isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0,
|
|
2717
|
-
disabled: !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2726
|
+
disabledTooltip: returnLock ?? (isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0),
|
|
2727
|
+
disabled: !!returnLock || !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2718
2728
|
},
|
|
2719
2729
|
{
|
|
2720
2730
|
label: orderPreview?.order_change?.id && orderPreview?.order_change?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
|
|
2721
2731
|
to: `/orders/${order.id}/exchanges`,
|
|
2722
2732
|
icon: /* @__PURE__ */ jsx17(ArrowPath3, {}),
|
|
2723
|
-
disabledTooltip: isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0,
|
|
2724
|
-
disabled: !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2733
|
+
disabledTooltip: exchangeLock ?? (isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0),
|
|
2734
|
+
disabled: !!exchangeLock || !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2725
2735
|
},
|
|
2726
2736
|
{
|
|
2727
2737
|
label: orderPreview?.order_change?.id && orderPreview?.order_change?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
|
|
2728
2738
|
to: `/orders/${order.id}/claims`,
|
|
2729
2739
|
icon: /* @__PURE__ */ jsx17(ExclamationCircle2, {}),
|
|
2730
|
-
disabledTooltip: isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0,
|
|
2731
|
-
disabled: !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.claim_id || !!orderPreview?.order_change?.exchange_id
|
|
2740
|
+
disabledTooltip: claimLock ?? (isOrderAwaitingAction(order) ? t("orders.requiresAction.actionUnavailable") : void 0),
|
|
2741
|
+
disabled: !!claimLock || !isOrderActionable2(order) || shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.claim_id || !!orderPreview?.order_change?.exchange_id
|
|
2732
2742
|
}
|
|
2733
2743
|
]
|
|
2734
2744
|
}
|
|
@@ -2741,6 +2751,7 @@ var Header3 = ({
|
|
|
2741
2751
|
);
|
|
2742
2752
|
};
|
|
2743
2753
|
var Item = ({
|
|
2754
|
+
order,
|
|
2744
2755
|
item,
|
|
2745
2756
|
currencyCode,
|
|
2746
2757
|
reservation,
|
|
@@ -2827,15 +2838,18 @@ var Item = ({
|
|
|
2827
2838
|
/* @__PURE__ */ jsx17("span", { className: "tabular-nums", children: item.quantity }),
|
|
2828
2839
|
"x"
|
|
2829
2840
|
] }) }),
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2841
|
+
/* @__PURE__ */ jsxs17("div", { className: "overflow-visible", children: [
|
|
2842
|
+
isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx17(
|
|
2843
|
+
StatusBadge4,
|
|
2844
|
+
{
|
|
2845
|
+
color: reservation ? "green" : "orange",
|
|
2846
|
+
className: "text-nowrap",
|
|
2847
|
+
"data-testid": `order-summary-item-${item.id}-reservation-badge`,
|
|
2848
|
+
children: reservation ? t("orders.reservations.allocatedLabel") : t("orders.reservations.notAllocatedLabel")
|
|
2849
|
+
}
|
|
2850
|
+
),
|
|
2851
|
+
/* @__PURE__ */ jsx17(WidgetZone, { id: "orders.detail.item", data: { order, item } })
|
|
2852
|
+
] })
|
|
2839
2853
|
]
|
|
2840
2854
|
}
|
|
2841
2855
|
),
|
|
@@ -2893,6 +2907,7 @@ var ItemBreakdown = ({
|
|
|
2893
2907
|
return /* @__PURE__ */ jsx17(
|
|
2894
2908
|
Item,
|
|
2895
2909
|
{
|
|
2910
|
+
order,
|
|
2896
2911
|
item,
|
|
2897
2912
|
currencyCode: order.currency_code,
|
|
2898
2913
|
reservation,
|
|
@@ -3770,7 +3785,7 @@ var Root = ({ children }) => {
|
|
|
3770
3785
|
hasOutlet: true,
|
|
3771
3786
|
"data-testid": "order-detail-page",
|
|
3772
3787
|
children: [
|
|
3773
|
-
/* @__PURE__ */ jsx19(TwoColumnPage.Main, { "data-testid": "order-detail-main", children: /* @__PURE__ */ jsxs19(
|
|
3788
|
+
/* @__PURE__ */ jsx19(TwoColumnPage.Main, { "data-testid": "order-detail-main", children: /* @__PURE__ */ jsxs19(WidgetZone2, { id: "orders.detail.main", data: order, children: [
|
|
3774
3789
|
/* @__PURE__ */ jsx19(OrderActiveEditSection, { order }),
|
|
3775
3790
|
/* @__PURE__ */ jsx19(ActiveOrderClaimSection, { orderPreview }),
|
|
3776
3791
|
/* @__PURE__ */ jsx19(ActiveOrderExchangeSection, { orderPreview }),
|
|
@@ -3780,7 +3795,7 @@ var Root = ({ children }) => {
|
|
|
3780
3795
|
/* @__PURE__ */ jsx19(OrderPaymentSection, { order }),
|
|
3781
3796
|
/* @__PURE__ */ jsx19(OrderFulfillmentSection, { order })
|
|
3782
3797
|
] }) }),
|
|
3783
|
-
/* @__PURE__ */ jsx19(TwoColumnPage.Sidebar, { "data-testid": "order-detail-sidebar", children: /* @__PURE__ */ jsxs19(
|
|
3798
|
+
/* @__PURE__ */ jsx19(TwoColumnPage.Sidebar, { "data-testid": "order-detail-sidebar", children: /* @__PURE__ */ jsxs19(WidgetZone2, { id: "orders.detail.side", data: order, children: [
|
|
3784
3799
|
/* @__PURE__ */ jsx19(OrderCustomerSection, { order }),
|
|
3785
3800
|
/* @__PURE__ */ jsx19(OrderActivitySection, { order }),
|
|
3786
3801
|
/* @__PURE__ */ jsx19(OrderRemainingOrdersGroupSection, {})
|
|
@@ -66,6 +66,8 @@ declare module "@mercurjs/dashboard-sdk" {
|
|
|
66
66
|
"offers.detail.side.before": true
|
|
67
67
|
"offers.list.after": true
|
|
68
68
|
"offers.list.before": true
|
|
69
|
+
"orders.detail.item.after": true
|
|
70
|
+
"orders.detail.item.before": true
|
|
69
71
|
"orders.detail.main.after": true
|
|
70
72
|
"orders.detail.main.before": true
|
|
71
73
|
"orders.detail.side.after": true
|
package/dist/index.js
CHANGED
|
@@ -3842,7 +3842,7 @@ function getRouteMap({
|
|
|
3842
3842
|
{
|
|
3843
3843
|
path: ":id",
|
|
3844
3844
|
lazy: async () => {
|
|
3845
|
-
const { Breadcrumb, loader } = await import("./order-detail-
|
|
3845
|
+
const { Breadcrumb, loader } = await import("./order-detail-3ODC5NOT.js");
|
|
3846
3846
|
return {
|
|
3847
3847
|
Component: Outlet4,
|
|
3848
3848
|
loader,
|
|
@@ -3854,7 +3854,7 @@ function getRouteMap({
|
|
|
3854
3854
|
children: [
|
|
3855
3855
|
{
|
|
3856
3856
|
path: "",
|
|
3857
|
-
lazy: () => import("./order-detail-
|
|
3857
|
+
lazy: () => import("./order-detail-3ODC5NOT.js"),
|
|
3858
3858
|
children: [
|
|
3859
3859
|
{
|
|
3860
3860
|
path: "returns",
|
package/dist/pages/index.js
CHANGED
|
@@ -222,7 +222,7 @@ import "../chunk-6Q2JZ5YN.js";
|
|
|
222
222
|
import "../chunk-LXTXP7ZM.js";
|
|
223
223
|
import {
|
|
224
224
|
OrderDetailPage
|
|
225
|
-
} from "../chunk-
|
|
225
|
+
} from "../chunk-P2KYQNXQ.js";
|
|
226
226
|
import "../chunk-6ASLWQB3.js";
|
|
227
227
|
import "../chunk-LXSBG6LK.js";
|
|
228
228
|
import "../chunk-W6Y3PPU5.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/admin",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"lint": "oxlint --max-warnings 0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mercurjs/dashboard-shared": "2.3.
|
|
38
|
-
"@mercurjs/client": "2.3.
|
|
37
|
+
"@mercurjs/dashboard-shared": "2.3.5",
|
|
38
|
+
"@mercurjs/client": "2.3.5",
|
|
39
39
|
"@ariakit/react": "^0.4.15",
|
|
40
40
|
"@babel/runtime": "^8.0.0",
|
|
41
41
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"tsup": "^8.0.2",
|
|
89
89
|
"typescript": "5.9.3",
|
|
90
90
|
"@medusajs/types": "2.20.1",
|
|
91
|
-
"@mercurjs/core": "2.3.
|
|
92
|
-
"@mercurjs/dashboard-sdk": "2.3.
|
|
93
|
-
"@mercurjs/types": "2.3.
|
|
91
|
+
"@mercurjs/core": "2.3.5",
|
|
92
|
+
"@mercurjs/dashboard-sdk": "2.3.5",
|
|
93
|
+
"@mercurjs/types": "2.3.5",
|
|
94
94
|
"react-router-dom": "7.18.1"
|
|
95
95
|
}
|
|
96
96
|
}
|