@medusajs/dashboard 2.12.2 → 2.13.0-snapshot-20251214175925

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/{api-key-management-detail-AWFAZIS3.mjs → api-key-management-detail-I45X6X64.mjs} +4 -4
  2. package/dist/app.js +9250 -9076
  3. package/dist/app.mjs +5 -5
  4. package/dist/{campaign-detail-63VVZZRR.mjs → campaign-detail-P3CSDHZN.mjs} +4 -4
  5. package/dist/{categories-metadata-MWCZ2DYL.mjs → categories-metadata-BCZ463KN.mjs} +4 -4
  6. package/dist/{category-detail-XL6NRY6P.mjs → category-detail-VDUHW3QT.mjs} +7 -7
  7. package/dist/{category-products-STYU4DUG.mjs → category-products-VOD3XRPG.mjs} +7 -7
  8. package/dist/chunk-35LSPN2U.mjs +66 -0
  9. package/dist/{chunk-EQBVGH3N.mjs → chunk-B3AOQW2B.mjs} +1 -1
  10. package/dist/{chunk-UKECZ5PA.mjs → chunk-EI27JC4V.mjs} +1 -1
  11. package/dist/{chunk-4VNR7DND.mjs → chunk-F5NZDW7L.mjs} +2 -2
  12. package/dist/{chunk-JJGE3EV6.mjs → chunk-F63F3FIT.mjs} +2 -2
  13. package/dist/{chunk-AMOGGDOW.mjs → chunk-HFT7Q5Y5.mjs} +1 -1
  14. package/dist/{chunk-4G2UHUXX.mjs → chunk-M4Z2YEYB.mjs} +8 -8
  15. package/dist/{chunk-XTQ7UFA3.mjs → chunk-MY6I7UJG.mjs} +1 -1
  16. package/dist/{chunk-HMY4BGRC.mjs → chunk-NT6C7CHT.mjs} +1 -1
  17. package/dist/{chunk-JUVGXLY5.mjs → chunk-QPKW37WR.mjs} +1 -1
  18. package/dist/{chunk-GN6OCHP4.mjs → chunk-RU4ZS47V.mjs} +11 -1
  19. package/dist/{chunk-EXDBX4YX.mjs → chunk-SKA4AJO4.mjs} +2 -2
  20. package/dist/{chunk-Q6ULXDU6.mjs → chunk-UWBENEHD.mjs} +127 -109
  21. package/dist/{chunk-EUF6RSI7.mjs → chunk-Y5UO73CH.mjs} +17 -1
  22. package/dist/{chunk-YV4ANEZF.mjs → chunk-YAPTGHGP.mjs} +1 -1
  23. package/dist/{chunk-FIFVOKTK.mjs → chunk-Z6NHG5LQ.mjs} +1 -1
  24. package/dist/{collection-add-products-ESZEWJ46.mjs → collection-add-products-P5B564HQ.mjs} +7 -7
  25. package/dist/{collection-detail-K6IVWLIL.mjs → collection-detail-PCL3HYPB.mjs} +7 -7
  26. package/dist/{collection-list-BL7A7SEI.mjs → collection-list-ANPFZOFP.mjs} +14 -14
  27. package/dist/{collection-metadata-4EYMP7BJ.mjs → collection-metadata-P4A5DXBQ.mjs} +4 -4
  28. package/dist/{customer-detail-KAS23VQF.mjs → customer-detail-ENPJO3DW.mjs} +7 -7
  29. package/dist/{customer-group-detail-NDATWX3X.mjs → customer-group-detail-DVNRFZX5.mjs} +7 -7
  30. package/dist/{customer-group-list-IASP3QHT.mjs → customer-group-list-P2QX5AO4.mjs} +4 -4
  31. package/dist/{customers-add-customer-group-UCCFXRXX.mjs → customers-add-customer-group-RVR476OP.mjs} +7 -7
  32. package/dist/{edit-rules-P5A2TLLU.mjs → edit-rules-2W3BXEXR.mjs} +4 -4
  33. package/dist/en.json +12 -0
  34. package/dist/{inventory-create-KXFY3TQL.mjs → inventory-create-VQEK7C5T.mjs} +4 -4
  35. package/dist/{inventory-detail-ZAZCDL6E.mjs → inventory-detail-UYDDNO24.mjs} +4 -4
  36. package/dist/{inventory-metadata-4HGPMO4B.mjs → inventory-metadata-X52VGHA7.mjs} +4 -4
  37. package/dist/{inventory-stock-KFPSSUND.mjs → inventory-stock-EKTOYN2F.mjs} +4 -4
  38. package/dist/{location-detail-YFDGVGAX.mjs → location-detail-UVWYE6Q2.mjs} +8 -8
  39. package/dist/{location-fulfillment-providers-EGPKJDEL.mjs → location-fulfillment-providers-3BGI2NNW.mjs} +5 -5
  40. package/dist/{location-service-zone-shipping-option-create-LEPP6ZKF.mjs → location-service-zone-shipping-option-create-M7G4SKNP.mjs} +4 -4
  41. package/dist/{login-IQH2HKVZ.mjs → login-NSCAMAU6.mjs} +4 -4
  42. package/dist/{order-allocate-items-3DDI4V3W.mjs → order-allocate-items-5T57NZOB.mjs} +1 -1
  43. package/dist/{order-create-claim-WHQYED4S.mjs → order-create-claim-JLCXZNHU.mjs} +6 -6
  44. package/dist/{order-create-edit-RAWEHXCU.mjs → order-create-edit-QB6LIWSF.mjs} +5 -5
  45. package/dist/{order-create-exchange-P73XCSR7.mjs → order-create-exchange-GOU4AJXP.mjs} +12 -12
  46. package/dist/{order-create-fulfillment-YOL4SA4B.mjs → order-create-fulfillment-SRRP6X64.mjs} +4 -4
  47. package/dist/{order-create-refund-NMP4UN7F.mjs → order-create-refund-PTOM65QK.mjs} +4 -4
  48. package/dist/{order-create-return-QGXWSPMP.mjs → order-create-return-3EOY7TOC.mjs} +2 -2
  49. package/dist/{order-create-shipment-UTNVNIGA.mjs → order-create-shipment-HNILNFXB.mjs} +4 -4
  50. package/dist/{order-detail-4EFWM3R4.mjs → order-detail-BCBUUVU7.mjs} +12 -12
  51. package/dist/{order-edit-billing-address-WBSP4RAG.mjs → order-edit-billing-address-3IO7GXIK.mjs} +4 -4
  52. package/dist/{order-edit-email-CBAUBHW7.mjs → order-edit-email-QIAEOUBV.mjs} +4 -4
  53. package/dist/{order-edit-shipping-address-2TEO4ZRQ.mjs → order-edit-shipping-address-QGGMHGBC.mjs} +4 -4
  54. package/dist/order-export-LPAWHHSK.mjs +121 -0
  55. package/dist/{order-list-QOYJFYD5.mjs → order-list-Y4FET3XV.mjs} +38 -82
  56. package/dist/{order-metadata-66OZ5ZMN.mjs → order-metadata-ZBDTMBHZ.mjs} +4 -4
  57. package/dist/{order-receive-return-2LQFBB4G.mjs → order-receive-return-V42FTCFY.mjs} +5 -5
  58. package/dist/{order-request-transfer-IH3PQCCL.mjs → order-request-transfer-A6NNIN2O.mjs} +4 -4
  59. package/dist/{price-list-configuration-OLIGCEN5.mjs → price-list-configuration-54D4JW6G.mjs} +3 -3
  60. package/dist/{price-list-create-3DCACAZ4.mjs → price-list-create-5DI6QXFL.mjs} +12 -12
  61. package/dist/{price-list-detail-2IW4SDOL.mjs → price-list-detail-7XY3MDV5.mjs} +18 -11
  62. package/dist/{price-list-edit-B3LQZSW6.mjs → price-list-edit-SW7YIR3Z.mjs} +1 -1
  63. package/dist/{price-list-list-D4UPKCNL.mjs → price-list-list-AZOGEZAS.mjs} +33 -17
  64. package/dist/{price-list-prices-add-B5LQAR7J.mjs → price-list-prices-add-UA2DT4AM.mjs} +10 -8
  65. package/dist/{price-list-prices-edit-MAR2T4LM.mjs → price-list-prices-edit-C6SX2TLJ.mjs} +4 -2
  66. package/dist/{product-attributes-DY4HDYTW.mjs → product-attributes-4AEBLFIM.mjs} +5 -5
  67. package/dist/{product-create-EMK2FPWY.mjs → product-create-TGR3I2H2.mjs} +5 -5
  68. package/dist/{product-create-variant-UHUBSUIV.mjs → product-create-variant-WI6D5CDG.mjs} +4 -4
  69. package/dist/{product-detail-M3PFNUX7.mjs → product-detail-YLYXIRRB.mjs} +5 -5
  70. package/dist/{product-edit-ULKEZHDA.mjs → product-edit-ALZUODMD.mjs} +5 -5
  71. package/dist/{product-export-X7MNQLBY.mjs → product-export-CPL66H6S.mjs} +14 -14
  72. package/dist/{product-image-variants-edit-RR5RXMSX.mjs → product-image-variants-edit-X3LUMPLJ.mjs} +4 -4
  73. package/dist/{product-import-OJWU5AHL.mjs → product-import-43UXKCL3.mjs} +4 -4
  74. package/dist/{product-list-FAVJ2A46.mjs → product-list-47T2IZ3F.mjs} +7 -7
  75. package/dist/{product-metadata-VRLBFMKG.mjs → product-metadata-55CAQTPS.mjs} +4 -4
  76. package/dist/{product-organization-4PH2ZOSM.mjs → product-organization-KHZELN3F.mjs} +5 -5
  77. package/dist/{product-stock-EVY7L4ID.mjs → product-stock-22S2HGMM.mjs} +4 -4
  78. package/dist/{product-tag-create-UOQUAMYT.mjs → product-tag-create-7GPE246H.mjs} +4 -4
  79. package/dist/{product-tag-detail-L2J3IXMC.mjs → product-tag-detail-BQG2LJK6.mjs} +16 -16
  80. package/dist/{product-tag-edit-AKATEM3L.mjs → product-tag-edit-WA6FGSIP.mjs} +4 -4
  81. package/dist/{product-tag-list-FUQN7YF5.mjs → product-tag-list-PW7WDCQH.mjs} +16 -16
  82. package/dist/{product-tag-metadata-UEOSDTSK.mjs → product-tag-metadata-EJ7FEXSE.mjs} +4 -4
  83. package/dist/{product-type-detail-2KUITRE3.mjs → product-type-detail-TJQS4BVU.mjs} +7 -7
  84. package/dist/{product-type-metadata-7E66UACZ.mjs → product-type-metadata-Q6W5GL7Z.mjs} +4 -4
  85. package/dist/{product-variant-detail-JHH3ICCS.mjs → product-variant-detail-LYGQDASG.mjs} +4 -4
  86. package/dist/{product-variant-edit-IIT3QIHD.mjs → product-variant-edit-BW7QMHC5.mjs} +4 -4
  87. package/dist/{product-variant-metadata-UXHU6PFJ.mjs → product-variant-metadata-GDMVC4MZ.mjs} +4 -4
  88. package/dist/{promotion-create-KPDZWJWC.mjs → promotion-create-HF6DTKCC.mjs} +10 -10
  89. package/dist/{promotion-detail-SQARSSGK.mjs → promotion-detail-MDVDMQUM.mjs} +4 -4
  90. package/dist/{refund-reason-create-IPZKKRQM.mjs → refund-reason-create-RKIH46D6.mjs} +4 -4
  91. package/dist/{refund-reason-edit-LB66UGH7.mjs → refund-reason-edit-V3KC6NMO.mjs} +4 -4
  92. package/dist/{refund-reason-list-GOKBW63P.mjs → refund-reason-list-FR7POQS5.mjs} +5 -5
  93. package/dist/{region-metadata-S7BUDXPD.mjs → region-metadata-5NGUNAXZ.mjs} +4 -4
  94. package/dist/{reservation-detail-ZL4WMT4A.mjs → reservation-detail-JH77TQHN.mjs} +4 -4
  95. package/dist/{reservation-metadata-QVEVN2FO.mjs → reservation-metadata-ERCWXYVL.mjs} +4 -4
  96. package/dist/return-reason-list-IFFIDA5O.mjs +1 -1
  97. package/dist/{sales-channel-add-products-LCB33I6H.mjs → sales-channel-add-products-SPGDWA44.mjs} +7 -7
  98. package/dist/{sales-channel-detail-RUULD6Q7.mjs → sales-channel-detail-D7VNPSCN.mjs} +7 -7
  99. package/dist/{sales-channel-list-5TFALQQS.mjs → sales-channel-list-QGWQVXVW.mjs} +4 -4
  100. package/dist/{sales-channel-metadata-6WSCB67B.mjs → sales-channel-metadata-CMZN74K7.mjs} +4 -4
  101. package/dist/{shipping-option-type-create-IMF4RHSO.mjs → shipping-option-type-create-4BN2GBHP.mjs} +4 -4
  102. package/dist/{shipping-option-type-detail-PHIHWW6G.mjs → shipping-option-type-detail-YB3TCED2.mjs} +5 -5
  103. package/dist/{shipping-option-type-edit-SG4JQZGW.mjs → shipping-option-type-edit-MDO7ALAU.mjs} +4 -4
  104. package/dist/{shipping-option-type-list-RB2EKPWN.mjs → shipping-option-type-list-6TPD3AMM.mjs} +5 -5
  105. package/dist/{shipping-profile-metadata-M3DVX5KX.mjs → shipping-profile-metadata-HQI7PCPU.mjs} +4 -4
  106. package/dist/{store-add-locales-WAHERXN3.mjs → store-add-locales-XJJCEO6Q.mjs} +4 -4
  107. package/dist/{store-detail-EY2ZQKZO.mjs → store-detail-DNK76PXP.mjs} +4 -4
  108. package/dist/{store-metadata-7UPGGK7F.mjs → store-metadata-ZJD23O4D.mjs} +4 -4
  109. package/dist/{tax-region-create-LQZKNYTD.mjs → tax-region-create-NCO2OQ3I.mjs} +4 -4
  110. package/dist/{tax-region-detail-AVG3XLVL.mjs → tax-region-detail-C42CLE64.mjs} +18 -18
  111. package/dist/{tax-region-edit-XR3ABTNA.mjs → tax-region-edit-YZALLSZY.mjs} +4 -4
  112. package/dist/{tax-region-province-detail-I7FF7NBE.mjs → tax-region-province-detail-G2DPC6XM.mjs} +18 -18
  113. package/dist/{tax-region-tax-override-create-H6LWWOPU.mjs → tax-region-tax-override-create-WIVKENVO.mjs} +15 -15
  114. package/dist/{tax-region-tax-override-edit-SZWBWRCA.mjs → tax-region-tax-override-edit-UDEO3UIY.mjs} +16 -16
  115. package/dist/{user-metadata-X36GKJ47.mjs → user-metadata-4WOICEE7.mjs} +4 -4
  116. package/dist/{workflow-execution-detail-P6H5AUWI.mjs → workflow-execution-detail-OKM6P4SX.mjs} +5 -5
  117. package/package.json +9 -9
  118. package/src/dashboard-app/routes/get-route.map.tsx +6 -0
  119. package/src/hooks/api/orders.tsx +18 -1
  120. package/src/hooks/api/price-lists.tsx +28 -1
  121. package/src/i18n/translations/$schema.json +40 -0
  122. package/src/i18n/translations/en.json +12 -0
  123. package/src/routes/orders/order-export/components/export-filters.tsx +22 -0
  124. package/src/routes/orders/order-export/index.ts +1 -0
  125. package/src/routes/orders/order-export/order-export.tsx +66 -0
  126. package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +14 -6
  127. package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +8 -2
  128. package/src/routes/price-lists/price-list-detail/components/price-list-general-section/price-list-general-section.tsx +13 -5
  129. package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-count-cell.tsx +19 -0
  130. package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-columns.tsx +5 -6
  131. package/src/routes/price-lists/price-list-prices-add/price-list-prices-add.tsx +4 -1
  132. package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +3 -1
  133. package/dist/{chunk-CZFLKMYE.mjs → chunk-YWLAUILP.mjs} +3 -3
  134. package/dist/{customer-group-add-customers-HUGHHMU6.mjs → customer-group-add-customers-A7OGFFJ4.mjs} +3 -3
  135. package/dist/{customer-list-ZXCGIXJC.mjs → customer-list-TG4D4QOT.mjs} +3 -3
  136. package/dist/{location-service-zone-shipping-option-edit-QS6HTWST.mjs → location-service-zone-shipping-option-edit-M2HJAASG.mjs} +3 -3
  137. package/dist/{product-type-list-QX7QC6RI.mjs → product-type-list-7WQ5D2KV.mjs} +3 -3
  138. package/dist/{region-list-XQRIBDMF.mjs → region-list-JAQXIBYD.mjs} +3 -3
@@ -0,0 +1,66 @@
1
+ import { Button, Heading, toast } from "@medusajs/ui"
2
+ import { useTranslation } from "react-i18next"
3
+ import { RouteDrawer, useRouteModal } from "../../../components/modals"
4
+ import { useExportOrders } from "../../../hooks/api"
5
+ import { useOrderTableQuery } from "../../../hooks/table/query"
6
+ import { ExportFilters } from "./components/export-filters"
7
+
8
+ export const OrderExport = () => {
9
+ const { t } = useTranslation()
10
+
11
+ return (
12
+ <RouteDrawer>
13
+ <RouteDrawer.Header>
14
+ <RouteDrawer.Title asChild>
15
+ <Heading>{t("orders.export.header")}</Heading>
16
+ </RouteDrawer.Title>
17
+ <RouteDrawer.Description className="sr-only">
18
+ {t("orders.export.description")}
19
+ </RouteDrawer.Description>
20
+ </RouteDrawer.Header>
21
+ <OrderExportContent />
22
+ </RouteDrawer>
23
+ )
24
+ }
25
+
26
+ const OrderExportContent = () => {
27
+ const { t } = useTranslation()
28
+ const { searchParams } = useOrderTableQuery({})
29
+
30
+ const { mutateAsync } = useExportOrders(searchParams)
31
+ const { handleSuccess } = useRouteModal()
32
+
33
+ const handleExportRequest = async () => {
34
+ await mutateAsync(searchParams, {
35
+ onSuccess: () => {
36
+ toast.info(t("orders.export.success.title"), {
37
+ description: t("orders.export.success.description"),
38
+ })
39
+ handleSuccess()
40
+ },
41
+ onError: (err) => {
42
+ toast.error(err.message)
43
+ },
44
+ })
45
+ }
46
+
47
+ return (
48
+ <>
49
+ <RouteDrawer.Body>
50
+ <ExportFilters />
51
+ </RouteDrawer.Body>
52
+ <RouteDrawer.Footer>
53
+ <div className="flex items-center gap-x-2">
54
+ <RouteDrawer.Close asChild>
55
+ <Button size="small" variant="secondary">
56
+ {t("actions.cancel")}
57
+ </Button>
58
+ </RouteDrawer.Close>
59
+ <Button onClick={handleExportRequest} size="small">
60
+ {t("actions.export")}
61
+ </Button>
62
+ </div>
63
+ </RouteDrawer.Footer>
64
+ </>
65
+ )
66
+ }
@@ -1,16 +1,24 @@
1
1
  import { useTranslation } from "react-i18next"
2
+ import { Outlet, useLocation } from "react-router-dom"
3
+
2
4
  import { ConfigurableDataTable } from "../../../../../components/table/configurable-data-table"
3
5
  import { useOrderTableAdapter } from "./order-table-adapter"
4
6
 
5
7
  export const ConfigurableOrderListTable = () => {
6
8
  const { t } = useTranslation()
7
- const orderAdapter = useOrderTableAdapter()
9
+ const location = useLocation()
10
+ const adapter = useOrderTableAdapter()
8
11
 
9
12
  return (
10
- <ConfigurableDataTable
11
- adapter={orderAdapter}
12
- heading={t("orders.domain")}
13
- layout="fill"
14
- />
13
+ <>
14
+ <ConfigurableDataTable
15
+ adapter={adapter}
16
+ heading={t("orders.domain")}
17
+ actions={[
18
+ { label: t("actions.export"), to: `export${location.search}` },
19
+ ]}
20
+ />
21
+ <Outlet />
22
+ </>
15
23
  )
16
24
  }
@@ -1,15 +1,16 @@
1
- import { Container, Heading } from "@medusajs/ui"
1
+ import { Button, Container, Heading } from "@medusajs/ui"
2
2
  import { keepPreviousData } from "@tanstack/react-query"
3
3
  import { useTranslation } from "react-i18next"
4
+ import { Link, Outlet, useLocation } from "react-router-dom"
4
5
 
5
6
  import { _DataTable } from "../../../../../components/table/data-table/data-table"
6
7
  import { useOrders } from "../../../../../hooks/api/orders"
7
8
  import { useOrderTableColumns } from "../../../../../hooks/table/columns/use-order-table-columns"
8
- import { useOrderTableFilters } from "./use-order-table-filters"
9
9
  import { useOrderTableQuery } from "../../../../../hooks/table/query/use-order-table-query"
10
10
  import { useDataTable } from "../../../../../hooks/use-data-table"
11
11
  import { useFeatureFlag } from "../../../../../providers/feature-flag-provider"
12
12
  import { ConfigurableOrderListTable } from "./configurable-order-list-table"
13
+ import { useOrderTableFilters } from "./use-order-table-filters"
13
14
 
14
15
  import { DEFAULT_FIELDS } from "../../const"
15
16
 
@@ -17,6 +18,7 @@ const PAGE_SIZE = 20
17
18
 
18
19
  export const OrderListTable = () => {
19
20
  const { t } = useTranslation()
21
+ const location = useLocation()
20
22
  const isViewConfigEnabled = useFeatureFlag("view_configurations")
21
23
 
22
24
  // If feature flag is enabled, use the new configurable table
@@ -57,6 +59,9 @@ export const OrderListTable = () => {
57
59
  <Container className="divide-y p-0">
58
60
  <div className="flex items-center justify-between px-6 py-4">
59
61
  <Heading>{t("orders.domain")}</Heading>
62
+ <Button size="small" variant="secondary" asChild>
63
+ <Link to={`export${location.search}`}>{t("actions.export")}</Link>
64
+ </Button>
60
65
  </div>
61
66
  <_DataTable
62
67
  columns={columns}
@@ -78,6 +83,7 @@ export const OrderListTable = () => {
78
83
  message: t("orders.list.noRecordsMessage"),
79
84
  }}
80
85
  />
86
+ <Outlet />
81
87
  </Container>
82
88
  )
83
89
  }
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next"
6
6
  import { ActionMenu } from "../../../../../components/common/action-menu"
7
7
  import { useDeletePriceListAction } from "../../../common/hooks/use-delete-price-list-action"
8
8
  import { getPriceListStatus } from "../../../common/utils"
9
+ import { usePriceListPrices } from "../../../../../hooks/api"
9
10
 
10
11
  type PriceListGeneralSectionProps = {
11
12
  priceList: HttpTypes.AdminPriceList
@@ -15,8 +16,13 @@ export const PriceListGeneralSection = ({
15
16
  priceList,
16
17
  }: PriceListGeneralSectionProps) => {
17
18
  const { t } = useTranslation()
18
-
19
- const overrideCount = priceList.prices?.length || 0
19
+ const {
20
+ count: overrideCount,
21
+ isLoading,
22
+ error,
23
+ } = usePriceListPrices(priceList.id, {
24
+ limit: 1,
25
+ })
20
26
 
21
27
  const { color, text } = getPriceListStatus(t, priceList)
22
28
 
@@ -77,9 +83,11 @@ export const PriceListGeneralSection = ({
77
83
  <Text leading="compact" size="small" weight="plus">
78
84
  {t("priceLists.fields.priceOverrides.label")}
79
85
  </Text>
80
- <Text size="small" className="text-pretty">
81
- {overrideCount || "-"}
82
- </Text>
86
+ {!isLoading && !error && (
87
+ <Text size="small" className="text-pretty">
88
+ {overrideCount || "-"}
89
+ </Text>
90
+ )}
83
91
  </div>
84
92
  </Container>
85
93
  )
@@ -0,0 +1,19 @@
1
+ import { usePriceListPrices } from "../../../../../hooks/api/price-lists"
2
+ import { PlaceholderCell } from "../../../../../components/table/table-cells/common/placeholder-cell"
3
+ import { TextCell } from "../../../../../components/table/table-cells/common/text-cell"
4
+
5
+ type PriceCountCellProps = {
6
+ priceListId: string
7
+ }
8
+
9
+ export const PriceCountCell = ({ priceListId }: PriceCountCellProps) => {
10
+ const { count, isLoading } = usePriceListPrices(priceListId, {
11
+ limit: 1,
12
+ })
13
+
14
+ if (isLoading) {
15
+ return <PlaceholderCell />
16
+ }
17
+
18
+ return <TextCell text={count && count > 0 ? count.toString() : "-"} />
19
+ }
@@ -4,12 +4,10 @@ import { useMemo } from "react"
4
4
  import { useTranslation } from "react-i18next"
5
5
 
6
6
  import { StatusCell } from "../../../../../components/table/table-cells/common/status-cell"
7
- import {
8
- TextCell,
9
- TextHeader,
10
- } from "../../../../../components/table/table-cells/common/text-cell"
7
+ import { TextHeader } from "../../../../../components/table/table-cells/common/text-cell"
11
8
  import { getPriceListStatus } from "../../../common/utils"
12
9
  import { PriceListListTableActions } from "./price-list-list-table-actions"
10
+ import { PriceCountCell } from "./price-count-cell"
13
11
 
14
12
  const columnHelper = createColumnHelper<HttpTypes.AdminPriceList>()
15
13
 
@@ -30,9 +28,10 @@ export const usePricingTableColumns = () => {
30
28
  return <StatusCell color={color}>{text}</StatusCell>
31
29
  },
32
30
  }),
33
- columnHelper.accessor("prices", {
31
+ columnHelper.display({
32
+ id: "price_overrides",
34
33
  header: t("priceLists.fields.priceOverrides.header"),
35
- cell: (info) => <TextCell text={`${info.getValue()?.length || "-"}`} />,
34
+ cell: ({ row }) => <PriceCountCell priceListId={row.original.id} />,
36
35
  }),
37
36
  columnHelper.display({
38
37
  id: "actions",
@@ -7,7 +7,10 @@ import { PriceListPricesAddForm } from "./components/price-list-prices-add-form"
7
7
  export const PriceListProductsAdd = () => {
8
8
  const { id } = useParams<{ id: string }>()
9
9
 
10
- const { price_list, isPending, isError, error } = usePriceList(id!)
10
+ const { price_list, isPending, isError, error } = usePriceList(id!, {
11
+ fields:
12
+ "*prices,prices.price_set.variant.id,prices.price_rules.attribute,prices.price_rules.value",
13
+ })
11
14
  const { currencies, regions, pricePreferences, isReady } =
12
15
  usePriceListCurrencyData()
13
16
 
@@ -10,7 +10,9 @@ export const PriceListPricesEdit = () => {
10
10
  const [searchParams] = useSearchParams()
11
11
  const ids = searchParams.get("ids[]")
12
12
 
13
- const { price_list, isLoading, isError, error } = usePriceList(id!)
13
+ const { price_list, isLoading, isError, error } = usePriceList(id!, {
14
+ fields: "*prices,prices.price_set.variant.id,prices.price_rules.attribute,prices.price_rules.value",
15
+ })
14
16
  const productIds = ids?.split(",")
15
17
 
16
18
  const {
@@ -5,12 +5,12 @@ import {
5
5
  _DataTable,
6
6
  useDataTable
7
7
  } from "./chunk-YTN73JYH.mjs";
8
- import {
9
- useCustomerGroupTableQuery
10
- } from "./chunk-MOSRJHJ3.mjs";
11
8
  import {
12
9
  useCustomerGroupTableFilters
13
10
  } from "./chunk-DLZWPHHO.mjs";
11
+ import {
12
+ useCustomerGroupTableQuery
13
+ } from "./chunk-MOSRJHJ3.mjs";
14
14
  import {
15
15
  StackedDrawer,
16
16
  StackedFocusModal
@@ -11,12 +11,12 @@ import {
11
11
  } from "./chunk-YTN73JYH.mjs";
12
12
  import "./chunk-HQKGZADC.mjs";
13
13
  import "./chunk-EMIHDNB7.mjs";
14
- import {
15
- useCustomerTableQuery
16
- } from "./chunk-WRSGHGAT.mjs";
17
14
  import {
18
15
  useCustomerTableFilters
19
16
  } from "./chunk-6OU4CHZI.mjs";
17
+ import {
18
+ useCustomerTableQuery
19
+ } from "./chunk-WRSGHGAT.mjs";
20
20
  import "./chunk-GU5PJRPM.mjs";
21
21
  import "./chunk-C76H5USB.mjs";
22
22
  import "./chunk-DZWH2RV6.mjs";
@@ -11,12 +11,12 @@ import {
11
11
  } from "./chunk-YTN73JYH.mjs";
12
12
  import "./chunk-HQKGZADC.mjs";
13
13
  import "./chunk-EMIHDNB7.mjs";
14
- import {
15
- useCustomerTableQuery
16
- } from "./chunk-WRSGHGAT.mjs";
17
14
  import {
18
15
  useCustomerTableFilters
19
16
  } from "./chunk-6OU4CHZI.mjs";
17
+ import {
18
+ useCustomerTableQuery
19
+ } from "./chunk-WRSGHGAT.mjs";
20
20
  import "./chunk-GU5PJRPM.mjs";
21
21
  import {
22
22
  SingleColumnPage
@@ -1,12 +1,12 @@
1
+ import {
2
+ isOptionEnabledInStore
3
+ } from "./chunk-UC26CCHZ.mjs";
1
4
  import {
2
5
  ShippingOptionPriceType
3
6
  } from "./chunk-PYIO3TDQ.mjs";
4
7
  import {
5
8
  formatProvider
6
9
  } from "./chunk-IR5DHEKS.mjs";
7
- import {
8
- isOptionEnabledInStore
9
- } from "./chunk-UC26CCHZ.mjs";
10
10
  import {
11
11
  useComboboxData
12
12
  } from "./chunk-3TZOFKX2.mjs";
@@ -14,13 +14,13 @@ import {
14
14
  } from "./chunk-YTN73JYH.mjs";
15
15
  import "./chunk-HQKGZADC.mjs";
16
16
  import "./chunk-EMIHDNB7.mjs";
17
- import {
18
- useProductTypeTableQuery
19
- } from "./chunk-TDK3JDOB.mjs";
20
17
  import {
21
18
  useProductTypeTableFilters
22
19
  } from "./chunk-CBSCX7RE.mjs";
23
20
  import "./chunk-W7625H47.mjs";
21
+ import {
22
+ useProductTypeTableQuery
23
+ } from "./chunk-TDK3JDOB.mjs";
24
24
  import "./chunk-GU5PJRPM.mjs";
25
25
  import {
26
26
  SingleColumnPage
@@ -11,12 +11,12 @@ import {
11
11
  } from "./chunk-YTN73JYH.mjs";
12
12
  import "./chunk-HQKGZADC.mjs";
13
13
  import "./chunk-EMIHDNB7.mjs";
14
- import {
15
- useRegionTableQuery
16
- } from "./chunk-XR4GEMGR.mjs";
17
14
  import {
18
15
  useRegionTableFilters
19
16
  } from "./chunk-LT4MVCA7.mjs";
17
+ import {
18
+ useRegionTableQuery
19
+ } from "./chunk-XR4GEMGR.mjs";
20
20
  import "./chunk-GU5PJRPM.mjs";
21
21
  import {
22
22
  SingleColumnPage