@medusajs/dashboard 2.10.4-snapshot-20250922090257 → 2.10.4-snapshot-20250922195925
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.
- package/dist/{add-campaign-promotions-FE4BXGVN.mjs → add-campaign-promotions-PLZXWFNV.mjs} +3 -3
- package/dist/{api-key-management-detail-SAVBCKX7.mjs → api-key-management-detail-ZQFNZNWW.mjs} +2 -1
- package/dist/app.js +2278 -1562
- package/dist/app.mjs +4 -3
- package/dist/{campaign-detail-KTOLZNTA.mjs → campaign-detail-VTCCVWKS.mjs} +5 -4
- package/dist/{categories-metadata-GXWJ3HOG.mjs → categories-metadata-FTFYPASQ.mjs} +2 -1
- package/dist/{category-detail-ENUI5EFL.mjs → category-detail-QHU2CLYA.mjs} +3 -2
- package/dist/{category-products-ZG5QDWSW.mjs → category-products-YGTL7GXQ.mjs} +3 -2
- package/dist/{chunk-S45XMWVD.mjs → chunk-5CE3JPWD.mjs} +1 -1
- package/dist/{chunk-JHXKKOHO.mjs → chunk-6V6KATTW.mjs} +33 -10
- package/dist/{chunk-5WKYR6PY.mjs → chunk-BM5ZIV5V.mjs} +1 -1
- package/dist/{chunk-OGHQ6VJI.mjs → chunk-BSBCIU6C.mjs} +0 -5
- package/dist/{chunk-NRBOPOMS.mjs → chunk-CU5EFQSB.mjs} +1 -1
- package/dist/{chunk-KMUDF36P.mjs → chunk-FTVAORQM.mjs} +1 -1
- package/dist/{chunk-GB7CZNXI.mjs → chunk-JO6QASTJ.mjs} +1 -1
- package/dist/{chunk-OKMF4YI7.mjs → chunk-K3OMOMRB.mjs} +25 -0
- package/dist/{chunk-LAWIWR7K.mjs → chunk-PHXKD2LR.mjs} +1 -1
- package/dist/{chunk-JELVERJM.mjs → chunk-PPI7PTY6.mjs} +31 -0
- package/dist/{chunk-6AGMMT5H.mjs → chunk-VE7JFMAN.mjs} +2 -2
- package/dist/{chunk-IRJKUFJU.mjs → chunk-WYDDFRYM.mjs} +130 -98
- package/dist/{chunk-7YZF3THS.mjs → chunk-XTNS2NRD.mjs} +1 -1
- package/dist/{chunk-Y4YXZY7R.mjs → chunk-YPDTZXV6.mjs} +1 -1
- package/dist/chunk-YZJ3W776.mjs +87 -0
- package/dist/{collection-add-products-2ISNNIHD.mjs → collection-add-products-OJ2EZLC7.mjs} +3 -2
- package/dist/{collection-detail-OSX6NHNQ.mjs → collection-detail-RMZK523E.mjs} +3 -2
- package/dist/{collection-list-MPIYSHQJ.mjs → collection-list-BJ3VNZAA.mjs} +4 -3
- package/dist/{collection-metadata-EOFYXEQI.mjs → collection-metadata-R3DI65D3.mjs} +2 -1
- package/dist/{customer-detail-FCNRRZSW.mjs → customer-detail-G7G6PYOO.mjs} +2 -1
- package/dist/{customer-group-detail-QI3QLJJL.mjs → customer-group-detail-XQ32DPQ3.mjs} +2 -1
- package/dist/{customer-group-list-GPIKR66X.mjs → customer-group-list-CARES5CM.mjs} +2 -1
- package/dist/{customers-add-customer-group-5TFTVDB6.mjs → customers-add-customer-group-NLPVKARS.mjs} +2 -1
- package/dist/{edit-rules-63NG4QVR.mjs → edit-rules-JRLCVE26.mjs} +2 -1
- package/dist/{inventory-create-RIVJFJJQ.mjs → inventory-create-ZC6HV2FY.mjs} +2 -1
- package/dist/{inventory-detail-5433AAQ2.mjs → inventory-detail-WVI4FTTH.mjs} +2 -1
- package/dist/{inventory-metadata-FH4CHJBA.mjs → inventory-metadata-BLIJBNQS.mjs} +2 -1
- package/dist/{inventory-stock-D6E4LQRK.mjs → inventory-stock-ZCTXWRK6.mjs} +2 -1
- package/dist/{location-detail-Z6ZDX6RY.mjs → location-detail-GV3POY4C.mjs} +2 -1
- package/dist/{location-fulfillment-providers-45VXZMZI.mjs → location-fulfillment-providers-INUQXJYU.mjs} +3 -2
- package/dist/{location-service-zone-shipping-option-create-NO3665DC.mjs → location-service-zone-shipping-option-create-6KO3QDMQ.mjs} +2 -1
- package/dist/{login-DSPNELTI.mjs → login-57FIKGXA.mjs} +2 -1
- package/dist/{order-create-claim-V63BWLB5.mjs → order-create-claim-LXKBCAWN.mjs} +2 -1
- package/dist/{order-create-edit-NPF4UZ4D.mjs → order-create-edit-264PTIEI.mjs} +2 -1
- package/dist/{order-create-exchange-RHIPPSKU.mjs → order-create-exchange-ZMUVPYM3.mjs} +2 -1
- package/dist/{order-create-fulfillment-4SSUHQ75.mjs → order-create-fulfillment-LE6O3SA5.mjs} +2 -1
- package/dist/{order-create-refund-QVQC5ZP5.mjs → order-create-refund-B7BO2EJL.mjs} +2 -1
- package/dist/{order-create-shipment-TJAARKWA.mjs → order-create-shipment-UOPCS5N7.mjs} +2 -1
- package/dist/{order-detail-2MIN6B2I.mjs → order-detail-SG7AXBRS.mjs} +2 -1
- package/dist/{order-edit-billing-address-QP2I5F3E.mjs → order-edit-billing-address-RPPJ4Z36.mjs} +2 -1
- package/dist/{order-edit-email-7WT7XTHB.mjs → order-edit-email-A7D5HTU6.mjs} +2 -1
- package/dist/{order-edit-shipping-address-3QFMQP4I.mjs → order-edit-shipping-address-LXKC5CJE.mjs} +2 -1
- package/dist/{order-list-7S3N6H5A.mjs → order-list-ZCMNSZYB.mjs} +1 -1
- package/dist/{order-metadata-YJS26DHK.mjs → order-metadata-KS47UOEE.mjs} +2 -1
- package/dist/{order-receive-return-PZMMMUB2.mjs → order-receive-return-PDU2YVLT.mjs} +2 -1
- package/dist/{order-request-transfer-QBIZD36E.mjs → order-request-transfer-WMQKDLDF.mjs} +2 -1
- package/dist/{price-list-create-RXDH5CXF.mjs → price-list-create-QZSB4W5Z.mjs} +3 -2
- package/dist/{price-list-detail-PKIKOJ4H.mjs → price-list-detail-2FMINPFT.mjs} +3 -2
- package/dist/{price-list-prices-add-2CDPUSYA.mjs → price-list-prices-add-WYK2QBAI.mjs} +3 -2
- package/dist/{product-attributes-LVV3K24U.mjs → product-attributes-KDXI2RNP.mjs} +5 -4
- package/dist/{product-create-HQORHMCM.mjs → product-create-TVYPK4VC.mjs} +5 -4
- package/dist/{product-create-variant-KJKQ6ROY.mjs → product-create-variant-6YWLDA2X.mjs} +2 -1
- package/dist/{product-detail-UROTMCRL.mjs → product-detail-RFKXMYE5.mjs} +5 -4
- package/dist/{product-edit-4EVIUVKV.mjs → product-edit-5FNY7HG4.mjs} +5 -4
- package/dist/{product-export-XERWEI5H.mjs → product-export-BEAUMFAZ.mjs} +3 -2
- package/dist/{product-import-AGFJMSVK.mjs → product-import-SOX4UJPM.mjs} +2 -1
- package/dist/{product-list-3B742YCJ.mjs → product-list-ZVXATJRE.mjs} +4 -3
- package/dist/{product-media-APQKPFTT.mjs → product-media-JPU23SPH.mjs} +2 -2
- package/dist/{product-metadata-NZ3HKO67.mjs → product-metadata-QRRCHZZB.mjs} +2 -1
- package/dist/{product-organization-YQUIMUYX.mjs → product-organization-QTWB7VMB.mjs} +5 -4
- package/dist/{product-shipping-profile-FRIMAOZQ.mjs → product-shipping-profile-Q6UX6ZNJ.mjs} +5 -4
- package/dist/{product-stock-SUVEQZML.mjs → product-stock-TSAIHVY6.mjs} +2 -1
- package/dist/{product-tag-create-T6HVAQKN.mjs → product-tag-create-5NZJS2D2.mjs} +2 -1
- package/dist/{product-tag-detail-HOWUZC3P.mjs → product-tag-detail-3XHUROBO.mjs} +6 -5
- package/dist/{product-tag-edit-WWQDNDRC.mjs → product-tag-edit-YYOOHKGG.mjs} +2 -1
- package/dist/{product-tag-list-FAKSLONF.mjs → product-tag-list-5XTTMNOA.mjs} +6 -5
- package/dist/{product-tag-metadata-6B56VEZU.mjs → product-tag-metadata-YAD3MPWF.mjs} +2 -1
- package/dist/{product-type-detail-KN64HYUV.mjs → product-type-detail-MNTAHQKJ.mjs} +3 -2
- package/dist/{product-type-metadata-F3FTI6OG.mjs → product-type-metadata-HWR3WBGT.mjs} +2 -1
- package/dist/{product-variant-detail-OUHBUY4J.mjs → product-variant-detail-DKFAG3KO.mjs} +2 -1
- package/dist/{product-variant-edit-NBYHDUJ5.mjs → product-variant-edit-EZENYVAN.mjs} +2 -1
- package/dist/{product-variant-metadata-XDVLJYGQ.mjs → product-variant-metadata-S7QENSUG.mjs} +2 -1
- package/dist/{promotion-create-UUOG52D5.mjs → promotion-create-O3KUSPIU.mjs} +2 -1
- package/dist/{promotion-detail-6ZD7Z6BF.mjs → promotion-detail-5DU6ULJG.mjs} +4 -3
- package/dist/{promotion-list-GI64LDWI.mjs → promotion-list-Q2FOGORE.mjs} +3 -3
- package/dist/refund-reason-create-NSZFGXWI.mjs +158 -0
- package/dist/refund-reason-edit-RKUSPQCL.mjs +144 -0
- package/dist/refund-reason-list-2F5PFERT.mjs +273 -0
- package/dist/{region-metadata-IQVB4ERU.mjs → region-metadata-G3JH5ZN6.mjs} +2 -1
- package/dist/{reservation-detail-RTGHD35L.mjs → reservation-detail-PJXS67UM.mjs} +2 -1
- package/dist/{reservation-metadata-WKJXBRLQ.mjs → reservation-metadata-UCKQB66O.mjs} +2 -1
- package/dist/{reset-password-SXA6YKTJ.mjs → reset-password-5KIEBJHN.mjs} +1 -1
- package/dist/{return-reason-list-MOP7YWMZ.mjs → return-reason-list-OGFYWMC5.mjs} +2 -2
- package/dist/{sales-channel-add-products-OKVZJ6FI.mjs → sales-channel-add-products-CSMNFGHD.mjs} +3 -2
- package/dist/{sales-channel-detail-WESBK6Q7.mjs → sales-channel-detail-ZSA3HNWW.mjs} +3 -2
- package/dist/{sales-channel-list-ADIJMXNV.mjs → sales-channel-list-X5ADP34V.mjs} +2 -1
- package/dist/{sales-channel-metadata-2OQAHYB4.mjs → sales-channel-metadata-ABWIDI3B.mjs} +2 -1
- package/dist/{shipping-option-type-create-3CGPGDYJ.mjs → shipping-option-type-create-Q2X5OMJS.mjs} +2 -1
- package/dist/{shipping-option-type-detail-S23H2OGW.mjs → shipping-option-type-detail-VT3Y5QQ4.mjs} +3 -2
- package/dist/{shipping-option-type-edit-IHE7XM6M.mjs → shipping-option-type-edit-IA3EER2N.mjs} +2 -1
- package/dist/{shipping-option-type-list-47GRJ6EC.mjs → shipping-option-type-list-JZPKAL3H.mjs} +3 -2
- package/dist/{shipping-profile-metadata-OXWOXAAR.mjs → shipping-profile-metadata-EYXBWBF2.mjs} +2 -1
- package/dist/{store-detail-4K7TW2TP.mjs → store-detail-LI72QMUZ.mjs} +2 -1
- package/dist/{store-metadata-JP2CI7EF.mjs → store-metadata-ZITLAS5H.mjs} +2 -1
- package/dist/{tax-region-create-W3K5IFD3.mjs → tax-region-create-IU2R5VIY.mjs} +3 -2
- package/dist/{tax-region-detail-V2F2DONN.mjs → tax-region-detail-6FHD35LB.mjs} +2 -1
- package/dist/{tax-region-edit-CJPMYTBF.mjs → tax-region-edit-O2WJXYIE.mjs} +2 -1
- package/dist/{tax-region-province-detail-4PUQ5ADW.mjs → tax-region-province-detail-YDBU4CUU.mjs} +2 -1
- package/dist/{tax-region-tax-override-create-3SCIOK4P.mjs → tax-region-tax-override-create-EF3LLZWM.mjs} +6 -5
- package/dist/{tax-region-tax-override-edit-P3QJKET3.mjs → tax-region-tax-override-edit-2DG3J6CO.mjs} +6 -5
- package/dist/{user-metadata-ZURLDLGC.mjs → user-metadata-QUIFIM5G.mjs} +2 -1
- package/dist/{workflow-execution-detail-4R6AFFHV.mjs → workflow-execution-detail-PVSQ2VGE.mjs} +2 -1
- package/package.json +9 -9
- package/src/components/layout/settings-layout/settings-layout.tsx +4 -0
- package/src/dashboard-app/routes/get-route.map.tsx +36 -0
- package/src/hooks/api/refund-reasons.tsx +113 -9
- package/src/hooks/table/columns/index.ts +1 -0
- package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +28 -0
- package/src/hooks/table/query/index.ts +1 -0
- package/src/hooks/table/query/use-refund-reason-table-query.tsx +32 -0
- package/src/hooks/table/use-table-configuration.tsx +1 -1
- package/src/i18n/translations/$schema.json +181 -65
- package/src/i18n/translations/en.json +31 -0
- package/src/routes/refund-reasons/common/hooks/use-delete-refund-reason-action.tsx +34 -0
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +131 -0
- package/src/routes/refund-reasons/refund-reason-create/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +10 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +119 -0
- package/src/routes/refund-reasons/refund-reason-edit/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +33 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +131 -0
- package/src/routes/refund-reasons/refund-reason-list/index.ts +2 -0
- package/src/routes/refund-reasons/refund-reason-list/loader.ts +16 -0
- package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +21 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
import { PencilSquare, Trash } from "@medusajs/icons"
|
2
|
+
import { HttpTypes } from "@medusajs/types"
|
3
|
+
import { Button, Container, Heading, Text } from "@medusajs/ui"
|
4
|
+
import { keepPreviousData } from "@tanstack/react-query"
|
5
|
+
import { createColumnHelper } from "@tanstack/react-table"
|
6
|
+
import { useMemo } from "react"
|
7
|
+
import { useTranslation } from "react-i18next"
|
8
|
+
import { Link } from "react-router-dom"
|
9
|
+
|
10
|
+
import { ActionMenu } from "../../../../../components/common/action-menu"
|
11
|
+
import { _DataTable } from "../../../../../components/table/data-table"
|
12
|
+
import { useRefundReasons } from "../../../../../hooks/api"
|
13
|
+
import { useRefundReasonTableColumns } from "../../../../../hooks/table/columns"
|
14
|
+
import { useRefundReasonTableQuery } from "../../../../../hooks/table/query"
|
15
|
+
import { useDataTable } from "../../../../../hooks/use-data-table"
|
16
|
+
import { useDeleteRefundReasonAction } from "../../../common/hooks/use-delete-refund-reason-action"
|
17
|
+
|
18
|
+
const PAGE_SIZE = 20
|
19
|
+
|
20
|
+
export const RefundReasonListTable = () => {
|
21
|
+
const { t } = useTranslation()
|
22
|
+
const { searchParams, raw } = useRefundReasonTableQuery({
|
23
|
+
pageSize: PAGE_SIZE,
|
24
|
+
})
|
25
|
+
|
26
|
+
const { refund_reasons, count, isPending, isError, error } = useRefundReasons(
|
27
|
+
searchParams,
|
28
|
+
{
|
29
|
+
placeholderData: keepPreviousData,
|
30
|
+
}
|
31
|
+
)
|
32
|
+
|
33
|
+
const columns = useColumns()
|
34
|
+
|
35
|
+
const { table } = useDataTable({
|
36
|
+
data: refund_reasons,
|
37
|
+
columns,
|
38
|
+
count,
|
39
|
+
getRowId: (row) => row.id,
|
40
|
+
pageSize: PAGE_SIZE,
|
41
|
+
})
|
42
|
+
|
43
|
+
if (isError) {
|
44
|
+
throw error
|
45
|
+
}
|
46
|
+
|
47
|
+
return (
|
48
|
+
<Container className="divide-y px-0 py-0">
|
49
|
+
<div className="flex items-center justify-between px-6 py-4">
|
50
|
+
<div>
|
51
|
+
<Heading>{t("refundReasons.domain")}</Heading>
|
52
|
+
<Text className="text-ui-fg-subtle" size="small">
|
53
|
+
{t("refundReasons.subtitle")}
|
54
|
+
</Text>
|
55
|
+
</div>
|
56
|
+
<Button variant="secondary" size="small" asChild>
|
57
|
+
<Link to="create">{t("actions.create")}</Link>
|
58
|
+
</Button>
|
59
|
+
</div>
|
60
|
+
<_DataTable
|
61
|
+
table={table}
|
62
|
+
queryObject={raw}
|
63
|
+
count={count}
|
64
|
+
isLoading={isPending}
|
65
|
+
columns={columns}
|
66
|
+
pageSize={PAGE_SIZE}
|
67
|
+
noHeader={true}
|
68
|
+
pagination
|
69
|
+
search
|
70
|
+
/>
|
71
|
+
</Container>
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
type RefundReasonRowActionsProps = {
|
76
|
+
refundReason: HttpTypes.AdminRefundReason
|
77
|
+
}
|
78
|
+
|
79
|
+
const RefundReasonRowActions = ({
|
80
|
+
refundReason,
|
81
|
+
}: RefundReasonRowActionsProps) => {
|
82
|
+
const { t } = useTranslation()
|
83
|
+
const handleDelete = useDeleteRefundReasonAction(
|
84
|
+
refundReason.id,
|
85
|
+
refundReason.label
|
86
|
+
)
|
87
|
+
|
88
|
+
return (
|
89
|
+
<ActionMenu
|
90
|
+
groups={[
|
91
|
+
{
|
92
|
+
actions: [
|
93
|
+
{
|
94
|
+
icon: <PencilSquare />,
|
95
|
+
label: t("actions.edit"),
|
96
|
+
to: `${refundReason.id}/edit`,
|
97
|
+
},
|
98
|
+
],
|
99
|
+
},
|
100
|
+
{
|
101
|
+
actions: [
|
102
|
+
{
|
103
|
+
icon: <Trash />,
|
104
|
+
label: t("actions.delete"),
|
105
|
+
onClick: handleDelete,
|
106
|
+
},
|
107
|
+
],
|
108
|
+
},
|
109
|
+
]}
|
110
|
+
/>
|
111
|
+
)
|
112
|
+
}
|
113
|
+
|
114
|
+
const columnHelper = createColumnHelper<HttpTypes.AdminRefundReason>()
|
115
|
+
|
116
|
+
const useColumns = () => {
|
117
|
+
const base = useRefundReasonTableColumns()
|
118
|
+
|
119
|
+
return useMemo(
|
120
|
+
() => [
|
121
|
+
...base,
|
122
|
+
columnHelper.display({
|
123
|
+
id: "actions",
|
124
|
+
cell: ({ row }) => (
|
125
|
+
<RefundReasonRowActions refundReason={row.original} />
|
126
|
+
),
|
127
|
+
}),
|
128
|
+
],
|
129
|
+
[base]
|
130
|
+
)
|
131
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { refundReasonsQueryKeys } from "../../../hooks/api"
|
2
|
+
import { sdk } from "../../../lib/client"
|
3
|
+
import { queryClient } from "../../../lib/query-client"
|
4
|
+
|
5
|
+
const refundReasonListQuery = () => ({
|
6
|
+
queryKey: refundReasonsQueryKeys.list(),
|
7
|
+
queryFn: async () => sdk.admin.refundReason.list(),
|
8
|
+
})
|
9
|
+
|
10
|
+
export const refundReasonListLoader = async () => {
|
11
|
+
const query = refundReasonListQuery()
|
12
|
+
return (
|
13
|
+
queryClient.getQueryData(query.queryKey) ??
|
14
|
+
(await queryClient.fetchQuery(query))
|
15
|
+
)
|
16
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { SingleColumnPage } from "../../../components/layout/pages"
|
2
|
+
import { useExtension } from "../../../providers/extension-provider"
|
3
|
+
import { RefundReasonListTable } from "./components/refund-reason-list-table"
|
4
|
+
|
5
|
+
export const RefundReasonList = () => {
|
6
|
+
const { getWidgets } = useExtension()
|
7
|
+
|
8
|
+
return (
|
9
|
+
<SingleColumnPage
|
10
|
+
showMetadata={false}
|
11
|
+
showJSON={false}
|
12
|
+
hasOutlet
|
13
|
+
widgets={{
|
14
|
+
after: getWidgets("refund_reason.list.after"),
|
15
|
+
before: getWidgets("refund_reason.list.before"),
|
16
|
+
}}
|
17
|
+
>
|
18
|
+
<RefundReasonListTable />
|
19
|
+
</SingleColumnPage>
|
20
|
+
)
|
21
|
+
}
|