@medusajs/dashboard 2.10.4-preview-20250924060154 → 2.10.4-preview-20250924120212

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.
Files changed (138) hide show
  1. package/dist/{add-campaign-promotions-BWIP24MA.mjs → add-campaign-promotions-APV4J7Z2.mjs} +4 -4
  2. package/dist/{api-key-management-detail-WGWZQCFC.mjs → api-key-management-detail-P2CXWYQG.mjs} +2 -2
  3. package/dist/{api-key-management-sales-channels-H5TVIHTV.mjs → api-key-management-sales-channels-ESGRJKDT.mjs} +1 -1
  4. package/dist/app.css +0 -3
  5. package/dist/app.js +3533 -3527
  6. package/dist/app.mjs +3 -3
  7. package/dist/{campaign-budget-edit-OXNTSPGE.mjs → campaign-budget-edit-UWGCET5Z.mjs} +1 -1
  8. package/dist/{campaign-configuration-Z5HA2DG3.mjs → campaign-configuration-WWCCFNYQ.mjs} +1 -1
  9. package/dist/{campaign-create-GRKYQY5D.mjs → campaign-create-CQ3XBHSY.mjs} +2 -2
  10. package/dist/{campaign-detail-EJD7LQCW.mjs → campaign-detail-CBO7PBOR.mjs} +4 -4
  11. package/dist/{campaign-edit-3TDW52BO.mjs → campaign-edit-R43GXNET.mjs} +1 -1
  12. package/dist/{campaign-list-IDPRC2MD.mjs → campaign-list-CDO5PRTL.mjs} +1 -1
  13. package/dist/{categories-metadata-JFNWZA5D.mjs → categories-metadata-HNABPXTE.mjs} +1 -1
  14. package/dist/{category-detail-CL3XCV7E.mjs → category-detail-JUKMFR4W.mjs} +1 -1
  15. package/dist/{category-products-UZEG63WY.mjs → category-products-CWLUKUVK.mjs} +1 -1
  16. package/dist/{chunk-U2FXUMKA.mjs → chunk-3S523T5F.mjs} +1 -1
  17. package/dist/{chunk-FUQ27NT5.mjs → chunk-5FAWKUSU.mjs} +1 -1
  18. package/dist/{chunk-OQPVQGSH.mjs → chunk-7GBCLBMX.mjs} +24 -11
  19. package/dist/{chunk-LJDVFJK7.mjs → chunk-AXXGAOQL.mjs} +1 -1
  20. package/dist/{chunk-CAZKNJTG.mjs → chunk-FGF5B6J4.mjs} +112 -112
  21. package/dist/{chunk-4CGHNQP2.mjs → chunk-G3VGLFVH.mjs} +47 -47
  22. package/dist/{chunk-YPSSUJUZ.mjs → chunk-KTBA6OOV.mjs} +7 -3
  23. package/dist/{chunk-2252SSK6.mjs → chunk-NUA3JO5E.mjs} +1 -1
  24. package/dist/{chunk-ZODJNBAV.mjs → chunk-R2G2B47Y.mjs} +1 -0
  25. package/dist/{chunk-V53HAFWH.mjs → chunk-TEMN4ESF.mjs} +1 -1
  26. package/dist/{chunk-6RWF7BPW.mjs → chunk-V6JXTITD.mjs} +1 -1
  27. package/dist/{chunk-WP5CXGGO.mjs → chunk-ZWWM2OU2.mjs} +1 -1
  28. package/dist/{collection-add-products-QTFBLLND.mjs → collection-add-products-E22XLIP7.mjs} +1 -1
  29. package/dist/{collection-detail-ZEAUSZBJ.mjs → collection-detail-LOJ6WZLT.mjs} +1 -1
  30. package/dist/{collection-list-V27JHDAD.mjs → collection-list-KKEZLFLJ.mjs} +1 -1
  31. package/dist/{collection-metadata-JAEMZMU6.mjs → collection-metadata-MEA56JQC.mjs} +1 -1
  32. package/dist/{customer-detail-YBOM6KGC.mjs → customer-detail-Z5TU254N.mjs} +1 -1
  33. package/dist/{customer-group-detail-72VFORGF.mjs → customer-group-detail-VCRUQIYD.mjs} +1 -1
  34. package/dist/{customer-group-list-UTC5ZCJZ.mjs → customer-group-list-MCQ4AUJF.mjs} +2 -2
  35. package/dist/{customers-add-customer-group-ZUCFXW2U.mjs → customers-add-customer-group-X3VHASZ6.mjs} +1 -1
  36. package/dist/{edit-rules-RY7JMYLR.mjs → edit-rules-SVG7IOSY.mjs} +2 -2
  37. package/dist/{inventory-create-F5PSTEN2.mjs → inventory-create-DR5LNYQB.mjs} +1 -1
  38. package/dist/{inventory-detail-BO5E7KXO.mjs → inventory-detail-D4MBCFS2.mjs} +2 -2
  39. package/dist/{inventory-metadata-QGPVSAUI.mjs → inventory-metadata-T22JZF4O.mjs} +1 -1
  40. package/dist/{inventory-stock-VQNXCIOA.mjs → inventory-stock-CPNDJYBD.mjs} +1 -1
  41. package/dist/{location-detail-M4CYDTSY.mjs → location-detail-SG4X4HBT.mjs} +1 -1
  42. package/dist/{location-edit-RNGPJ26L.mjs → location-edit-X6JBEWIF.mjs} +1 -1
  43. package/dist/{location-fulfillment-providers-XVEQZCUD.mjs → location-fulfillment-providers-YNKCL3FV.mjs} +1 -1
  44. package/dist/location-list-VNEYHAKV.mjs +323 -0
  45. package/dist/{location-sales-channels-NSXV65ZM.mjs → location-sales-channels-HVZHZMBY.mjs} +1 -1
  46. package/dist/{location-service-zone-shipping-option-create-I3HAEEFA.mjs → location-service-zone-shipping-option-create-PF7YJSC3.mjs} +1 -1
  47. package/dist/{login-QOENXTB7.mjs → login-23RIW4IY.mjs} +1 -1
  48. package/dist/{order-create-claim-MOBLO4YM.mjs → order-create-claim-LBA6UTTF.mjs} +1 -1
  49. package/dist/{order-create-edit-C75GUZJE.mjs → order-create-edit-7GLQP5CD.mjs} +1 -1
  50. package/dist/{order-create-exchange-RCUALEXO.mjs → order-create-exchange-IXPHBHKP.mjs} +1 -1
  51. package/dist/{order-create-fulfillment-EZTEZ4CF.mjs → order-create-fulfillment-5UJQFERR.mjs} +1 -1
  52. package/dist/{order-create-refund-4FAIESAN.mjs → order-create-refund-QZRNHK2D.mjs} +1 -1
  53. package/dist/{order-create-shipment-PTUJKVWK.mjs → order-create-shipment-TQJHHC7T.mjs} +1 -1
  54. package/dist/{order-detail-6XQLJ5TU.mjs → order-detail-NERZLT7X.mjs} +31 -23
  55. package/dist/{order-edit-billing-address-46CFUZGL.mjs → order-edit-billing-address-BMUX3GJL.mjs} +1 -1
  56. package/dist/{order-edit-email-FOK5GQW2.mjs → order-edit-email-CS4AIJZS.mjs} +1 -1
  57. package/dist/{order-edit-shipping-address-WFN2SVKM.mjs → order-edit-shipping-address-GXSNNDBC.mjs} +1 -1
  58. package/dist/{order-list-OTPVQKU6.mjs → order-list-YWPAJ7FR.mjs} +2 -2
  59. package/dist/{order-metadata-COJNFRPZ.mjs → order-metadata-KWZX64YP.mjs} +1 -1
  60. package/dist/{order-receive-return-P4OPVOPM.mjs → order-receive-return-EXZAUMCI.mjs} +1 -1
  61. package/dist/{order-request-transfer-HRPCEL5L.mjs → order-request-transfer-RLU2TK44.mjs} +1 -1
  62. package/dist/{price-list-create-FJ2FM6GL.mjs → price-list-create-RHSKBROB.mjs} +1 -1
  63. package/dist/{price-list-detail-VNZ3Q426.mjs → price-list-detail-7E2SZNKI.mjs} +1 -1
  64. package/dist/{price-list-prices-add-FMZKGOHD.mjs → price-list-prices-add-RM5FDABU.mjs} +1 -1
  65. package/dist/{product-attributes-5PLACMXK.mjs → product-attributes-K5EMRHFS.mjs} +4 -4
  66. package/dist/{product-create-6FMLIS5X.mjs → product-create-5KQFXFJF.mjs} +5 -5
  67. package/dist/{product-create-variant-KGBSFIKQ.mjs → product-create-variant-37CVX4QI.mjs} +1 -1
  68. package/dist/{product-detail-2BJJMCCO.mjs → product-detail-UM6PIKWQ.mjs} +5 -5
  69. package/dist/{product-edit-N5P7RVNS.mjs → product-edit-QSCZEH74.mjs} +4 -4
  70. package/dist/{product-export-XA5POQKT.mjs → product-export-JNLDMDUS.mjs} +1 -1
  71. package/dist/{product-import-DYTT4YDA.mjs → product-import-CA75XMEH.mjs} +1 -1
  72. package/dist/{product-list-EUQX3NBE.mjs → product-list-XA5SJLXF.mjs} +3 -3
  73. package/dist/{product-media-XJGAON6B.mjs → product-media-36YW62IO.mjs} +2 -2
  74. package/dist/{product-metadata-44VYAXZD.mjs → product-metadata-JKWIAMVB.mjs} +1 -1
  75. package/dist/{product-organization-FB6BVKKL.mjs → product-organization-YL4ZUCC4.mjs} +4 -4
  76. package/dist/{product-sales-channels-QBQDLU7Z.mjs → product-sales-channels-UX7AOJIF.mjs} +1 -1
  77. package/dist/{product-shipping-profile-UZQSV54B.mjs → product-shipping-profile-PEIUF5AK.mjs} +4 -4
  78. package/dist/{product-stock-PX5NAHH6.mjs → product-stock-4XECV73O.mjs} +1 -1
  79. package/dist/{product-tag-create-R4YSSXD6.mjs → product-tag-create-U5DAEOBS.mjs} +1 -1
  80. package/dist/{product-tag-detail-XJEGQD7U.mjs → product-tag-detail-YB44E6JT.mjs} +1 -1
  81. package/dist/{product-tag-edit-7JXF42HY.mjs → product-tag-edit-J3OPHCDJ.mjs} +1 -1
  82. package/dist/{product-tag-list-GTUMQQ6V.mjs → product-tag-list-6TGDOAMD.mjs} +1 -1
  83. package/dist/{product-tag-metadata-5QV3HMXJ.mjs → product-tag-metadata-VAHEGSFJ.mjs} +1 -1
  84. package/dist/{product-type-detail-CN74BB3Y.mjs → product-type-detail-EN3WAIVO.mjs} +1 -1
  85. package/dist/{product-type-metadata-JPFREADV.mjs → product-type-metadata-R3YLZGY5.mjs} +1 -1
  86. package/dist/{product-variant-detail-BSLEUW5J.mjs → product-variant-detail-TYV4BYNG.mjs} +1 -1
  87. package/dist/{product-variant-edit-VOW5633S.mjs → product-variant-edit-YPQDVG5C.mjs} +1 -1
  88. package/dist/{product-variant-metadata-KDSV47PE.mjs → product-variant-metadata-DII5YHIK.mjs} +1 -1
  89. package/dist/{promotion-add-campaign-JXBRCUXL.mjs → promotion-add-campaign-YREHV6TQ.mjs} +7 -20
  90. package/dist/{promotion-create-YPX2R3ZB.mjs → promotion-create-TLW6T5IO.mjs} +4 -4
  91. package/dist/{promotion-detail-VB5GZDCC.mjs → promotion-detail-BYA66IL7.mjs} +113 -64
  92. package/dist/{promotion-edit-details-I5DYHQUM.mjs → promotion-edit-details-A2UUSAZA.mjs} +1 -1
  93. package/dist/{promotion-list-NAUTWXNU.mjs → promotion-list-TOYJAQ4D.mjs} +4 -4
  94. package/dist/{refund-reason-create-CYHPXX2O.mjs → refund-reason-create-D5DJVOXP.mjs} +1 -1
  95. package/dist/{refund-reason-list-VBHGRLJJ.mjs → refund-reason-list-V7UO2NAY.mjs} +10 -5
  96. package/dist/{region-metadata-NXD563F4.mjs → region-metadata-23FQEWQ7.mjs} +1 -1
  97. package/dist/{reservation-detail-64MMXK7D.mjs → reservation-detail-USSX2THW.mjs} +1 -1
  98. package/dist/{reservation-metadata-4GZCEGM7.mjs → reservation-metadata-PKWRLWNT.mjs} +1 -1
  99. package/dist/{reset-password-ZCKXQZNQ.mjs → reset-password-EKZEJXQU.mjs} +1 -1
  100. package/dist/{sales-channel-add-products-EAWW7ADY.mjs → sales-channel-add-products-DKDV65UU.mjs} +1 -1
  101. package/dist/{sales-channel-detail-3F3HFTD2.mjs → sales-channel-detail-JKJLEM4C.mjs} +1 -1
  102. package/dist/{sales-channel-list-R4HT6A7P.mjs → sales-channel-list-FOAVTG7H.mjs} +2 -2
  103. package/dist/{sales-channel-metadata-LAHTTRLQ.mjs → sales-channel-metadata-3RXYX7U2.mjs} +1 -1
  104. package/dist/{shipping-option-type-create-IPKK5MRS.mjs → shipping-option-type-create-ZLYFQFYI.mjs} +1 -1
  105. package/dist/{shipping-option-type-detail-NEQ4RA5F.mjs → shipping-option-type-detail-OMVJZSOI.mjs} +1 -1
  106. package/dist/{shipping-option-type-edit-CC64TWSB.mjs → shipping-option-type-edit-5XHFIDEZ.mjs} +1 -1
  107. package/dist/{shipping-option-type-list-3GTGTBK7.mjs → shipping-option-type-list-SGTTVHWK.mjs} +1 -1
  108. package/dist/{shipping-profile-metadata-EPVLPEEM.mjs → shipping-profile-metadata-3TZDQ27Z.mjs} +1 -1
  109. package/dist/{store-detail-PUOKMK4K.mjs → store-detail-72GMDFY7.mjs} +1 -1
  110. package/dist/{store-metadata-JYIVRRLW.mjs → store-metadata-TXSRTL6B.mjs} +1 -1
  111. package/dist/{tax-region-create-2GDG36NQ.mjs → tax-region-create-U6XXHBMJ.mjs} +2 -2
  112. package/dist/{tax-region-detail-MQKBEBOZ.mjs → tax-region-detail-V4E63XUI.mjs} +1 -1
  113. package/dist/{tax-region-edit-2H5ACSFG.mjs → tax-region-edit-2DQPKIJG.mjs} +1 -1
  114. package/dist/{tax-region-province-detail-HNK2ZJWL.mjs → tax-region-province-detail-P6LPVSQJ.mjs} +1 -1
  115. package/dist/{tax-region-tax-override-create-XZJ3EIFJ.mjs → tax-region-tax-override-create-BPZKBPN6.mjs} +1 -1
  116. package/dist/{tax-region-tax-override-edit-QHQHFI2Y.mjs → tax-region-tax-override-edit-O7LUBRQN.mjs} +1 -1
  117. package/dist/{user-list-TPBPZ7KJ.mjs → user-list-G4H2RSDX.mjs} +1 -1
  118. package/dist/{user-metadata-F6KRFYDW.mjs → user-metadata-TM3FFLIR.mjs} +1 -1
  119. package/dist/{workflow-execution-detail-JRJZATNU.mjs → workflow-execution-detail-3IBZZVRE.mjs} +1 -1
  120. package/package.json +9 -9
  121. package/src/components/data-table/data-table.tsx +64 -46
  122. package/src/hooks/api/campaigns.tsx +1 -0
  123. package/src/i18n/translations/$schema.json +19 -2
  124. package/src/i18n/translations/en.json +7 -3
  125. package/src/routes/locations/location-edit/components/edit-location-form/edit-location-form.tsx +1 -1
  126. package/src/routes/locations/location-list/index.ts +0 -1
  127. package/src/routes/locations/location-list/location-list.tsx +52 -14
  128. package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
  129. package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
  130. package/src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx +13 -5
  131. package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/add-campaign-promotion-form.tsx +45 -52
  132. package/src/routes/promotions/promotion-add-campaign/promotion-add-campaign.tsx +4 -21
  133. package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +12 -4
  134. package/dist/chunk-BKJC5BGQ.mjs +0 -53
  135. package/dist/location-list-NKIOBHG4.mjs +0 -298
  136. package/src/routes/locations/location-list/components/location-list-header/index.ts +0 -1
  137. package/src/routes/locations/location-list/components/location-list-header/location-list-header.tsx +0 -21
  138. package/src/routes/locations/location-list/loader.ts +0 -36
@@ -0,0 +1,323 @@
1
+ import {
2
+ ListSummary
3
+ } from "./chunk-I3VB6NM2.mjs";
4
+ import "./chunk-PYIO3TDQ.mjs";
5
+ import {
6
+ PlaceholderCell
7
+ } from "./chunk-P3UUX2T6.mjs";
8
+ import {
9
+ SidebarLink
10
+ } from "./chunk-HWKLNKOY.mjs";
11
+ import "./chunk-EQTBJSBZ.mjs";
12
+ import {
13
+ getFormattedAddress
14
+ } from "./chunk-B6ZOPCPA.mjs";
15
+ import {
16
+ TwoColumnPage
17
+ } from "./chunk-GIZFNLKK.mjs";
18
+ import {
19
+ DataTable
20
+ } from "./chunk-7GBCLBMX.mjs";
21
+ import {
22
+ useQueryParams
23
+ } from "./chunk-C76H5USB.mjs";
24
+ import {
25
+ useExtension
26
+ } from "./chunk-C5P5PL3E.mjs";
27
+ import "./chunk-DG7J63J2.mjs";
28
+ import "./chunk-RM6NY572.mjs";
29
+ import "./chunk-OZPB6JBL.mjs";
30
+ import "./chunk-OC7BQLYI.mjs";
31
+ import "./chunk-S4DMV3ZT.mjs";
32
+ import {
33
+ stockLocationsQueryKeys,
34
+ useStockLocations
35
+ } from "./chunk-32IQRUVY.mjs";
36
+ import "./chunk-KX4P5L3R.mjs";
37
+ import {
38
+ queryClient
39
+ } from "./chunk-FXYH54JP.mjs";
40
+ import "./chunk-774WSTCC.mjs";
41
+ import {
42
+ sdk
43
+ } from "./chunk-DEQUVHHE.mjs";
44
+ import "./chunk-RPUOO7AV.mjs";
45
+
46
+ // src/routes/locations/location-list/location-list.tsx
47
+ import { ShoppingBag, TruckFast } from "@medusajs/icons";
48
+ import { Container, Heading } from "@medusajs/ui";
49
+ import { useTranslation as useTranslation2 } from "react-i18next";
50
+
51
+ // src/routes/locations/location-list/constants.ts
52
+ var LOCATION_LIST_FIELDS = "name,*sales_channels,*address,*fulfillment_sets,*fulfillment_sets.service_zones,*fulfillment_sets.service_zones.shipping_options,*fulfillment_sets.service_zones.shipping_options.shipping_profile";
53
+
54
+ // src/routes/locations/location-list/use-location-list-table-columns.tsx
55
+ import { PencilSquare, Trash } from "@medusajs/icons";
56
+ import {
57
+ createDataTableColumnHelper,
58
+ StatusBadge,
59
+ toast,
60
+ usePrompt
61
+ } from "@medusajs/ui";
62
+ import { useTranslation } from "react-i18next";
63
+ import { useMemo } from "react";
64
+ import { useNavigate } from "react-router-dom";
65
+ import { jsx } from "react/jsx-runtime";
66
+ var columnHelper = createDataTableColumnHelper();
67
+ var useLocationListTableColumns = () => {
68
+ const { t } = useTranslation();
69
+ const navigate = useNavigate();
70
+ const prompt = usePrompt();
71
+ const handleDelete = async (location) => {
72
+ const result = await prompt({
73
+ title: t("general.areYouSure"),
74
+ description: t("stockLocations.delete.confirmation", {
75
+ name: location.name
76
+ }),
77
+ confirmText: t("actions.remove"),
78
+ cancelText: t("actions.cancel")
79
+ });
80
+ if (!result) {
81
+ return;
82
+ }
83
+ try {
84
+ await sdk.admin.stockLocation.delete(location.id);
85
+ queryClient.invalidateQueries({
86
+ queryKey: stockLocationsQueryKeys.lists()
87
+ });
88
+ queryClient.invalidateQueries({
89
+ queryKey: stockLocationsQueryKeys.detail(location.id)
90
+ });
91
+ toast.success(
92
+ t("stockLocations.delete.successToast", {
93
+ name: location.name
94
+ })
95
+ );
96
+ } catch (e) {
97
+ toast.error(e.message);
98
+ }
99
+ };
100
+ return useMemo(
101
+ () => [
102
+ columnHelper.accessor("name", {
103
+ header: t("fields.name"),
104
+ cell: ({ getValue }) => {
105
+ const name = getValue();
106
+ if (!name) {
107
+ return /* @__PURE__ */ jsx(PlaceholderCell, {});
108
+ }
109
+ return /* @__PURE__ */ jsx("span", { className: "text-ui-fg-subtle text-small truncate", children: name });
110
+ }
111
+ }),
112
+ columnHelper.accessor("address", {
113
+ header: t("fields.address"),
114
+ cell: ({ getValue, row }) => {
115
+ const address = getValue();
116
+ const location = row.original;
117
+ if (!address) {
118
+ return /* @__PURE__ */ jsx(PlaceholderCell, {});
119
+ }
120
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-subtle text-small truncate", children: getFormattedAddress({
121
+ address: location.address
122
+ }).join(", ") }) });
123
+ }
124
+ }),
125
+ columnHelper.accessor("fulfillment_sets", {
126
+ id: "shipping_fulfillment",
127
+ header: t("stockLocations.fulfillmentSets.shipping.header"),
128
+ cell: ({ getValue }) => {
129
+ const fulfillmentSets = getValue();
130
+ const shippingSet = fulfillmentSets?.find(
131
+ (f) => f.type === "shipping" /* Shipping */
132
+ );
133
+ const fulfillmentSetExists = !!shippingSet;
134
+ return /* @__PURE__ */ jsx(StatusBadge, { color: fulfillmentSetExists ? "green" : "grey", children: t(
135
+ fulfillmentSetExists ? "statuses.enabled" : "statuses.disabled"
136
+ ) });
137
+ }
138
+ }),
139
+ columnHelper.accessor("fulfillment_sets", {
140
+ id: "pickup_fulfillment",
141
+ header: t("stockLocations.fulfillmentSets.pickup.header"),
142
+ cell: ({ getValue }) => {
143
+ const fulfillmentSets = getValue();
144
+ const pickupSet = fulfillmentSets?.find(
145
+ (f) => f.type === "pickup" /* Pickup */
146
+ );
147
+ const fulfillmentSetExists = !!pickupSet;
148
+ return /* @__PURE__ */ jsx(StatusBadge, { color: fulfillmentSetExists ? "green" : "grey", children: t(
149
+ fulfillmentSetExists ? "statuses.enabled" : "statuses.disabled"
150
+ ) });
151
+ }
152
+ }),
153
+ columnHelper.accessor("sales_channels", {
154
+ header: t("stockLocations.salesChannels.label"),
155
+ cell: ({ getValue }) => {
156
+ const salesChannels = getValue();
157
+ if (!salesChannels?.length) {
158
+ return /* @__PURE__ */ jsx(PlaceholderCell, {});
159
+ }
160
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx(
161
+ ListSummary,
162
+ {
163
+ inline: true,
164
+ n: 1,
165
+ list: salesChannels.map((s) => s.name)
166
+ }
167
+ ) });
168
+ }
169
+ }),
170
+ columnHelper.action({
171
+ actions: (ctx) => {
172
+ const location = ctx.row.original;
173
+ return [
174
+ [
175
+ {
176
+ icon: /* @__PURE__ */ jsx(PencilSquare, {}),
177
+ label: t("actions.edit"),
178
+ onClick: () => {
179
+ navigate(`/settings/locations/${location.id}/edit`);
180
+ }
181
+ }
182
+ ],
183
+ [
184
+ {
185
+ icon: /* @__PURE__ */ jsx(Trash, {}),
186
+ label: t("actions.delete"),
187
+ onClick: () => handleDelete(location)
188
+ }
189
+ ]
190
+ ];
191
+ }
192
+ })
193
+ ],
194
+ []
195
+ );
196
+ };
197
+
198
+ // src/routes/locations/location-list/use-location-list-table-query.tsx
199
+ var useLocationListTableQuery = ({
200
+ pageSize = 20,
201
+ prefix
202
+ }) => {
203
+ const queryObject = useQueryParams(["order", "offset", "q"], prefix);
204
+ const { offset, ...rest } = queryObject;
205
+ const searchParams = {
206
+ limit: pageSize,
207
+ offset: offset ? Number(offset) : 0,
208
+ ...rest
209
+ };
210
+ return searchParams;
211
+ };
212
+
213
+ // src/routes/locations/location-list/location-list.tsx
214
+ import { keepPreviousData } from "@tanstack/react-query";
215
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
216
+ var PAGE_SIZE = 20;
217
+ var PREFIX = "loc";
218
+ function LocationList() {
219
+ const { t } = useTranslation2();
220
+ const searchParams = useLocationListTableQuery({
221
+ pageSize: PAGE_SIZE,
222
+ prefix: PREFIX
223
+ });
224
+ const {
225
+ stock_locations: stockLocations = [],
226
+ count,
227
+ isError,
228
+ error,
229
+ isLoading
230
+ } = useStockLocations(
231
+ {
232
+ fields: LOCATION_LIST_FIELDS,
233
+ ...searchParams
234
+ },
235
+ {
236
+ placeholderData: keepPreviousData
237
+ }
238
+ );
239
+ const columns = useLocationListTableColumns();
240
+ const { getWidgets } = useExtension();
241
+ if (isError) {
242
+ throw error;
243
+ }
244
+ return /* @__PURE__ */ jsxs(
245
+ TwoColumnPage,
246
+ {
247
+ widgets: {
248
+ after: getWidgets("location.list.after"),
249
+ before: getWidgets("location.list.before"),
250
+ sideAfter: getWidgets("location.list.side.after"),
251
+ sideBefore: getWidgets("location.list.side.before")
252
+ },
253
+ showJSON: true,
254
+ children: [
255
+ /* @__PURE__ */ jsx2(TwoColumnPage.Main, { children: /* @__PURE__ */ jsx2(Container, { className: "flex flex-col divide-y p-0", children: /* @__PURE__ */ jsx2(
256
+ DataTable,
257
+ {
258
+ data: stockLocations,
259
+ columns,
260
+ rowCount: count,
261
+ pageSize: PAGE_SIZE,
262
+ getRowId: (row) => row.id,
263
+ heading: t("stockLocations.domain"),
264
+ subHeading: t("stockLocations.list.description"),
265
+ emptyState: {
266
+ empty: {
267
+ heading: t("stockLocations.list.noRecordsMessage"),
268
+ description: t("stockLocations.list.noRecordsMessageEmpty")
269
+ },
270
+ filtered: {
271
+ heading: t("stockLocations.list.noRecordsMessage"),
272
+ description: t("stockLocations.list.noRecordsMessageFiltered")
273
+ }
274
+ },
275
+ actions: [
276
+ {
277
+ label: t("actions.create"),
278
+ to: "create"
279
+ }
280
+ ],
281
+ isLoading,
282
+ rowHref: (row) => `/settings/locations/${row.id}`,
283
+ enableSearch: true,
284
+ prefix: PREFIX,
285
+ layout: "fill"
286
+ }
287
+ ) }) }),
288
+ /* @__PURE__ */ jsx2(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx2(LinksSection, {}) })
289
+ ]
290
+ }
291
+ );
292
+ }
293
+ var LinksSection = () => {
294
+ const { t } = useTranslation2();
295
+ return /* @__PURE__ */ jsxs(Container, { className: "p-0", children: [
296
+ /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx2(Heading, { level: "h2", children: t("stockLocations.sidebar.header") }) }),
297
+ /* @__PURE__ */ jsx2(
298
+ SidebarLink,
299
+ {
300
+ to: "/settings/locations/shipping-profiles",
301
+ labelKey: t("stockLocations.sidebar.shippingProfiles.label"),
302
+ descriptionKey: t(
303
+ "stockLocations.sidebar.shippingProfiles.description"
304
+ ),
305
+ icon: /* @__PURE__ */ jsx2(ShoppingBag, {})
306
+ }
307
+ ),
308
+ /* @__PURE__ */ jsx2(
309
+ SidebarLink,
310
+ {
311
+ to: "/settings/locations/shipping-option-types",
312
+ labelKey: t("stockLocations.sidebar.shippingOptionTypes.label"),
313
+ descriptionKey: t(
314
+ "stockLocations.sidebar.shippingOptionTypes.description"
315
+ ),
316
+ icon: /* @__PURE__ */ jsx2(TruckFast, {})
317
+ }
318
+ )
319
+ ] });
320
+ };
321
+ export {
322
+ LocationList as Component
323
+ };
@@ -11,7 +11,7 @@ import "./chunk-2D44OO7A.mjs";
11
11
  import "./chunk-Q33G337Z.mjs";
12
12
  import {
13
13
  DataTable
14
- } from "./chunk-OQPVQGSH.mjs";
14
+ } from "./chunk-7GBCLBMX.mjs";
15
15
  import "./chunk-C76H5USB.mjs";
16
16
  import "./chunk-PFKKVLZX.mjs";
17
17
  import "./chunk-IUCDCPJU.mjs";
@@ -64,7 +64,7 @@ import "./chunk-ZCZL3STK.mjs";
64
64
  import "./chunk-OHSRRFGN.mjs";
65
65
  import "./chunk-F6PXCY3N.mjs";
66
66
  import "./chunk-NCR5UWRI.mjs";
67
- import "./chunk-ZODJNBAV.mjs";
67
+ import "./chunk-R2G2B47Y.mjs";
68
68
  import {
69
69
  useCreateShippingOptions
70
70
  } from "./chunk-GRT22PE5.mjs";
@@ -30,7 +30,7 @@ import "./chunk-ZCZL3STK.mjs";
30
30
  import "./chunk-OHSRRFGN.mjs";
31
31
  import "./chunk-F6PXCY3N.mjs";
32
32
  import "./chunk-NCR5UWRI.mjs";
33
- import "./chunk-ZODJNBAV.mjs";
33
+ import "./chunk-R2G2B47Y.mjs";
34
34
  import "./chunk-GRT22PE5.mjs";
35
35
  import "./chunk-32IQRUVY.mjs";
36
36
  import "./chunk-KSRI5LOF.mjs";
@@ -111,7 +111,7 @@ import "./chunk-ZCZL3STK.mjs";
111
111
  import "./chunk-OHSRRFGN.mjs";
112
112
  import "./chunk-F6PXCY3N.mjs";
113
113
  import "./chunk-NCR5UWRI.mjs";
114
- import "./chunk-ZODJNBAV.mjs";
114
+ import "./chunk-R2G2B47Y.mjs";
115
115
  import {
116
116
  useShippingOptions
117
117
  } from "./chunk-GRT22PE5.mjs";
@@ -78,7 +78,7 @@ import "./chunk-ZCZL3STK.mjs";
78
78
  import "./chunk-OHSRRFGN.mjs";
79
79
  import "./chunk-F6PXCY3N.mjs";
80
80
  import "./chunk-NCR5UWRI.mjs";
81
- import "./chunk-ZODJNBAV.mjs";
81
+ import "./chunk-R2G2B47Y.mjs";
82
82
  import "./chunk-GRT22PE5.mjs";
83
83
  import "./chunk-32IQRUVY.mjs";
84
84
  import {
@@ -111,7 +111,7 @@ import "./chunk-ZCZL3STK.mjs";
111
111
  import "./chunk-OHSRRFGN.mjs";
112
112
  import "./chunk-F6PXCY3N.mjs";
113
113
  import "./chunk-NCR5UWRI.mjs";
114
- import "./chunk-ZODJNBAV.mjs";
114
+ import "./chunk-R2G2B47Y.mjs";
115
115
  import {
116
116
  useShippingOptions
117
117
  } from "./chunk-GRT22PE5.mjs";
@@ -44,7 +44,7 @@ import "./chunk-ZCZL3STK.mjs";
44
44
  import "./chunk-OHSRRFGN.mjs";
45
45
  import "./chunk-F6PXCY3N.mjs";
46
46
  import "./chunk-NCR5UWRI.mjs";
47
- import "./chunk-ZODJNBAV.mjs";
47
+ import "./chunk-R2G2B47Y.mjs";
48
48
  import {
49
49
  useShippingOptions
50
50
  } from "./chunk-GRT22PE5.mjs";
@@ -54,7 +54,7 @@ import {
54
54
  import "./chunk-OHSRRFGN.mjs";
55
55
  import "./chunk-F6PXCY3N.mjs";
56
56
  import "./chunk-NCR5UWRI.mjs";
57
- import "./chunk-ZODJNBAV.mjs";
57
+ import "./chunk-R2G2B47Y.mjs";
58
58
  import "./chunk-GRT22PE5.mjs";
59
59
  import "./chunk-32IQRUVY.mjs";
60
60
  import {
@@ -26,7 +26,7 @@ import "./chunk-ZCZL3STK.mjs";
26
26
  import "./chunk-OHSRRFGN.mjs";
27
27
  import "./chunk-F6PXCY3N.mjs";
28
28
  import "./chunk-NCR5UWRI.mjs";
29
- import "./chunk-ZODJNBAV.mjs";
29
+ import "./chunk-R2G2B47Y.mjs";
30
30
  import "./chunk-GRT22PE5.mjs";
31
31
  import "./chunk-32IQRUVY.mjs";
32
32
  import {
@@ -105,7 +105,7 @@ import {
105
105
  useCustomer
106
106
  } from "./chunk-F6PXCY3N.mjs";
107
107
  import "./chunk-NCR5UWRI.mjs";
108
- import "./chunk-ZODJNBAV.mjs";
108
+ import "./chunk-R2G2B47Y.mjs";
109
109
  import "./chunk-GRT22PE5.mjs";
110
110
  import {
111
111
  useStockLocation
@@ -495,7 +495,7 @@ import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
495
495
  import { useTranslation as useTranslation8 } from "react-i18next";
496
496
 
497
497
  // src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx
498
- import { Button as Button5, Text as Text6, Tooltip, clx, usePrompt } from "@medusajs/ui";
498
+ import { Button as Button5, Text as Text6, Tooltip, clx, toast as toast5, usePrompt } from "@medusajs/ui";
499
499
  import { Collapsible as RadixCollapsible } from "radix-ui";
500
500
  import { useMemo as useMemo2, useState as useState3 } from "react";
501
501
  import { useTranslation as useTranslation7 } from "react-i18next";
@@ -1133,7 +1133,9 @@ var ReturnBody = ({
1133
1133
  if (!res) {
1134
1134
  return;
1135
1135
  }
1136
- await cancelReturnRequest();
1136
+ await cancelReturnRequest().catch((error) => {
1137
+ toast5.error(error.message);
1138
+ });
1137
1139
  };
1138
1140
  const numberOfItems = orderReturn.items.reduce((acc, item) => {
1139
1141
  return acc + (isReceived ? item.received_quantity : item.quantity);
@@ -1175,7 +1177,9 @@ var ClaimBody = ({
1175
1177
  if (!res) {
1176
1178
  return;
1177
1179
  }
1178
- await cancelClaim();
1180
+ await cancelClaim().catch((error) => {
1181
+ toast5.error(error.message);
1182
+ });
1179
1183
  };
1180
1184
  const outboundItems = (claim.additional_items || []).reduce(
1181
1185
  (acc, item) => acc + item.quantity,
@@ -1225,7 +1229,9 @@ var ExchangeBody = ({
1225
1229
  if (!res) {
1226
1230
  return;
1227
1231
  }
1228
- await cancelExchange();
1232
+ await cancelExchange().catch((error) => {
1233
+ toast5.error(error.message);
1234
+ });
1229
1235
  };
1230
1236
  const outboundItems = (exchange.additional_items || []).reduce(
1231
1237
  (acc, item) => acc + item.quantity,
@@ -1294,7 +1300,9 @@ var TransferOrderRequestBody = ({
1294
1300
  if (!res) {
1295
1301
  return;
1296
1302
  }
1297
- await cancelTransfer();
1303
+ await cancelTransfer().catch((error) => {
1304
+ toast5.error(error.message);
1305
+ });
1298
1306
  };
1299
1307
  return /* @__PURE__ */ jsxs8("div", { children: [
1300
1308
  /* @__PURE__ */ jsxs8(Text6, { size: "small", className: "text-ui-fg-subtle", children: [
@@ -1581,7 +1589,7 @@ import {
1581
1589
  StatusBadge,
1582
1590
  Text as Text8,
1583
1591
  Tooltip as Tooltip2,
1584
- toast as toast5,
1592
+ toast as toast6,
1585
1593
  usePrompt as usePrompt2
1586
1594
  } from "@medusajs/ui";
1587
1595
  import { format } from "date-fns";
@@ -1759,21 +1767,21 @@ var Fulfillment = ({
1759
1767
  if (res) {
1760
1768
  await markAsDelivered(void 0, {
1761
1769
  onSuccess: () => {
1762
- toast5.success(
1770
+ toast6.success(
1763
1771
  t(
1764
1772
  isPickUpFulfillment ? "orders.fulfillment.toast.fulfillmentPickedUp" : "orders.fulfillment.toast.fulfillmentDelivered"
1765
1773
  )
1766
1774
  );
1767
1775
  },
1768
1776
  onError: (e) => {
1769
- toast5.error(e.message);
1777
+ toast6.error(e.message);
1770
1778
  }
1771
1779
  });
1772
1780
  }
1773
1781
  };
1774
1782
  const handleCancel = async () => {
1775
1783
  if (fulfillment.shipped_at) {
1776
- toast5.warning(t("orders.fulfillment.toast.fulfillmentShipped"));
1784
+ toast6.warning(t("orders.fulfillment.toast.fulfillmentShipped"));
1777
1785
  return;
1778
1786
  }
1779
1787
  const res = await prompt({
@@ -1785,10 +1793,10 @@ var Fulfillment = ({
1785
1793
  if (res) {
1786
1794
  await mutateAsync(void 0, {
1787
1795
  onSuccess: () => {
1788
- toast5.success(t("orders.fulfillment.toast.canceled"));
1796
+ toast6.success(t("orders.fulfillment.toast.canceled"));
1789
1797
  },
1790
1798
  onError: (e) => {
1791
- toast5.error(e.message);
1799
+ toast6.error(e.message);
1792
1800
  }
1793
1801
  });
1794
1802
  }
@@ -1912,7 +1920,7 @@ import {
1912
1920
  Heading as Heading8,
1913
1921
  StatusBadge as StatusBadge2,
1914
1922
  Text as Text9,
1915
- toast as toast6,
1923
+ toast as toast7,
1916
1924
  usePrompt as usePrompt3
1917
1925
  } from "@medusajs/ui";
1918
1926
  import { useTranslation as useTranslation12 } from "react-i18next";
@@ -1936,10 +1944,10 @@ var OrderGeneralSection = ({ order }) => {
1936
1944
  }
1937
1945
  await cancelOrder(void 0, {
1938
1946
  onSuccess: () => {
1939
- toast6.success(t("orders.orderCanceled"));
1947
+ toast7.success(t("orders.orderCanceled"));
1940
1948
  },
1941
1949
  onError: (e) => {
1942
- toast6.error(e.message);
1950
+ toast7.error(e.message);
1943
1951
  }
1944
1952
  });
1945
1953
  };
@@ -2014,7 +2022,7 @@ import {
2014
2022
  Heading as Heading9,
2015
2023
  StatusBadge as StatusBadge3,
2016
2024
  Text as Text10,
2017
- toast as toast8,
2025
+ toast as toast9,
2018
2026
  Tooltip as Tooltip4,
2019
2027
  usePrompt as usePrompt4
2020
2028
  } from "@medusajs/ui";
@@ -2025,14 +2033,14 @@ import { Trans, useTranslation as useTranslation14 } from "react-i18next";
2025
2033
  import { useTranslation as useTranslation13 } from "react-i18next";
2026
2034
  import { useState as useState4 } from "react";
2027
2035
  import copy from "copy-to-clipboard";
2028
- import { clx as clx2, toast as toast7, Tooltip as Tooltip3 } from "@medusajs/ui";
2036
+ import { clx as clx2, toast as toast8, Tooltip as Tooltip3 } from "@medusajs/ui";
2029
2037
  import { jsx as jsx13, jsxs as jsxs14 } from "react/jsx-runtime";
2030
2038
  function DisplayId({ id, className }) {
2031
2039
  const { t } = useTranslation13();
2032
2040
  const [open, setOpen] = useState4(false);
2033
2041
  const onClick = () => {
2034
2042
  copy(id);
2035
- toast7.success(t("actions.idCopiedToClipboard"));
2043
+ toast8.success(t("actions.idCopiedToClipboard"));
2036
2044
  };
2037
2045
  return /* @__PURE__ */ jsx13(Tooltip3, { maxWidth: 260, content: id, open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs14("span", { onClick, className: clx2("cursor-pointer", className), children: [
2038
2046
  "#",
@@ -2142,14 +2150,14 @@ var Payment = ({
2142
2150
  { amount: payment.amount },
2143
2151
  {
2144
2152
  onSuccess: () => {
2145
- toast8.success(
2153
+ toast9.success(
2146
2154
  t("orders.payment.capturePaymentSuccess", {
2147
2155
  amount: formatCurrency(payment.amount, currencyCode)
2148
2156
  })
2149
2157
  );
2150
2158
  },
2151
2159
  onError: (error) => {
2152
- toast8.error(error.message);
2160
+ toast9.error(error.message);
2153
2161
  }
2154
2162
  }
2155
2163
  );
@@ -2372,7 +2380,7 @@ import {
2372
2380
  Heading as Heading10,
2373
2381
  StatusBadge as StatusBadge4,
2374
2382
  Text as Text12,
2375
- toast as toast9,
2383
+ toast as toast10,
2376
2384
  Tooltip as Tooltip7,
2377
2385
  usePrompt as usePrompt5
2378
2386
  } from "@medusajs/ui";
@@ -2632,7 +2640,7 @@ var OrderSummarySection = ({
2632
2640
  { order_id: order.id },
2633
2641
  {
2634
2642
  onSuccess: () => {
2635
- toast9.success(
2643
+ toast10.success(
2636
2644
  t("orders.payment.markAsPaidPaymentSuccess", {
2637
2645
  amount: formatCurrency(
2638
2646
  paymentCollection.amount,
@@ -2642,7 +2650,7 @@ var OrderSummarySection = ({
2642
2650
  );
2643
2651
  },
2644
2652
  onError: (error) => {
2645
- toast9.error(error.message);
2653
+ toast10.error(error.message);
2646
2654
  }
2647
2655
  }
2648
2656
  );
@@ -33,7 +33,7 @@ import "./chunk-ZCZL3STK.mjs";
33
33
  import "./chunk-OHSRRFGN.mjs";
34
34
  import "./chunk-F6PXCY3N.mjs";
35
35
  import "./chunk-NCR5UWRI.mjs";
36
- import "./chunk-ZODJNBAV.mjs";
36
+ import "./chunk-R2G2B47Y.mjs";
37
37
  import "./chunk-GRT22PE5.mjs";
38
38
  import "./chunk-32IQRUVY.mjs";
39
39
  import {
@@ -29,7 +29,7 @@ import "./chunk-ZCZL3STK.mjs";
29
29
  import "./chunk-OHSRRFGN.mjs";
30
30
  import "./chunk-F6PXCY3N.mjs";
31
31
  import "./chunk-NCR5UWRI.mjs";
32
- import "./chunk-ZODJNBAV.mjs";
32
+ import "./chunk-R2G2B47Y.mjs";
33
33
  import "./chunk-GRT22PE5.mjs";
34
34
  import "./chunk-32IQRUVY.mjs";
35
35
  import {
@@ -33,7 +33,7 @@ import "./chunk-ZCZL3STK.mjs";
33
33
  import "./chunk-OHSRRFGN.mjs";
34
34
  import "./chunk-F6PXCY3N.mjs";
35
35
  import "./chunk-NCR5UWRI.mjs";
36
- import "./chunk-ZODJNBAV.mjs";
36
+ import "./chunk-R2G2B47Y.mjs";
37
37
  import "./chunk-GRT22PE5.mjs";
38
38
  import "./chunk-32IQRUVY.mjs";
39
39
  import {
@@ -9,7 +9,7 @@ import {
9
9
  ConfigurableDataTable,
10
10
  createTableAdapter,
11
11
  orderColumnAdapter
12
- } from "./chunk-6RWF7BPW.mjs";
12
+ } from "./chunk-V6JXTITD.mjs";
13
13
  import "./chunk-3I6G3NRU.mjs";
14
14
  import "./chunk-SJ3E4T6B.mjs";
15
15
  import "./chunk-INE2QCSC.mjs";
@@ -34,7 +34,7 @@ import {
34
34
  import {
35
35
  useDataTableDateFilters
36
36
  } from "./chunk-Q33G337Z.mjs";
37
- import "./chunk-OQPVQGSH.mjs";
37
+ import "./chunk-7GBCLBMX.mjs";
38
38
  import "./chunk-C76H5USB.mjs";
39
39
  import "./chunk-PFKKVLZX.mjs";
40
40
  import "./chunk-MNXC6Q4F.mjs";
@@ -25,7 +25,7 @@ import "./chunk-ZCZL3STK.mjs";
25
25
  import "./chunk-OHSRRFGN.mjs";
26
26
  import "./chunk-F6PXCY3N.mjs";
27
27
  import "./chunk-NCR5UWRI.mjs";
28
- import "./chunk-ZODJNBAV.mjs";
28
+ import "./chunk-R2G2B47Y.mjs";
29
29
  import "./chunk-GRT22PE5.mjs";
30
30
  import "./chunk-32IQRUVY.mjs";
31
31
  import {
@@ -45,7 +45,7 @@ import "./chunk-ZCZL3STK.mjs";
45
45
  import "./chunk-OHSRRFGN.mjs";
46
46
  import "./chunk-F6PXCY3N.mjs";
47
47
  import "./chunk-NCR5UWRI.mjs";
48
- import "./chunk-ZODJNBAV.mjs";
48
+ import "./chunk-R2G2B47Y.mjs";
49
49
  import "./chunk-GRT22PE5.mjs";
50
50
  import {
51
51
  useStockLocation