@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
@@ -56,7 +56,7 @@ import "./chunk-ZCZL3STK.mjs";
56
56
  import "./chunk-OHSRRFGN.mjs";
57
57
  import "./chunk-F6PXCY3N.mjs";
58
58
  import "./chunk-NCR5UWRI.mjs";
59
- import "./chunk-ZODJNBAV.mjs";
59
+ import "./chunk-R2G2B47Y.mjs";
60
60
  import "./chunk-GRT22PE5.mjs";
61
61
  import "./chunk-32IQRUVY.mjs";
62
62
  import "./chunk-KSRI5LOF.mjs";
@@ -104,7 +104,7 @@ import "./chunk-ZCZL3STK.mjs";
104
104
  import "./chunk-OHSRRFGN.mjs";
105
105
  import "./chunk-F6PXCY3N.mjs";
106
106
  import "./chunk-NCR5UWRI.mjs";
107
- import "./chunk-ZODJNBAV.mjs";
107
+ import "./chunk-R2G2B47Y.mjs";
108
108
  import "./chunk-GRT22PE5.mjs";
109
109
  import "./chunk-32IQRUVY.mjs";
110
110
  import "./chunk-KSRI5LOF.mjs";
@@ -105,7 +105,7 @@ import "./chunk-ZCZL3STK.mjs";
105
105
  import "./chunk-OHSRRFGN.mjs";
106
106
  import "./chunk-F6PXCY3N.mjs";
107
107
  import "./chunk-NCR5UWRI.mjs";
108
- import "./chunk-ZODJNBAV.mjs";
108
+ import "./chunk-R2G2B47Y.mjs";
109
109
  import {
110
110
  useShippingOptions
111
111
  } from "./chunk-GRT22PE5.mjs";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-Q33G337Z.mjs";
10
10
  import {
11
11
  DataTable
12
- } from "./chunk-OQPVQGSH.mjs";
12
+ } from "./chunk-7GBCLBMX.mjs";
13
13
  import {
14
14
  useQueryParams
15
15
  } from "./chunk-C76H5USB.mjs";
@@ -31,7 +31,7 @@ import "./chunk-ZCZL3STK.mjs";
31
31
  import "./chunk-OHSRRFGN.mjs";
32
32
  import "./chunk-F6PXCY3N.mjs";
33
33
  import "./chunk-NCR5UWRI.mjs";
34
- import "./chunk-ZODJNBAV.mjs";
34
+ import "./chunk-R2G2B47Y.mjs";
35
35
  import "./chunk-GRT22PE5.mjs";
36
36
  import "./chunk-32IQRUVY.mjs";
37
37
  import "./chunk-KSRI5LOF.mjs";
@@ -40,7 +40,7 @@ import "./chunk-ZCZL3STK.mjs";
40
40
  import "./chunk-OHSRRFGN.mjs";
41
41
  import "./chunk-F6PXCY3N.mjs";
42
42
  import "./chunk-NCR5UWRI.mjs";
43
- import "./chunk-ZODJNBAV.mjs";
43
+ import "./chunk-R2G2B47Y.mjs";
44
44
  import "./chunk-GRT22PE5.mjs";
45
45
  import "./chunk-32IQRUVY.mjs";
46
46
  import "./chunk-KSRI5LOF.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/dashboard",
3
- "version": "2.10.4-preview-20250924060154",
3
+ "version": "2.10.4-preview-20250924120212",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "vite",
@@ -45,10 +45,10 @@
45
45
  "@dnd-kit/utilities": "^3.2.2",
46
46
  "@hookform/error-message": "^2.0.1",
47
47
  "@hookform/resolvers": "3.4.2",
48
- "@medusajs/admin-shared": "2.10.4-preview-20250924060154",
49
- "@medusajs/icons": "2.10.4-preview-20250924060154",
50
- "@medusajs/js-sdk": "2.10.4-preview-20250924060154",
51
- "@medusajs/ui": "4.0.24-preview-20250924060154",
48
+ "@medusajs/admin-shared": "2.10.4-preview-20250924120212",
49
+ "@medusajs/icons": "2.10.4-preview-20250924120212",
50
+ "@medusajs/js-sdk": "2.10.4-preview-20250924120212",
51
+ "@medusajs/ui": "4.0.24-preview-20250924120212",
52
52
  "@radix-ui/react-dialog": "1.1.4",
53
53
  "@radix-ui/react-dismissable-layer": "1.1.4",
54
54
  "@tanstack/react-query": "5.64.2",
@@ -78,10 +78,10 @@
78
78
  "zod": "3.25.76"
79
79
  },
80
80
  "devDependencies": {
81
- "@medusajs/admin-shared": "2.10.4-preview-20250924060154",
82
- "@medusajs/admin-vite-plugin": "2.10.4-preview-20250924060154",
83
- "@medusajs/types": "2.10.4-preview-20250924060154",
84
- "@medusajs/ui-preset": "2.10.4-preview-20250924060154",
81
+ "@medusajs/admin-shared": "2.10.4-preview-20250924120212",
82
+ "@medusajs/admin-vite-plugin": "2.10.4-preview-20250924120212",
83
+ "@medusajs/types": "2.10.4-preview-20250924120212",
84
+ "@medusajs/ui-preset": "2.10.4-preview-20250924120212",
85
85
  "@types/node": "^20.11.15",
86
86
  "@types/react": "^18.2.79",
87
87
  "@types/react-dom": "^18.2.25",
@@ -31,26 +31,26 @@ type DataTableActionProps = {
31
31
  label: string
32
32
  disabled?: boolean
33
33
  } & (
34
- | {
34
+ | {
35
35
  to: string
36
36
  }
37
- | {
37
+ | {
38
38
  onClick: () => void
39
39
  }
40
- )
40
+ )
41
41
 
42
42
  type DataTableActionMenuActionProps = {
43
43
  label: string
44
44
  icon: ReactNode
45
45
  disabled?: boolean
46
46
  } & (
47
- | {
47
+ | {
48
48
  to: string
49
49
  }
50
- | {
50
+ | {
51
51
  onClick: () => void
52
52
  }
53
- )
53
+ )
54
54
 
55
55
  type DataTableActionMenuGroupProps = {
56
56
  actions: DataTableActionMenuActionProps[]
@@ -138,15 +138,18 @@ export const DataTable = <TData,>({
138
138
  const isViewConfigEnabled = useFeatureFlag("view_configurations")
139
139
 
140
140
  // If view config is disabled, don't use column visibility features
141
- const effectiveEnableColumnVisibility = isViewConfigEnabled && enableColumnVisibility
141
+ const effectiveEnableColumnVisibility =
142
+ isViewConfigEnabled && enableColumnVisibility
142
143
  const effectiveEnableViewSelector = isViewConfigEnabled && enableViewSelector
143
144
 
144
145
  const enableFiltering = filters && filters.length > 0
145
- const showFilterMenu = enableFilterMenu !== undefined ? enableFilterMenu : enableFiltering
146
+ const showFilterMenu =
147
+ enableFilterMenu !== undefined ? enableFilterMenu : enableFiltering
146
148
  const enableCommands = commands && commands.length > 0
147
149
  const enableSorting = columns.some((column) => column.enableSorting)
148
150
 
149
- const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>(initialColumnVisibility)
151
+ const [columnVisibility, setColumnVisibility] =
152
+ React.useState<VisibilityState>(initialColumnVisibility)
150
153
 
151
154
  // Update column visibility when initial visibility changes
152
155
  React.useEffect(() => {
@@ -154,9 +157,12 @@ export const DataTable = <TData,>({
154
157
  const currentKeys = Object.keys(columnVisibility).sort()
155
158
  const newKeys = Object.keys(initialColumnVisibility).sort()
156
159
 
157
- const hasChanged = currentKeys.length !== newKeys.length ||
160
+ const hasChanged =
161
+ currentKeys.length !== newKeys.length ||
158
162
  currentKeys.some((key, index) => key !== newKeys[index]) ||
159
- Object.entries(initialColumnVisibility).some(([key, value]) => columnVisibility[key] !== value)
163
+ Object.entries(initialColumnVisibility).some(
164
+ ([key, value]) => columnVisibility[key] !== value
165
+ )
160
166
 
161
167
  if (hasChanged) {
162
168
  setColumnVisibility(initialColumnVisibility)
@@ -164,10 +170,13 @@ export const DataTable = <TData,>({
164
170
  }, [initialColumnVisibility])
165
171
 
166
172
  // Wrapper function to handle column visibility changes
167
- const handleColumnVisibilityChange = React.useCallback((visibility: VisibilityState) => {
168
- setColumnVisibility(visibility)
169
- onColumnVisibilityChange?.(visibility)
170
- }, [onColumnVisibilityChange])
173
+ const handleColumnVisibilityChange = React.useCallback(
174
+ (visibility: VisibilityState) => {
175
+ setColumnVisibility(visibility)
176
+ onColumnVisibilityChange?.(visibility)
177
+ },
178
+ [onColumnVisibilityChange]
179
+ )
171
180
 
172
181
  // Extract filter IDs for query param management
173
182
  const filterIds = useMemo(() => filters?.map((f) => f.id) ?? [], [filters])
@@ -231,7 +240,7 @@ export const DataTable = <TData,>({
231
240
  Array.from(prev.keys()).forEach((key) => {
232
241
  if (prefixedFilterIds.includes(key)) {
233
242
  // Extract the unprefixed key
234
- const unprefixedKey = prefix ? key.replace(`${prefix}_`, '') : key
243
+ const unprefixedKey = prefix ? key.replace(`${prefix}_`, "") : key
235
244
  if (!(unprefixedKey in value)) {
236
245
  prev.delete(key)
237
246
  }
@@ -257,11 +266,14 @@ export const DataTable = <TData,>({
257
266
  }, [order])
258
267
 
259
268
  // Memoize current configuration to prevent infinite loops
260
- const currentConfiguration = useMemo(() => ({
261
- filters: filtering,
262
- sorting: sorting,
263
- search: search,
264
- }), [filtering, sorting, search])
269
+ const currentConfiguration = useMemo(
270
+ () => ({
271
+ filters: filtering,
272
+ sorting: sorting,
273
+ search: search,
274
+ }),
275
+ [filtering, sorting, search]
276
+ )
265
277
 
266
278
  const handleSortingChange = (value: DataTableSortingState) => {
267
279
  setSearchParams((prev) => {
@@ -315,42 +327,43 @@ export const DataTable = <TData,>({
315
327
  onRowClick: rowHref ? onRowClick : undefined,
316
328
  pagination: enablePagination
317
329
  ? {
318
- state: pagination,
319
- onPaginationChange: handlePaginationChange,
320
- }
330
+ state: pagination,
331
+ onPaginationChange: handlePaginationChange,
332
+ }
321
333
  : undefined,
322
334
  filtering: enableFiltering
323
335
  ? {
324
- state: filtering,
325
- onFilteringChange: handleFilteringChange,
326
- }
336
+ state: filtering,
337
+ onFilteringChange: handleFilteringChange,
338
+ }
327
339
  : undefined,
328
340
  sorting: enableSorting
329
341
  ? {
330
- state: sorting,
331
- onSortingChange: handleSortingChange,
332
- }
342
+ state: sorting,
343
+ onSortingChange: handleSortingChange,
344
+ }
333
345
  : undefined,
334
346
  search: enableSearch
335
347
  ? {
336
- state: search,
337
- onSearchChange: handleSearchChange,
338
- }
348
+ state: search,
349
+ onSearchChange: handleSearchChange,
350
+ }
339
351
  : undefined,
340
352
  rowSelection,
341
353
  isLoading,
342
354
  columnVisibility: effectiveEnableColumnVisibility
343
355
  ? {
344
- state: columnVisibility,
345
- onColumnVisibilityChange: handleColumnVisibilityChange,
346
- }
347
- : undefined,
348
- columnOrder: effectiveEnableColumnVisibility && columnOrder && onColumnOrderChange
349
- ? {
350
- state: columnOrder,
351
- onColumnOrderChange: onColumnOrderChange,
352
- }
356
+ state: columnVisibility,
357
+ onColumnVisibilityChange: handleColumnVisibilityChange,
358
+ }
353
359
  : undefined,
360
+ columnOrder:
361
+ effectiveEnableColumnVisibility && columnOrder && onColumnOrderChange
362
+ ? {
363
+ state: columnOrder,
364
+ onColumnOrderChange: onColumnOrderChange,
365
+ }
366
+ : undefined,
354
367
  })
355
368
 
356
369
  const shouldRenderHeading = heading || subHeading
@@ -358,7 +371,9 @@ export const DataTable = <TData,>({
358
371
  return (
359
372
  <UiDataTable
360
373
  instance={instance}
361
- className={layout === "fill" ? "h-full [&_tr]:last-of-type:!border-b" : undefined}
374
+ className={
375
+ layout === "fill" ? "h-full [&_tr]:last-of-type:!border-b" : undefined
376
+ }
362
377
  >
363
378
  <UiDataTable.Toolbar
364
379
  className="flex flex-col items-start justify-between gap-2 md:flex-row md:items-center"
@@ -397,7 +412,9 @@ export const DataTable = <TData,>({
397
412
  </div>
398
413
  )}
399
414
  {actionMenu && <ActionMenu variant="primary" {...actionMenu} />}
400
- {actions && actions.length > 0 && <DataTableActions actions={actions} />}
415
+ {actions && actions.length > 0 && (
416
+ <DataTableActions actions={actions} />
417
+ )}
401
418
  {!actions && action && <DataTableAction {...action} />}
402
419
  </div>
403
420
  </div>
@@ -407,7 +424,9 @@ export const DataTable = <TData,>({
407
424
  <UiDataTable.Pagination translations={paginationTranslations} />
408
425
  )}
409
426
  {enableCommands && (
410
- <UiDataTable.CommandBar selectedLabel={(count) => `${count} selected`} />
427
+ <UiDataTable.CommandBar
428
+ selectedLabel={(count) => `${count} selected`}
429
+ />
411
430
  )}
412
431
  </UiDataTable>
413
432
  )
@@ -520,4 +539,3 @@ const DataTableActions = ({ actions }: { actions: DataTableActionProps[] }) => {
520
539
  </div>
521
540
  )
522
541
  }
523
-
@@ -130,6 +130,7 @@ export const useAddOrRemoveCampaignPromotions = (
130
130
  onSuccess: (data, variables, context) => {
131
131
  queryClient.invalidateQueries({ queryKey: campaignsQueryKeys.details() })
132
132
  queryClient.invalidateQueries({ queryKey: promotionsQueryKeys.lists() })
133
+ queryClient.invalidateQueries({ queryKey: promotionsQueryKeys.details() })
133
134
  options?.onSuccess?.(data, variables, context)
134
135
  },
135
136
  ...options,
@@ -5834,9 +5834,23 @@
5834
5834
  "properties": {
5835
5835
  "description": {
5836
5836
  "type": "string"
5837
+ },
5838
+ "noRecordsMessage": {
5839
+ "type": "string"
5840
+ },
5841
+ "noRecordsMessageEmpty": {
5842
+ "type": "string"
5843
+ },
5844
+ "noRecordsMessageFiltered": {
5845
+ "type": "string"
5837
5846
  }
5838
5847
  },
5839
- "required": ["description"],
5848
+ "required": [
5849
+ "description",
5850
+ "noRecordsMessage",
5851
+ "noRecordsMessageEmpty",
5852
+ "noRecordsMessageFiltered"
5853
+ ],
5840
5854
  "additionalProperties": false
5841
5855
  },
5842
5856
  "create": {
@@ -5876,9 +5890,12 @@
5876
5890
  "properties": {
5877
5891
  "confirmation": {
5878
5892
  "type": "string"
5893
+ },
5894
+ "successToast": {
5895
+ "type": "string"
5879
5896
  }
5880
5897
  },
5881
- "required": ["confirmation"],
5898
+ "required": ["confirmation", "successToast"],
5882
5899
  "additionalProperties": false
5883
5900
  },
5884
5901
  "fulfillmentProviders": {
@@ -1535,7 +1535,10 @@
1535
1535
  "stockLocations": {
1536
1536
  "domain": "Locations & Shipping",
1537
1537
  "list": {
1538
- "description": "Manage your store's stock locations and shipping options."
1538
+ "description": "Manage your store's stock locations and shipping options.",
1539
+ "noRecordsMessage": "No records",
1540
+ "noRecordsMessageEmpty": "No locations found",
1541
+ "noRecordsMessageFiltered": "No locations found matching the filters"
1539
1542
  },
1540
1543
  "create": {
1541
1544
  "header": "Create Stock Location",
@@ -1548,7 +1551,8 @@
1548
1551
  "successToast": "Location {{name}} was successfully updated."
1549
1552
  },
1550
1553
  "delete": {
1551
- "confirmation": "You are about to delete the stock location \"{{name}}\". This action cannot be undone."
1554
+ "confirmation": "You are about to delete the stock location \"{{name}}\". This action cannot be undone.",
1555
+ "successToast": "Location \"{{name}}\" was successfully deleted."
1552
1556
  },
1553
1557
  "fulfillmentProviders": {
1554
1558
  "header": "Fulfillment Providers",
@@ -2230,7 +2234,7 @@
2230
2234
  "total_used": "Budget used",
2231
2235
  "budget_limit": "Budget limit",
2232
2236
  "campaign_id": {
2233
- "hint": "Only campaigns with the same currency code as the promotion are shown in this list."
2237
+ "hint": "Disabled campaigns have budget in a different currency than the promotion."
2234
2238
  }
2235
2239
  },
2236
2240
  "budget": {
@@ -62,7 +62,7 @@ export const EditLocationForm = ({ location }: EditLocationFormProps) => {
62
62
  },
63
63
  {
64
64
  onSuccess: () => {
65
- toast.success(t("stockLocations.edit.successToast"))
65
+ toast.success(t("stockLocations.edit.successToast", { name: name }))
66
66
  handleSuccess()
67
67
  },
68
68
  onError: (e) => {
@@ -1,2 +1 @@
1
- export { shippingListLoader as loader } from "./loader"
2
1
  export { LocationList as Component } from "./location-list"
@@ -1,34 +1,46 @@
1
1
  import { ShoppingBag, TruckFast } from "@medusajs/icons"
2
2
  import { Container, Heading } from "@medusajs/ui"
3
3
  import { useTranslation } from "react-i18next"
4
- import { useLoaderData } from "react-router-dom"
5
4
 
6
5
  import { useStockLocations } from "../../../hooks/api/stock-locations"
7
- import LocationListItem from "./components/location-list-item/location-list-item"
8
6
  import { LOCATION_LIST_FIELDS } from "./constants"
9
- import { shippingListLoader } from "./loader"
7
+ import { useLocationListTableColumns } from "./use-location-list-table-columns"
8
+ import { useLocationListTableQuery } from "./use-location-list-table-query"
10
9
 
10
+ import { DataTable } from "../../../components/data-table"
11
11
  import { SidebarLink } from "../../../components/common/sidebar-link/sidebar-link"
12
12
  import { TwoColumnPage } from "../../../components/layout/pages"
13
13
  import { useExtension } from "../../../providers/extension-provider"
14
- import { LocationListHeader } from "./components/location-list-header"
14
+ import { keepPreviousData } from "@tanstack/react-query"
15
+
16
+ const PAGE_SIZE = 20
17
+ const PREFIX = "loc"
15
18
 
16
19
  export function LocationList() {
17
- const initialData = useLoaderData() as Awaited<
18
- ReturnType<typeof shippingListLoader>
19
- >
20
+ const { t } = useTranslation()
21
+
22
+ const searchParams = useLocationListTableQuery({
23
+ pageSize: PAGE_SIZE,
24
+ prefix: PREFIX,
25
+ })
20
26
 
21
27
  const {
22
28
  stock_locations: stockLocations = [],
29
+ count,
23
30
  isError,
24
31
  error,
32
+ isLoading,
25
33
  } = useStockLocations(
26
34
  {
27
35
  fields: LOCATION_LIST_FIELDS,
36
+ ...searchParams,
28
37
  },
29
- { initialData }
38
+ {
39
+ placeholderData: keepPreviousData,
40
+ }
30
41
  )
31
42
 
43
+ const columns = useLocationListTableColumns()
32
44
  const { getWidgets } = useExtension()
33
45
 
34
46
  if (isError) {
@@ -46,12 +58,38 @@ export function LocationList() {
46
58
  showJSON
47
59
  >
48
60
  <TwoColumnPage.Main>
49
- <LocationListHeader />
50
- <div className="flex flex-col gap-3 lg:col-span-2">
51
- {stockLocations.map((location) => (
52
- <LocationListItem key={location.id} location={location} />
53
- ))}
54
- </div>
61
+ <Container className="flex flex-col divide-y p-0">
62
+ <DataTable
63
+ data={stockLocations}
64
+ columns={columns}
65
+ rowCount={count}
66
+ pageSize={PAGE_SIZE}
67
+ getRowId={(row) => row.id}
68
+ heading={t("stockLocations.domain")}
69
+ subHeading={t("stockLocations.list.description")}
70
+ emptyState={{
71
+ empty: {
72
+ heading: t("stockLocations.list.noRecordsMessage"),
73
+ description: t("stockLocations.list.noRecordsMessageEmpty"),
74
+ },
75
+ filtered: {
76
+ heading: t("stockLocations.list.noRecordsMessage"),
77
+ description: t("stockLocations.list.noRecordsMessageFiltered"),
78
+ },
79
+ }}
80
+ actions={[
81
+ {
82
+ label: t("actions.create"),
83
+ to: "create",
84
+ },
85
+ ]}
86
+ isLoading={isLoading}
87
+ rowHref={(row) => `/settings/locations/${row.id}`}
88
+ enableSearch={true}
89
+ prefix={PREFIX}
90
+ layout="fill"
91
+ />
92
+ </Container>
55
93
  </TwoColumnPage.Main>
56
94
  <TwoColumnPage.Sidebar>
57
95
  <LinksSection />