@medusajs/dashboard 2.10.4-snapshot-20250922195925 → 2.10.4-snapshot-20250923121159

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 (151) hide show
  1. package/dist/{add-campaign-promotions-PLZXWFNV.mjs → add-campaign-promotions-JOVLXLS4.mjs} +3 -3
  2. package/dist/{api-key-management-detail-ZQFNZNWW.mjs → api-key-management-detail-I7T67TXF.mjs} +2 -3
  3. package/dist/{api-key-management-sales-channels-WL5L5XWM.mjs → api-key-management-sales-channels-6GN6RVZ2.mjs} +1 -1
  4. package/dist/app.css +0 -3
  5. package/dist/app.js +3320 -4024
  6. package/dist/app.mjs +3 -4
  7. package/dist/{campaign-detail-VTCCVWKS.mjs → campaign-detail-NRZHGINV.mjs} +4 -5
  8. package/dist/{categories-metadata-FTFYPASQ.mjs → categories-metadata-GXWJ3HOG.mjs} +1 -2
  9. package/dist/{category-detail-QHU2CLYA.mjs → category-detail-ENUI5EFL.mjs} +2 -3
  10. package/dist/{category-products-YGTL7GXQ.mjs → category-products-ZG5QDWSW.mjs} +2 -3
  11. package/dist/{chunk-JO6QASTJ.mjs → chunk-37UXEJF2.mjs} +1 -1
  12. package/dist/{chunk-BM5ZIV5V.mjs → chunk-5WKYR6PY.mjs} +1 -1
  13. package/dist/{chunk-VE7JFMAN.mjs → chunk-6AGMMT5H.mjs} +2 -2
  14. package/dist/{chunk-XTNS2NRD.mjs → chunk-BHZAQZYP.mjs} +1 -1
  15. package/dist/{chunk-6V6KATTW.mjs → chunk-JHXKKOHO.mjs} +10 -33
  16. package/dist/{chunk-FTVAORQM.mjs → chunk-JIQQKKLO.mjs} +1 -1
  17. package/dist/{chunk-5CE3JPWD.mjs → chunk-JMQ6V54O.mjs} +1 -1
  18. package/dist/{chunk-CU5EFQSB.mjs → chunk-NRBOPOMS.mjs} +1 -1
  19. package/dist/{chunk-BSBCIU6C.mjs → chunk-OGHQ6VJI.mjs} +5 -0
  20. package/dist/{chunk-K3OMOMRB.mjs → chunk-OKMF4YI7.mjs} +0 -25
  21. package/dist/{chunk-PHXKD2LR.mjs → chunk-OLUNPPBR.mjs} +1 -1
  22. package/dist/{chunk-WYDDFRYM.mjs → chunk-RVOPC44F.mjs} +103 -135
  23. package/dist/{chunk-YPDTZXV6.mjs → chunk-Y4YXZY7R.mjs} +1 -1
  24. package/dist/{chunk-UNM3LPTG.mjs → chunk-YM4QJC6Y.mjs} +24 -11
  25. package/dist/{chunk-PPI7PTY6.mjs → chunk-ZJA7VBUR.mjs} +6 -33
  26. package/dist/{collection-add-products-OJ2EZLC7.mjs → collection-add-products-2ISNNIHD.mjs} +2 -3
  27. package/dist/{collection-detail-RMZK523E.mjs → collection-detail-OSX6NHNQ.mjs} +2 -3
  28. package/dist/{collection-list-BJ3VNZAA.mjs → collection-list-MPIYSHQJ.mjs} +3 -4
  29. package/dist/{collection-metadata-R3DI65D3.mjs → collection-metadata-EOFYXEQI.mjs} +1 -2
  30. package/dist/{customer-detail-G7G6PYOO.mjs → customer-detail-FCNRRZSW.mjs} +1 -2
  31. package/dist/{customer-group-detail-XQ32DPQ3.mjs → customer-group-detail-QI3QLJJL.mjs} +1 -2
  32. package/dist/{customer-group-list-CARES5CM.mjs → customer-group-list-D26UKQMR.mjs} +2 -3
  33. package/dist/{customers-add-customer-group-NLPVKARS.mjs → customers-add-customer-group-5TFTVDB6.mjs} +1 -2
  34. package/dist/{edit-rules-JRLCVE26.mjs → edit-rules-63NG4QVR.mjs} +1 -2
  35. package/dist/{inventory-create-ZC6HV2FY.mjs → inventory-create-RIVJFJJQ.mjs} +1 -2
  36. package/dist/{inventory-detail-WVI4FTTH.mjs → inventory-detail-QHL7TJFZ.mjs} +2 -3
  37. package/dist/{inventory-metadata-BLIJBNQS.mjs → inventory-metadata-FH4CHJBA.mjs} +1 -2
  38. package/dist/{inventory-stock-ZCTXWRK6.mjs → inventory-stock-D6E4LQRK.mjs} +1 -2
  39. package/dist/{location-detail-GV3POY4C.mjs → location-detail-Z6ZDX6RY.mjs} +1 -2
  40. package/dist/{location-fulfillment-providers-INUQXJYU.mjs → location-fulfillment-providers-45VXZMZI.mjs} +2 -3
  41. package/dist/location-list-62KBWY4T.mjs +316 -0
  42. package/dist/{location-sales-channels-2BOIPBBG.mjs → location-sales-channels-O5XLIPAR.mjs} +1 -1
  43. package/dist/{location-service-zone-shipping-option-create-6KO3QDMQ.mjs → location-service-zone-shipping-option-create-NO3665DC.mjs} +1 -2
  44. package/dist/{login-57FIKGXA.mjs → login-DSPNELTI.mjs} +1 -2
  45. package/dist/{order-create-claim-LXKBCAWN.mjs → order-create-claim-V63BWLB5.mjs} +1 -2
  46. package/dist/{order-create-edit-264PTIEI.mjs → order-create-edit-NPF4UZ4D.mjs} +1 -2
  47. package/dist/{order-create-exchange-ZMUVPYM3.mjs → order-create-exchange-RHIPPSKU.mjs} +1 -2
  48. package/dist/{order-create-fulfillment-LE6O3SA5.mjs → order-create-fulfillment-4SSUHQ75.mjs} +1 -2
  49. package/dist/{order-create-refund-B7BO2EJL.mjs → order-create-refund-QVQC5ZP5.mjs} +1 -2
  50. package/dist/{order-create-shipment-UOPCS5N7.mjs → order-create-shipment-TJAARKWA.mjs} +1 -2
  51. package/dist/{order-detail-SG7AXBRS.mjs → order-detail-2MIN6B2I.mjs} +1 -2
  52. package/dist/{order-edit-billing-address-RPPJ4Z36.mjs → order-edit-billing-address-QP2I5F3E.mjs} +1 -2
  53. package/dist/{order-edit-email-A7D5HTU6.mjs → order-edit-email-7WT7XTHB.mjs} +1 -2
  54. package/dist/{order-edit-shipping-address-LXKC5CJE.mjs → order-edit-shipping-address-3QFMQP4I.mjs} +1 -2
  55. package/dist/{order-list-ZCMNSZYB.mjs → order-list-73DBATIK.mjs} +2 -2
  56. package/dist/{order-metadata-KS47UOEE.mjs → order-metadata-YJS26DHK.mjs} +1 -2
  57. package/dist/{order-receive-return-PDU2YVLT.mjs → order-receive-return-PZMMMUB2.mjs} +1 -2
  58. package/dist/{order-request-transfer-WMQKDLDF.mjs → order-request-transfer-QBIZD36E.mjs} +1 -2
  59. package/dist/{price-list-create-QZSB4W5Z.mjs → price-list-create-RXDH5CXF.mjs} +2 -3
  60. package/dist/{price-list-detail-2FMINPFT.mjs → price-list-detail-PKIKOJ4H.mjs} +2 -3
  61. package/dist/{price-list-prices-add-WYK2QBAI.mjs → price-list-prices-add-2CDPUSYA.mjs} +2 -3
  62. package/dist/{product-attributes-KDXI2RNP.mjs → product-attributes-FQDJCNUB.mjs} +4 -5
  63. package/dist/{product-create-TVYPK4VC.mjs → product-create-W37RQLON.mjs} +5 -6
  64. package/dist/{product-create-variant-6YWLDA2X.mjs → product-create-variant-KJKQ6ROY.mjs} +1 -2
  65. package/dist/{product-detail-RFKXMYE5.mjs → product-detail-TANIKAEK.mjs} +5 -6
  66. package/dist/{product-edit-5FNY7HG4.mjs → product-edit-DO76GHBI.mjs} +4 -5
  67. package/dist/{product-export-BEAUMFAZ.mjs → product-export-XERWEI5H.mjs} +2 -3
  68. package/dist/{product-import-SOX4UJPM.mjs → product-import-AGFJMSVK.mjs} +1 -2
  69. package/dist/{product-list-ZVXATJRE.mjs → product-list-KJ3HXPLB.mjs} +4 -5
  70. package/dist/{product-media-JPU23SPH.mjs → product-media-VG4YM2W6.mjs} +2 -2
  71. package/dist/{product-metadata-QRRCHZZB.mjs → product-metadata-NZ3HKO67.mjs} +1 -2
  72. package/dist/{product-organization-QTWB7VMB.mjs → product-organization-OOVUGXNP.mjs} +4 -5
  73. package/dist/{product-sales-channels-UGPAXFAV.mjs → product-sales-channels-QEJRSCAU.mjs} +1 -1
  74. package/dist/{product-shipping-profile-Q6UX6ZNJ.mjs → product-shipping-profile-FFMKOF6B.mjs} +4 -5
  75. package/dist/{product-stock-TSAIHVY6.mjs → product-stock-SUVEQZML.mjs} +1 -2
  76. package/dist/{product-tag-create-5NZJS2D2.mjs → product-tag-create-T6HVAQKN.mjs} +1 -2
  77. package/dist/{product-tag-detail-3XHUROBO.mjs → product-tag-detail-HOWUZC3P.mjs} +5 -6
  78. package/dist/{product-tag-edit-YYOOHKGG.mjs → product-tag-edit-WWQDNDRC.mjs} +1 -2
  79. package/dist/{product-tag-list-5XTTMNOA.mjs → product-tag-list-FAKSLONF.mjs} +5 -6
  80. package/dist/{product-tag-metadata-YAD3MPWF.mjs → product-tag-metadata-6B56VEZU.mjs} +1 -2
  81. package/dist/{product-type-detail-MNTAHQKJ.mjs → product-type-detail-KN64HYUV.mjs} +2 -3
  82. package/dist/{product-type-metadata-HWR3WBGT.mjs → product-type-metadata-F3FTI6OG.mjs} +1 -2
  83. package/dist/{product-variant-detail-DKFAG3KO.mjs → product-variant-detail-OUHBUY4J.mjs} +1 -2
  84. package/dist/{product-variant-edit-EZENYVAN.mjs → product-variant-edit-NBYHDUJ5.mjs} +1 -2
  85. package/dist/{product-variant-metadata-S7QENSUG.mjs → product-variant-metadata-XDVLJYGQ.mjs} +1 -2
  86. package/dist/{promotion-create-O3KUSPIU.mjs → promotion-create-UUOG52D5.mjs} +1 -2
  87. package/dist/{promotion-detail-5DU6ULJG.mjs → promotion-detail-GONXLJZ2.mjs} +113 -65
  88. package/dist/{promotion-list-Q2FOGORE.mjs → promotion-list-NNEMVJ6I.mjs} +3 -3
  89. package/dist/{region-metadata-G3JH5ZN6.mjs → region-metadata-IQVB4ERU.mjs} +1 -2
  90. package/dist/{reservation-detail-PJXS67UM.mjs → reservation-detail-RTGHD35L.mjs} +1 -2
  91. package/dist/{reservation-metadata-UCKQB66O.mjs → reservation-metadata-WKJXBRLQ.mjs} +1 -2
  92. package/dist/{reset-password-5KIEBJHN.mjs → reset-password-ANJHGYUE.mjs} +1 -1
  93. package/dist/{return-reason-list-OGFYWMC5.mjs → return-reason-list-MOP7YWMZ.mjs} +2 -2
  94. package/dist/{sales-channel-add-products-CSMNFGHD.mjs → sales-channel-add-products-OKVZJ6FI.mjs} +2 -3
  95. package/dist/{sales-channel-detail-ZSA3HNWW.mjs → sales-channel-detail-WESBK6Q7.mjs} +2 -3
  96. package/dist/{sales-channel-list-X5ADP34V.mjs → sales-channel-list-LKVHXUXW.mjs} +2 -3
  97. package/dist/{sales-channel-metadata-ABWIDI3B.mjs → sales-channel-metadata-2OQAHYB4.mjs} +1 -2
  98. package/dist/{shipping-option-type-create-Q2X5OMJS.mjs → shipping-option-type-create-3CGPGDYJ.mjs} +1 -2
  99. package/dist/{shipping-option-type-detail-VT3Y5QQ4.mjs → shipping-option-type-detail-S23H2OGW.mjs} +2 -3
  100. package/dist/{shipping-option-type-edit-IA3EER2N.mjs → shipping-option-type-edit-IHE7XM6M.mjs} +1 -2
  101. package/dist/{shipping-option-type-list-JZPKAL3H.mjs → shipping-option-type-list-47GRJ6EC.mjs} +2 -3
  102. package/dist/{shipping-profile-metadata-EYXBWBF2.mjs → shipping-profile-metadata-OXWOXAAR.mjs} +1 -2
  103. package/dist/{store-detail-LI72QMUZ.mjs → store-detail-4K7TW2TP.mjs} +1 -2
  104. package/dist/{store-metadata-ZITLAS5H.mjs → store-metadata-JP2CI7EF.mjs} +1 -2
  105. package/dist/{tax-region-create-IU2R5VIY.mjs → tax-region-create-IWM4755I.mjs} +2 -3
  106. package/dist/{tax-region-detail-6FHD35LB.mjs → tax-region-detail-V2F2DONN.mjs} +1 -2
  107. package/dist/{tax-region-edit-O2WJXYIE.mjs → tax-region-edit-CJPMYTBF.mjs} +1 -2
  108. package/dist/{tax-region-province-detail-YDBU4CUU.mjs → tax-region-province-detail-4PUQ5ADW.mjs} +1 -2
  109. package/dist/{tax-region-tax-override-create-EF3LLZWM.mjs → tax-region-tax-override-create-3SCIOK4P.mjs} +5 -6
  110. package/dist/{tax-region-tax-override-edit-2DG3J6CO.mjs → tax-region-tax-override-edit-P3QJKET3.mjs} +5 -6
  111. package/dist/{user-list-3YFYZFSK.mjs → user-list-MKJLB5CQ.mjs} +1 -1
  112. package/dist/{user-metadata-QUIFIM5G.mjs → user-metadata-ZURLDLGC.mjs} +1 -2
  113. package/dist/{workflow-execution-detail-PVSQ2VGE.mjs → workflow-execution-detail-4R6AFFHV.mjs} +1 -2
  114. package/package.json +9 -9
  115. package/src/components/data-table/data-table.tsx +64 -46
  116. package/src/components/layout/settings-layout/settings-layout.tsx +0 -4
  117. package/src/dashboard-app/routes/get-route.map.tsx +0 -36
  118. package/src/hooks/api/refund-reasons.tsx +9 -113
  119. package/src/hooks/table/columns/index.ts +0 -1
  120. package/src/hooks/table/query/index.ts +0 -1
  121. package/src/i18n/translations/$schema.json +19 -112
  122. package/src/i18n/translations/en.json +6 -33
  123. package/src/routes/locations/location-list/index.ts +0 -1
  124. package/src/routes/locations/location-list/location-list.tsx +51 -19
  125. package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
  126. package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
  127. package/dist/chunk-BKJC5BGQ.mjs +0 -53
  128. package/dist/chunk-YZJ3W776.mjs +0 -87
  129. package/dist/location-list-BKK2PAKF.mjs +0 -297
  130. package/dist/refund-reason-create-NSZFGXWI.mjs +0 -158
  131. package/dist/refund-reason-edit-RKUSPQCL.mjs +0 -144
  132. package/dist/refund-reason-list-2F5PFERT.mjs +0 -273
  133. package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +0 -28
  134. package/src/hooks/table/query/use-refund-reason-table-query.tsx +0 -32
  135. package/src/routes/locations/location-list/components/location-list-header/index.ts +0 -1
  136. package/src/routes/locations/location-list/components/location-list-header/location-list-header.tsx +0 -21
  137. package/src/routes/locations/location-list/loader.ts +0 -36
  138. package/src/routes/refund-reasons/common/hooks/use-delete-refund-reason-action.tsx +0 -34
  139. package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +0 -1
  140. package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +0 -131
  141. package/src/routes/refund-reasons/refund-reason-create/index.ts +0 -1
  142. package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +0 -10
  143. package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +0 -1
  144. package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +0 -119
  145. package/src/routes/refund-reasons/refund-reason-edit/index.ts +0 -1
  146. package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +0 -33
  147. package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +0 -1
  148. package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +0 -131
  149. package/src/routes/refund-reasons/refund-reason-list/index.ts +0 -2
  150. package/src/routes/refund-reasons/refund-reason-list/loader.ts +0 -16
  151. package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +0 -21
@@ -1,273 +0,0 @@
1
- import {
2
- useRefundReasonTableColumns
3
- } from "./chunk-6V6KATTW.mjs";
4
- import "./chunk-GLVCH422.mjs";
5
- import "./chunk-QMRGIWOP.mjs";
6
- import "./chunk-2WZUO66T.mjs";
7
- import "./chunk-I3VB6NM2.mjs";
8
- import "./chunk-ZJRFL6ZN.mjs";
9
- import {
10
- useRefundReasonTableQuery
11
- } from "./chunk-K3OMOMRB.mjs";
12
- import "./chunk-I5HYE2RW.mjs";
13
- import "./chunk-RIV7FKGN.mjs";
14
- import "./chunk-TDK3JDOB.mjs";
15
- import "./chunk-FHSC5X62.mjs";
16
- import "./chunk-XR4GEMGR.mjs";
17
- import "./chunk-WRSGHGAT.mjs";
18
- import "./chunk-MOSRJHJ3.mjs";
19
- import "./chunk-T7G2CURS.mjs";
20
- import "./chunk-OMC5JCQH.mjs";
21
- import "./chunk-QXXHLVRQ.mjs";
22
- import "./chunk-XMAWMECC.mjs";
23
- import "./chunk-IR5DHEKS.mjs";
24
- import "./chunk-7DXVXBSA.mjs";
25
- import "./chunk-MSDRGCRR.mjs";
26
- import "./chunk-BW322BVH.mjs";
27
- import "./chunk-PCFUZKDS.mjs";
28
- import "./chunk-3I6G3NRU.mjs";
29
- import "./chunk-SJ3E4T6B.mjs";
30
- import "./chunk-INE2QCSC.mjs";
31
- import "./chunk-XLDQPLK4.mjs";
32
- import "./chunk-IQBAUTU5.mjs";
33
- import "./chunk-X6BAAGCL.mjs";
34
- import "./chunk-ADOCJB6L.mjs";
35
- import "./chunk-LQTHYS2Z.mjs";
36
- import "./chunk-P3UUX2T6.mjs";
37
- import {
38
- _DataTable,
39
- useDataTable
40
- } from "./chunk-7VJK6HNE.mjs";
41
- import "./chunk-YEDAFXMB.mjs";
42
- import "./chunk-AOFGTNG6.mjs";
43
- import "./chunk-EMIHDNB7.mjs";
44
- import "./chunk-DK4WIVY6.mjs";
45
- import "./chunk-Z26G6WFJ.mjs";
46
- import "./chunk-M3VFKDXJ.mjs";
47
- import {
48
- SingleColumnPage
49
- } from "./chunk-2RQLKDBF.mjs";
50
- import "./chunk-C76H5USB.mjs";
51
- import "./chunk-PFKKVLZX.mjs";
52
- import "./chunk-MNXC6Q4F.mjs";
53
- import {
54
- useExtension
55
- } from "./chunk-C5P5PL3E.mjs";
56
- import "./chunk-DG7J63J2.mjs";
57
- import "./chunk-LPEUYMRK.mjs";
58
- import {
59
- ActionMenu
60
- } from "./chunk-3NJTXRIY.mjs";
61
- import "./chunk-OC7BQLYI.mjs";
62
- import "./chunk-67ORSRVT.mjs";
63
- import "./chunk-BSBCIU6C.mjs";
64
- import "./chunk-KOSCMAIC.mjs";
65
- import {
66
- refundReasonsQueryKeys,
67
- useDeleteRefundReason,
68
- useRefundReasons
69
- } from "./chunk-YZJ3W776.mjs";
70
- import "./chunk-X6DSNTTX.mjs";
71
- import "./chunk-I6E6CALJ.mjs";
72
- import "./chunk-4RG7UJCT.mjs";
73
- import "./chunk-QTCZFYFH.mjs";
74
- import "./chunk-B4GODIOW.mjs";
75
- import "./chunk-ENV6YVOM.mjs";
76
- import "./chunk-PIR2H25N.mjs";
77
- import "./chunk-RLY2SL5E.mjs";
78
- import "./chunk-C5LYZZZ5.mjs";
79
- import "./chunk-2ZKVRTBW.mjs";
80
- import "./chunk-ZCZL3STK.mjs";
81
- import "./chunk-OHSRRFGN.mjs";
82
- import "./chunk-F6PXCY3N.mjs";
83
- import "./chunk-NCR5UWRI.mjs";
84
- import "./chunk-ZODJNBAV.mjs";
85
- import "./chunk-GRT22PE5.mjs";
86
- import "./chunk-32IQRUVY.mjs";
87
- import "./chunk-KSRI5LOF.mjs";
88
- import "./chunk-YI4CZGTU.mjs";
89
- import "./chunk-BFNH5UWD.mjs";
90
- import "./chunk-KX4P5L3R.mjs";
91
- import "./chunk-4Q4LIFFO.mjs";
92
- import "./chunk-V2LANK5S.mjs";
93
- import "./chunk-QZ6PT4QV.mjs";
94
- import "./chunk-QL4XKIVL.mjs";
95
- import "./chunk-X4X5KUGQ.mjs";
96
- import {
97
- queryClient
98
- } from "./chunk-FXYH54JP.mjs";
99
- import "./chunk-774WSTCC.mjs";
100
- import {
101
- sdk
102
- } from "./chunk-DEQUVHHE.mjs";
103
- import "./chunk-RPUOO7AV.mjs";
104
-
105
- // src/routes/refund-reasons/refund-reason-list/loader.ts
106
- var refundReasonListQuery = () => ({
107
- queryKey: refundReasonsQueryKeys.list(),
108
- queryFn: async () => sdk.admin.refundReason.list()
109
- });
110
- var refundReasonListLoader = async () => {
111
- const query = refundReasonListQuery();
112
- return queryClient.getQueryData(query.queryKey) ?? await queryClient.fetchQuery(query);
113
- };
114
-
115
- // src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx
116
- import { PencilSquare, Trash } from "@medusajs/icons";
117
- import { Button, Container, Heading, Text } from "@medusajs/ui";
118
- import { keepPreviousData } from "@tanstack/react-query";
119
- import { createColumnHelper } from "@tanstack/react-table";
120
- import { useMemo } from "react";
121
- import { useTranslation as useTranslation2 } from "react-i18next";
122
- import { Link } from "react-router-dom";
123
-
124
- // src/routes/refund-reasons/common/hooks/use-delete-refund-reason-action.tsx
125
- import { toast, usePrompt } from "@medusajs/ui";
126
- import { useTranslation } from "react-i18next";
127
- var useDeleteRefundReasonAction = (id, label) => {
128
- const { t } = useTranslation();
129
- const prompt = usePrompt();
130
- const { mutateAsync } = useDeleteRefundReason(id);
131
- return async () => {
132
- const result = await prompt({
133
- title: t("general.areYouSure"),
134
- description: t("refundReasons.delete.confirmation", {
135
- label
136
- }),
137
- confirmText: t("actions.delete"),
138
- cancelText: t("actions.cancel")
139
- });
140
- if (!result) {
141
- return;
142
- }
143
- await mutateAsync(void 0, {
144
- onSuccess: () => {
145
- toast.success(t("refundReasons.delete.successToast"));
146
- },
147
- onError: (error) => {
148
- toast.error(error.message);
149
- }
150
- });
151
- };
152
- };
153
-
154
- // src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx
155
- import { jsx, jsxs } from "react/jsx-runtime";
156
- var PAGE_SIZE = 20;
157
- var RefundReasonListTable = () => {
158
- const { t } = useTranslation2();
159
- const { searchParams, raw } = useRefundReasonTableQuery({
160
- pageSize: PAGE_SIZE
161
- });
162
- const { refund_reasons, count, isPending, isError, error } = useRefundReasons(
163
- searchParams,
164
- {
165
- placeholderData: keepPreviousData
166
- }
167
- );
168
- const columns = useColumns();
169
- const { table } = useDataTable({
170
- data: refund_reasons,
171
- columns,
172
- count,
173
- getRowId: (row) => row.id,
174
- pageSize: PAGE_SIZE
175
- });
176
- if (isError) {
177
- throw error;
178
- }
179
- return /* @__PURE__ */ jsxs(Container, { className: "divide-y px-0 py-0", children: [
180
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
181
- /* @__PURE__ */ jsxs("div", { children: [
182
- /* @__PURE__ */ jsx(Heading, { children: t("refundReasons.domain") }),
183
- /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", children: t("refundReasons.subtitle") })
184
- ] }),
185
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", asChild: true, children: /* @__PURE__ */ jsx(Link, { to: "create", children: t("actions.create") }) })
186
- ] }),
187
- /* @__PURE__ */ jsx(
188
- _DataTable,
189
- {
190
- table,
191
- queryObject: raw,
192
- count,
193
- isLoading: isPending,
194
- columns,
195
- pageSize: PAGE_SIZE,
196
- noHeader: true,
197
- pagination: true,
198
- search: true
199
- }
200
- )
201
- ] });
202
- };
203
- var RefundReasonRowActions = ({
204
- refundReason
205
- }) => {
206
- const { t } = useTranslation2();
207
- const handleDelete = useDeleteRefundReasonAction(
208
- refundReason.id,
209
- refundReason.label
210
- );
211
- return /* @__PURE__ */ jsx(
212
- ActionMenu,
213
- {
214
- groups: [
215
- {
216
- actions: [
217
- {
218
- icon: /* @__PURE__ */ jsx(PencilSquare, {}),
219
- label: t("actions.edit"),
220
- to: `${refundReason.id}/edit`
221
- }
222
- ]
223
- },
224
- {
225
- actions: [
226
- {
227
- icon: /* @__PURE__ */ jsx(Trash, {}),
228
- label: t("actions.delete"),
229
- onClick: handleDelete
230
- }
231
- ]
232
- }
233
- ]
234
- }
235
- );
236
- };
237
- var columnHelper = createColumnHelper();
238
- var useColumns = () => {
239
- const base = useRefundReasonTableColumns();
240
- return useMemo(
241
- () => [
242
- ...base,
243
- columnHelper.display({
244
- id: "actions",
245
- cell: ({ row }) => /* @__PURE__ */ jsx(RefundReasonRowActions, { refundReason: row.original })
246
- })
247
- ],
248
- [base]
249
- );
250
- };
251
-
252
- // src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx
253
- import { jsx as jsx2 } from "react/jsx-runtime";
254
- var RefundReasonList = () => {
255
- const { getWidgets } = useExtension();
256
- return /* @__PURE__ */ jsx2(
257
- SingleColumnPage,
258
- {
259
- showMetadata: false,
260
- showJSON: false,
261
- hasOutlet: true,
262
- widgets: {
263
- after: getWidgets("refund_reason.list.after"),
264
- before: getWidgets("refund_reason.list.before")
265
- },
266
- children: /* @__PURE__ */ jsx2(RefundReasonListTable, {})
267
- }
268
- );
269
- };
270
- export {
271
- RefundReasonList as Component,
272
- refundReasonListLoader as loader
273
- };
@@ -1,28 +0,0 @@
1
- import { HttpTypes } from "@medusajs/types"
2
- import { createColumnHelper } from "@tanstack/react-table"
3
- import { useMemo } from "react"
4
-
5
- const columnHelper = createColumnHelper<HttpTypes.AdminRefundReason>()
6
-
7
- export const useRefundReasonTableColumns = () => {
8
- return useMemo(
9
- () => [
10
- columnHelper.accessor("label", {
11
- cell: ({ row }) => {
12
- const { label, description } = row.original
13
- return (
14
- <div className=" py-4">
15
- <div className="flex h-full w-full flex-col justify-center">
16
- <span className="truncate font-medium">{label}</span>
17
- <span className="truncate">
18
- {description ? description : "-"}
19
- </span>
20
- </div>
21
- </div>
22
- )
23
- },
24
- }),
25
- ],
26
- []
27
- )
28
- }
@@ -1,32 +0,0 @@
1
- import { HttpTypes } from "@medusajs/types"
2
- import { useQueryParams } from "../../use-query-params"
3
-
4
- type UseRefundReasonTableQueryProps = {
5
- prefix?: string
6
- pageSize?: number
7
- }
8
-
9
- export const useRefundReasonTableQuery = ({
10
- prefix,
11
- pageSize = 20,
12
- }: UseRefundReasonTableQueryProps) => {
13
- const queryObject = useQueryParams(
14
- ["offset", "q", "order", "created_at", "updated_at"],
15
- prefix
16
- )
17
-
18
- const { offset, q, order, created_at, updated_at } = queryObject
19
- const searchParams: HttpTypes.AdminRefundReasonListParams = {
20
- limit: pageSize,
21
- offset: offset ? Number(offset) : 0,
22
- order,
23
- created_at: created_at ? JSON.parse(created_at) : undefined,
24
- updated_at: updated_at ? JSON.parse(updated_at) : undefined,
25
- q,
26
- }
27
-
28
- return {
29
- searchParams,
30
- raw: queryObject,
31
- }
32
- }
@@ -1 +0,0 @@
1
- export * from "./location-list-header"
@@ -1,21 +0,0 @@
1
- import { Button, Container, Heading, Text } from "@medusajs/ui"
2
- import { useTranslation } from "react-i18next"
3
- import { Link } from "react-router-dom"
4
-
5
- export const LocationListHeader = () => {
6
- const { t } = useTranslation()
7
-
8
- return (
9
- <Container className="flex h-fit items-center justify-between gap-x-4 px-6 py-4">
10
- <div>
11
- <Heading>{t("stockLocations.domain")}</Heading>
12
- <Text className="text-ui-fg-subtle txt-small">
13
- {t("stockLocations.list.description")}
14
- </Text>
15
- </div>
16
- <Button size="small" className="shrink-0" variant="secondary" asChild>
17
- <Link to="create">{t("actions.create")}</Link>
18
- </Button>
19
- </Container>
20
- )
21
- }
@@ -1,36 +0,0 @@
1
- import { FetchError } from "@medusajs/js-sdk"
2
- import { LoaderFunctionArgs, redirect } from "react-router-dom"
3
-
4
- import { HttpTypes } from "@medusajs/types"
5
- import { stockLocationsQueryKeys } from "../../../hooks/api/stock-locations"
6
- import { sdk } from "../../../lib/client"
7
- import { queryClient } from "../../../lib/query-client"
8
- import { LOCATION_LIST_FIELDS } from "./constants"
9
-
10
- const shippingListQuery = () => ({
11
- queryKey: stockLocationsQueryKeys.lists(),
12
- queryFn: async () => {
13
- return await sdk.admin.stockLocation
14
- .list({
15
- // TODO: change this when RQ is fixed
16
- fields: LOCATION_LIST_FIELDS,
17
- })
18
- .catch((error: FetchError) => {
19
- if (error.status === 401) {
20
- throw redirect("/login")
21
- }
22
-
23
- throw error
24
- })
25
- },
26
- })
27
-
28
- export const shippingListLoader = async (_: LoaderFunctionArgs) => {
29
- const query = shippingListQuery()
30
-
31
- return (
32
- queryClient.getQueryData<HttpTypes.AdminStockLocationListResponse>(
33
- query.queryKey
34
- ) ?? (await queryClient.fetchQuery(query))
35
- )
36
- }
@@ -1,34 +0,0 @@
1
- import { toast, usePrompt } from "@medusajs/ui"
2
- import { useTranslation } from "react-i18next"
3
- import { useDeleteRefundReason } from "../../../../hooks/api"
4
-
5
- export const useDeleteRefundReasonAction = (id: string, label: string) => {
6
- const { t } = useTranslation()
7
- const prompt = usePrompt()
8
-
9
- const { mutateAsync } = useDeleteRefundReason(id)
10
-
11
- return async () => {
12
- const result = await prompt({
13
- title: t("general.areYouSure"),
14
- description: t("refundReasons.delete.confirmation", {
15
- label,
16
- }),
17
- confirmText: t("actions.delete"),
18
- cancelText: t("actions.cancel"),
19
- })
20
-
21
- if (!result) {
22
- return
23
- }
24
-
25
- await mutateAsync(undefined, {
26
- onSuccess: () => {
27
- toast.success(t("refundReasons.delete.successToast"))
28
- },
29
- onError: (error) => {
30
- toast.error(error.message)
31
- },
32
- })
33
- }
34
- }
@@ -1 +0,0 @@
1
- export { RefundReasonCreateForm } from "./refund-reason-create-form"
@@ -1,131 +0,0 @@
1
- import { zodResolver } from "@hookform/resolvers/zod"
2
- import { Button, Heading, Input, Text, Textarea, toast } from "@medusajs/ui"
3
- import { useForm } from "react-hook-form"
4
- import { useTranslation } from "react-i18next"
5
- import { z } from "zod"
6
- import { Form } from "../../../../../components/common/form"
7
- import {
8
- RouteFocusModal,
9
- useRouteModal,
10
- } from "../../../../../components/modals"
11
- import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
12
- import { useCreateRefundReason } from "../../../../../hooks/api"
13
-
14
- const RefundReasonCreateSchema = z.object({
15
- label: z.string().min(1),
16
- description: z.string().optional(),
17
- })
18
-
19
- export const RefundReasonCreateForm = () => {
20
- const { t } = useTranslation()
21
- const { handleSuccess } = useRouteModal()
22
-
23
- const form = useForm<z.infer<typeof RefundReasonCreateSchema>>({
24
- defaultValues: {
25
- label: "",
26
- description: "",
27
- },
28
- resolver: zodResolver(RefundReasonCreateSchema),
29
- })
30
-
31
- const { mutateAsync, isPending } = useCreateRefundReason()
32
-
33
- const handleSubmit = form.handleSubmit(async (data) => {
34
- await mutateAsync(data, {
35
- onSuccess: ({ refund_reason }) => {
36
- toast.success(
37
- t("refundReasons.create.successToast", {
38
- label: refund_reason.label,
39
- })
40
- )
41
- handleSuccess(`../`)
42
- },
43
- onError: (error) => {
44
- toast.error(error.message)
45
- },
46
- })
47
- })
48
-
49
- return (
50
- <RouteFocusModal.Form form={form}>
51
- <KeyboundForm
52
- className="flex size-full flex-col overflow-hidden"
53
- onSubmit={handleSubmit}
54
- >
55
- <RouteFocusModal.Header />
56
- <RouteFocusModal.Body className="flex flex-1 justify-center overflow-auto px-6 py-16">
57
- <div className="flex w-full max-w-[720px] flex-col gap-y-8">
58
- <div className="flex flex-col gap-y-1">
59
- <RouteFocusModal.Title asChild>
60
- <Heading>{t("refundReasons.create.header")}</Heading>
61
- </RouteFocusModal.Title>
62
- <RouteFocusModal.Description asChild>
63
- <Text size="small" className="text-ui-fg-subtle">
64
- {t("refundReasons.create.subtitle")}
65
- </Text>
66
- </RouteFocusModal.Description>
67
- </div>
68
- <div className="grid gap-4 md:grid-cols-2">
69
- <Form.Field
70
- control={form.control}
71
- name="label"
72
- render={({ field }) => {
73
- return (
74
- <Form.Item>
75
- <Form.Label>
76
- {t("refundReasons.fields.label.label")}
77
- </Form.Label>
78
- <Form.Control>
79
- <Input
80
- {...field}
81
- placeholder={t(
82
- "refundReasons.fields.label.placeholder"
83
- )}
84
- />
85
- </Form.Control>
86
- <Form.ErrorMessage />
87
- </Form.Item>
88
- )
89
- }}
90
- />
91
- </div>
92
- <Form.Field
93
- control={form.control}
94
- name="description"
95
- render={({ field }) => {
96
- return (
97
- <Form.Item>
98
- <Form.Label optional>
99
- {t("refundReasons.fields.description.label")}
100
- </Form.Label>
101
- <Form.Control>
102
- <Textarea
103
- {...field}
104
- placeholder={t(
105
- "refundReasons.fields.description.placeholder"
106
- )}
107
- />
108
- </Form.Control>
109
- <Form.ErrorMessage />
110
- </Form.Item>
111
- )
112
- }}
113
- />
114
- </div>
115
- </RouteFocusModal.Body>
116
- <RouteFocusModal.Footer>
117
- <div className="flex items-center justify-end gap-2">
118
- <RouteFocusModal.Close asChild>
119
- <Button size="small" variant="secondary" type="button">
120
- {t("actions.cancel")}
121
- </Button>
122
- </RouteFocusModal.Close>
123
- <Button size="small" type="submit" isLoading={isPending}>
124
- {t("actions.save")}
125
- </Button>
126
- </div>
127
- </RouteFocusModal.Footer>
128
- </KeyboundForm>
129
- </RouteFocusModal.Form>
130
- )
131
- }
@@ -1 +0,0 @@
1
- export { RefundReasonCreate as Component } from "./refund-reason-create"
@@ -1,10 +0,0 @@
1
- import { RouteFocusModal } from "../../../components/modals"
2
- import { RefundReasonCreateForm } from "./components/refund-reason-create-form"
3
-
4
- export const RefundReasonCreate = () => {
5
- return (
6
- <RouteFocusModal>
7
- <RefundReasonCreateForm />
8
- </RouteFocusModal>
9
- )
10
- }
@@ -1 +0,0 @@
1
- export { RefundReasonEditForm } from "./refund-reason-edit-form"