@mercurjs/admin 2.1.0 → 2.1.2-canary.0
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-WILFAFL4.js → add-campaign-promotions-VFBNY77C.js} +3 -3
- package/dist/{campaign-detail-S44LA6AX.js → campaign-detail-WDVAIMV4.js} +4 -4
- package/dist/{chunk-OVB4R5U5.js → chunk-2MNDOYVE.js} +3 -2
- package/dist/{chunk-WX6UWXY6.js → chunk-4HM6UJND.js} +2 -2
- package/dist/{chunk-ZEBQKDHR.js → chunk-4IRXP337.js} +1 -1
- package/dist/{chunk-7IKRJNID.js → chunk-6GLU4R7W.js} +1 -1
- package/dist/{chunk-NSUWKSBC.js → chunk-B2FKWBHU.js} +1 -1
- package/dist/{chunk-TVL4IXSL.js → chunk-BURG4MO3.js} +8 -8
- package/dist/{chunk-H55UROTU.js → chunk-CAXRMI6M.js} +1 -1
- package/dist/{chunk-BAJODL3V.js → chunk-GIU72QEP.js} +1 -1
- package/dist/{chunk-Z433IE4R.js → chunk-KFGOJI3P.js} +1 -1
- package/dist/{chunk-3U4C3UKN.js → chunk-LK4A7SJK.js} +1 -1
- package/dist/{chunk-5Q2DL7Z2.js → chunk-LZ6FY5SF.js} +1 -1
- package/dist/{chunk-3TOCWPCQ.js → chunk-NNCIV74Y.js} +5 -5
- package/dist/{chunk-YJNCEGX4.js → chunk-QOQSXNEF.js} +3 -1
- package/dist/{chunk-LET54CD5.js → chunk-QZBAACYC.js} +3 -2
- package/dist/{chunk-P5VTTPU2.js → chunk-UEFWVPQ7.js} +1 -1
- package/dist/{chunk-PJSWOWXT.js → chunk-UYDKJWYX.js} +539 -10
- package/dist/{chunk-NEAMPCCU.js → chunk-VBJFCAKU.js} +20 -11
- package/dist/{chunk-DSIZONVE.js → chunk-XZYRXNWO.js} +3 -1
- package/dist/{chunk-SMPTZ2RM.js → chunk-Y3I3LXKW.js} +24 -15
- package/dist/{commission-rate-create-CUSB36XK.js → commission-rate-create-AIT5K74P.js} +20 -20
- package/dist/{commission-rate-detail-7I4M7GOE.js → commission-rate-detail-D5WUXKER.js} +1 -1
- package/dist/{commission-rate-edit-KPY5EXDK.js → commission-rate-edit-EJ2SQKUP.js} +18 -16
- package/dist/{commission-rate-list-CFKHN2F5.js → commission-rate-list-TFMQC26F.js} +1 -1
- package/dist/index.js +34 -34
- package/dist/{order-detail-PSJFXQV7.js → order-detail-SFIBIQTI.js} +1 -1
- package/dist/{order-edit-billing-address-2WTUR5PX.js → order-edit-billing-address-6J5NMUDG.js} +1 -1
- package/dist/{order-list-DEFD5MI5.js → order-list-CAR3CH7Q.js} +1 -1
- package/dist/pages/index.js +19 -19
- package/dist/{payout-detail-C5WLFRRT.js → payout-detail-DZFTTDUR.js} +1 -1
- package/dist/{payout-list-WQIMALHI.js → payout-list-75YIMPCS.js} +1 -1
- package/dist/{product-create-WVC72ZZ2.js → product-create-5ZHAR523.js} +3 -3
- package/dist/{product-detail-7T5PLGCJ.js → product-detail-XXA3V6V3.js} +2 -2
- package/dist/{product-list-G23MTE7S.js → product-list-XXSHUGNI.js} +1 -1
- package/dist/{product-media-CBKZEHLD.js → product-media-BVK62TOR.js} +2 -2
- package/dist/{product-variant-detail-7UVACNQV.js → product-variant-detail-T2OM45NJ.js} +2 -2
- package/dist/{promotion-detail-6ZCWQYON.js → promotion-detail-FO635PUU.js} +3 -3
- package/dist/{promotion-list-ZARTSDFP.js → promotion-list-QXWQMUWX.js} +4 -4
- package/dist/{reset-password-J4XCWJXV.js → reset-password-454BEKIQ.js} +1 -1
- package/dist/{store-edit-U2Q6LMXR.js → store-edit-OZSRUCSA.js} +2 -2
- package/dist/{store-list-CWVEPRJM.js → store-list-AVI5EOS6.js} +1 -1
- package/dist/{tax-region-create-CQCW6ELU.js → tax-region-create-CAB4LLPE.js} +1 -1
- package/package.json +3 -3
|
@@ -74,7 +74,7 @@ var CommissionRateListDataTable = () => {
|
|
|
74
74
|
pagination: true,
|
|
75
75
|
search: true,
|
|
76
76
|
orderBy: [
|
|
77
|
-
{ key: "name", label: "
|
|
77
|
+
{ key: "name", label: t("commissionRates.fields.name") },
|
|
78
78
|
{ key: "created_at", label: t("fields.createdAt") },
|
|
79
79
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
80
80
|
]
|
|
@@ -90,7 +90,9 @@ var CommissionRateActions = ({
|
|
|
90
90
|
const handleDelete = async () => {
|
|
91
91
|
const res = await prompt({
|
|
92
92
|
title: t("general.areYouSure"),
|
|
93
|
-
description:
|
|
93
|
+
description: t("commissionRates.delete.description", {
|
|
94
|
+
name: commissionRate.name
|
|
95
|
+
}),
|
|
94
96
|
confirmText: t("actions.delete"),
|
|
95
97
|
cancelText: t("actions.cancel")
|
|
96
98
|
});
|
|
@@ -99,7 +101,7 @@ var CommissionRateActions = ({
|
|
|
99
101
|
}
|
|
100
102
|
await mutateAsync(void 0, {
|
|
101
103
|
onSuccess: () => {
|
|
102
|
-
toast.success("
|
|
104
|
+
toast.success(t("commissionRates.delete.successToast"));
|
|
103
105
|
},
|
|
104
106
|
onError: (e) => {
|
|
105
107
|
toast.error(e.message);
|
|
@@ -134,24 +136,30 @@ var CommissionRateActions = ({
|
|
|
134
136
|
};
|
|
135
137
|
var columnHelper = createColumnHelper();
|
|
136
138
|
var useColumns = () => {
|
|
139
|
+
const { t } = useTranslation();
|
|
137
140
|
return useMemo(
|
|
138
141
|
() => [
|
|
139
142
|
columnHelper.accessor("code", {
|
|
140
|
-
header: "
|
|
143
|
+
header: t("commissionRates.fields.code"),
|
|
141
144
|
cell: ({ getValue }) => /* @__PURE__ */ jsx(Badge, { size: "2xsmall", className: "uppercase", children: getValue() })
|
|
142
145
|
}),
|
|
143
146
|
columnHelper.accessor("type", {
|
|
144
|
-
header: () => /* @__PURE__ */ jsx(TextHeader, { text: "
|
|
147
|
+
header: () => /* @__PURE__ */ jsx(TextHeader, { text: t("commissionRates.fields.type.label") }),
|
|
145
148
|
cell: ({ getValue }) => {
|
|
146
149
|
const type = getValue();
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
151
|
+
TextCell,
|
|
152
|
+
{
|
|
153
|
+
text: type === "percentage" ? t("commissionRates.fields.type.percentage") : t("commissionRates.fields.type.fixed")
|
|
154
|
+
}
|
|
155
|
+
);
|
|
148
156
|
}
|
|
149
157
|
}),
|
|
150
158
|
columnHelper.accessor("is_enabled", {
|
|
151
|
-
header: "
|
|
159
|
+
header: t("fields.status"),
|
|
152
160
|
cell: ({ getValue }) => {
|
|
153
161
|
const enabled = getValue();
|
|
154
|
-
return /* @__PURE__ */ jsx(StatusBadge, { color: enabled ? "green" : "grey", children: enabled ? "
|
|
162
|
+
return /* @__PURE__ */ jsx(StatusBadge, { color: enabled ? "green" : "grey", children: enabled ? t("commissionRates.status.enabled") : t("commissionRates.status.disabled") });
|
|
155
163
|
}
|
|
156
164
|
}),
|
|
157
165
|
columnHelper.display({
|
|
@@ -159,7 +167,7 @@ var useColumns = () => {
|
|
|
159
167
|
cell: ({ row }) => /* @__PURE__ */ jsx(CommissionRateActions, { commissionRate: row.original })
|
|
160
168
|
})
|
|
161
169
|
],
|
|
162
|
-
[]
|
|
170
|
+
[t]
|
|
163
171
|
);
|
|
164
172
|
};
|
|
165
173
|
|
|
@@ -170,9 +178,10 @@ import { useTranslation as useTranslation2 } from "react-i18next";
|
|
|
170
178
|
import { Link } from "react-router-dom";
|
|
171
179
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
172
180
|
var CommissionRateListTitle = () => {
|
|
181
|
+
const { t } = useTranslation2();
|
|
173
182
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
174
|
-
/* @__PURE__ */ jsx2(Heading, { children: "
|
|
175
|
-
/* @__PURE__ */ jsx2(Text, { className: "text-ui-fg-subtle", size: "small", children: "
|
|
183
|
+
/* @__PURE__ */ jsx2(Heading, { children: t("commissionRates.domain") }),
|
|
184
|
+
/* @__PURE__ */ jsx2(Text, { className: "text-ui-fg-subtle", size: "small", children: t("commissionRates.description") })
|
|
176
185
|
] });
|
|
177
186
|
};
|
|
178
187
|
var CommissionRateListActions = ({
|
|
@@ -36,7 +36,9 @@ var payoutStatusColor = (status) => {
|
|
|
36
36
|
};
|
|
37
37
|
var PayoutGeneralSection = ({ payout }) => {
|
|
38
38
|
const { t } = useTranslation();
|
|
39
|
-
const statusText =
|
|
39
|
+
const statusText = t(`payouts.status.${payout.status}`, {
|
|
40
|
+
defaultValue: payout.status.charAt(0).toUpperCase() + payout.status.slice(1)
|
|
41
|
+
});
|
|
40
42
|
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
41
43
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
42
44
|
/* @__PURE__ */ jsxs(Heading, { children: [
|
|
@@ -38,6 +38,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
38
38
|
var CommissionRateGeneralSection = ({
|
|
39
39
|
commissionRate
|
|
40
40
|
}) => {
|
|
41
|
+
const { t } = useTranslation();
|
|
41
42
|
const formatValue = () => {
|
|
42
43
|
if (commissionRate.type === "percentage") {
|
|
43
44
|
return `${commissionRate.value}%`;
|
|
@@ -48,51 +49,57 @@ var CommissionRateGeneralSection = ({
|
|
|
48
49
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
49
50
|
/* @__PURE__ */ jsx(Heading, { children: commissionRate.name }),
|
|
50
51
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
51
|
-
/* @__PURE__ */ jsx(StatusBadge, { color: commissionRate.is_enabled ? "green" : "grey", children: commissionRate.is_enabled ? "
|
|
52
|
+
/* @__PURE__ */ jsx(StatusBadge, { color: commissionRate.is_enabled ? "green" : "grey", children: commissionRate.is_enabled ? t("commissionRates.status.enabled") : t("commissionRates.status.disabled") }),
|
|
52
53
|
/* @__PURE__ */ jsx(CommissionRateActions, { commissionRate })
|
|
53
54
|
] })
|
|
54
55
|
] }),
|
|
55
56
|
/* @__PURE__ */ jsx(
|
|
56
57
|
SectionRow,
|
|
57
58
|
{
|
|
58
|
-
title: "
|
|
59
|
+
title: t("commissionRates.fields.code"),
|
|
59
60
|
value: /* @__PURE__ */ jsx(Badge, { size: "2xsmall", className: "uppercase", children: commissionRate.code })
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
63
|
/* @__PURE__ */ jsx(
|
|
63
64
|
SectionRow,
|
|
64
65
|
{
|
|
65
|
-
title: "
|
|
66
|
+
title: t("commissionRates.fields.type.label"),
|
|
66
67
|
value: /* @__PURE__ */ jsx(
|
|
67
68
|
Badge,
|
|
68
69
|
{
|
|
69
70
|
size: "2xsmall",
|
|
70
71
|
color: commissionRate.type === "percentage" ? "blue" : "grey",
|
|
71
|
-
children: commissionRate.type === "percentage" ? "
|
|
72
|
+
children: commissionRate.type === "percentage" ? t("commissionRates.fields.type.percentage") : t("commissionRates.fields.type.fixed")
|
|
72
73
|
}
|
|
73
74
|
)
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
|
-
/* @__PURE__ */ jsx(SectionRow, { title: "
|
|
77
|
+
/* @__PURE__ */ jsx(SectionRow, { title: t("fields.value"), value: formatValue() }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
SectionRow,
|
|
80
|
+
{
|
|
81
|
+
title: t("commissionRates.fields.target.label"),
|
|
82
|
+
value: commissionRate.target === "item" ? t("commissionRates.fields.target.item") : t("commissionRates.fields.target.shipping")
|
|
83
|
+
}
|
|
84
|
+
),
|
|
77
85
|
/* @__PURE__ */ jsx(
|
|
78
86
|
SectionRow,
|
|
79
87
|
{
|
|
80
|
-
title: "
|
|
81
|
-
value: commissionRate.
|
|
88
|
+
title: t("commissionRates.fields.includeTax"),
|
|
89
|
+
value: commissionRate.include_tax ? t("general.yes") : t("general.no")
|
|
82
90
|
}
|
|
83
91
|
),
|
|
84
92
|
/* @__PURE__ */ jsx(
|
|
85
93
|
SectionRow,
|
|
86
94
|
{
|
|
87
|
-
title: "
|
|
88
|
-
value: commissionRate.
|
|
95
|
+
title: t("commissionRates.fields.priority"),
|
|
96
|
+
value: String(commissionRate.priority)
|
|
89
97
|
}
|
|
90
98
|
),
|
|
91
|
-
/* @__PURE__ */ jsx(SectionRow, { title: "Priority", value: String(commissionRate.priority) }),
|
|
92
99
|
commissionRate.min_amount != null && /* @__PURE__ */ jsx(
|
|
93
100
|
SectionRow,
|
|
94
101
|
{
|
|
95
|
-
title: "
|
|
102
|
+
title: t("commissionRates.fields.minAmount"),
|
|
96
103
|
value: commissionRate.currency_code ? `${commissionRate.min_amount} ${commissionRate.currency_code.toUpperCase()}` : String(commissionRate.min_amount)
|
|
97
104
|
}
|
|
98
105
|
)
|
|
@@ -113,7 +120,7 @@ var CommissionRateActions = ({
|
|
|
113
120
|
{
|
|
114
121
|
onSuccess: () => {
|
|
115
122
|
toast.success(
|
|
116
|
-
newEnabled ? "
|
|
123
|
+
newEnabled ? t("commissionRates.toggle.enabledToast") : t("commissionRates.toggle.disabledToast")
|
|
117
124
|
);
|
|
118
125
|
},
|
|
119
126
|
onError: (e) => {
|
|
@@ -125,7 +132,9 @@ var CommissionRateActions = ({
|
|
|
125
132
|
const handleDelete = async () => {
|
|
126
133
|
const res = await prompt({
|
|
127
134
|
title: t("general.areYouSure"),
|
|
128
|
-
description:
|
|
135
|
+
description: t("commissionRates.delete.description", {
|
|
136
|
+
name: commissionRate.name
|
|
137
|
+
}),
|
|
129
138
|
confirmText: t("actions.delete"),
|
|
130
139
|
cancelText: t("actions.cancel")
|
|
131
140
|
});
|
|
@@ -134,7 +143,7 @@ var CommissionRateActions = ({
|
|
|
134
143
|
}
|
|
135
144
|
await mutateAsync(void 0, {
|
|
136
145
|
onSuccess: () => {
|
|
137
|
-
toast.success("
|
|
146
|
+
toast.success(t("commissionRates.delete.successToast"));
|
|
138
147
|
navigate("/settings/commission-rates", { replace: true });
|
|
139
148
|
},
|
|
140
149
|
onError: (e) => {
|
|
@@ -203,7 +212,7 @@ var CommissionRateRulesSection = ({
|
|
|
203
212
|
const entries = Object.entries(groupedRules);
|
|
204
213
|
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
205
214
|
/* @__PURE__ */ jsx2("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx2(Heading2, { level: "h2", children: t("taxRegions.fields.targets.label") }) }),
|
|
206
|
-
entries.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-center px-6 py-8", children: /* @__PURE__ */ jsx2(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
215
|
+
entries.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-center px-6 py-8", children: /* @__PURE__ */ jsx2(Text, { size: "small", className: "text-ui-fg-subtle", children: t("commissionRates.rules.empty") }) }) : /* @__PURE__ */ jsx2("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-3", children: [
|
|
207
216
|
/* @__PURE__ */ jsx2("div", { className: "text-ui-fg-muted flex size-5 items-center justify-center", children: /* @__PURE__ */ jsx2(ArrowDownRightMini, {}) }),
|
|
208
217
|
/* @__PURE__ */ jsxs2("div", { className: "flex flex-wrap items-center gap-x-1.5 gap-y-2", children: [
|
|
209
218
|
/* @__PURE__ */ jsx2(
|
|
@@ -242,7 +242,7 @@ var CreateCommissionRateForm = ({
|
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
244
|
onSuccess: ({ commission_rate }) => {
|
|
245
|
-
toast.success("
|
|
245
|
+
toast.success(t("commissionRates.create.successToast"));
|
|
246
246
|
handleSuccess(`../${commission_rate.id}`);
|
|
247
247
|
},
|
|
248
248
|
onError: (e) => {
|
|
@@ -374,8 +374,8 @@ var CreateCommissionRateForm = ({
|
|
|
374
374
|
),
|
|
375
375
|
children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
|
|
376
376
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
377
|
-
/* @__PURE__ */ jsx(Heading, { children: "
|
|
378
|
-
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "
|
|
377
|
+
/* @__PURE__ */ jsx(Heading, { children: t("commissionRates.create.header") }),
|
|
378
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("commissionRates.create.description") })
|
|
379
379
|
] }),
|
|
380
380
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
381
381
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
@@ -385,7 +385,7 @@ var CreateCommissionRateForm = ({
|
|
|
385
385
|
control: form.control,
|
|
386
386
|
name: "name",
|
|
387
387
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
388
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
388
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.name") }),
|
|
389
389
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
390
390
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
391
391
|
] })
|
|
@@ -397,7 +397,7 @@ var CreateCommissionRateForm = ({
|
|
|
397
397
|
control: form.control,
|
|
398
398
|
name: "code",
|
|
399
399
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
400
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
400
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.code") }),
|
|
401
401
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
402
402
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
403
403
|
] })
|
|
@@ -411,12 +411,12 @@ var CreateCommissionRateForm = ({
|
|
|
411
411
|
control: form.control,
|
|
412
412
|
name: "type",
|
|
413
413
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
414
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
414
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.type.label") }),
|
|
415
415
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
416
416
|
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
417
417
|
/* @__PURE__ */ jsxs(Select.Content, { children: [
|
|
418
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "percentage", children: "
|
|
419
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "fixed", children: "
|
|
418
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "percentage", children: t("commissionRates.fields.type.percentage") }),
|
|
419
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "fixed", children: t("commissionRates.fields.type.fixed") })
|
|
420
420
|
] })
|
|
421
421
|
] }) }),
|
|
422
422
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
@@ -429,12 +429,12 @@ var CreateCommissionRateForm = ({
|
|
|
429
429
|
control: form.control,
|
|
430
430
|
name: "target",
|
|
431
431
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
432
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
432
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.target.label") }),
|
|
433
433
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
434
434
|
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
435
435
|
/* @__PURE__ */ jsxs(Select.Content, { children: [
|
|
436
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "item", children: "
|
|
437
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "shipping", children: "
|
|
436
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "item", children: t("commissionRates.fields.target.item") }),
|
|
437
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "shipping", children: t("commissionRates.fields.target.shipping") })
|
|
438
438
|
] })
|
|
439
439
|
] }) }),
|
|
440
440
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
@@ -449,9 +449,9 @@ var CreateCommissionRateForm = ({
|
|
|
449
449
|
control: form.control,
|
|
450
450
|
name: "currency_code",
|
|
451
451
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
452
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
452
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.currencyCode") }),
|
|
453
453
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
454
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: "
|
|
454
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("commissionRates.fields.currencyPlaceholder") }) }),
|
|
455
455
|
/* @__PURE__ */ jsx(Select.Content, { children: storeCurrencies.map((currency) => /* @__PURE__ */ jsx(
|
|
456
456
|
Select.Item,
|
|
457
457
|
{
|
|
@@ -471,7 +471,7 @@ var CreateCommissionRateForm = ({
|
|
|
471
471
|
control: form.control,
|
|
472
472
|
name: "value",
|
|
473
473
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
474
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
474
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.rate") }),
|
|
475
475
|
/* @__PURE__ */ jsx(Form.Control, { children: watchType === "percentage" ? /* @__PURE__ */ jsx(
|
|
476
476
|
PercentageInput,
|
|
477
477
|
{
|
|
@@ -503,7 +503,7 @@ var CreateCommissionRateForm = ({
|
|
|
503
503
|
control: form.control,
|
|
504
504
|
name: "min_amount",
|
|
505
505
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
506
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
506
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.minAmount") }),
|
|
507
507
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
508
508
|
CurrencyInput,
|
|
509
509
|
{
|
|
@@ -525,7 +525,7 @@ var CreateCommissionRateForm = ({
|
|
|
525
525
|
control: form.control,
|
|
526
526
|
name: "priority",
|
|
527
527
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
528
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
528
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.priority") }),
|
|
529
529
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { type: "number", ...field }) }),
|
|
530
530
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
531
531
|
] })
|
|
@@ -540,7 +540,7 @@ var CreateCommissionRateForm = ({
|
|
|
540
540
|
name: "is_enabled",
|
|
541
541
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
542
542
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
543
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
543
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.enabled") }),
|
|
544
544
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
545
545
|
Switch,
|
|
546
546
|
{
|
|
@@ -550,7 +550,7 @@ var CreateCommissionRateForm = ({
|
|
|
550
550
|
}
|
|
551
551
|
) })
|
|
552
552
|
] }),
|
|
553
|
-
/* @__PURE__ */ jsx(Form.Hint, { children: "
|
|
553
|
+
/* @__PURE__ */ jsx(Form.Hint, { children: t("commissionRates.fields.enabledHint") }),
|
|
554
554
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
555
555
|
] })
|
|
556
556
|
}
|
|
@@ -562,7 +562,7 @@ var CreateCommissionRateForm = ({
|
|
|
562
562
|
name: "include_tax",
|
|
563
563
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
564
564
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
565
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
565
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.includeTax") }),
|
|
566
566
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
567
567
|
Switch,
|
|
568
568
|
{
|
|
@@ -572,7 +572,7 @@ var CreateCommissionRateForm = ({
|
|
|
572
572
|
}
|
|
573
573
|
) })
|
|
574
574
|
] }),
|
|
575
|
-
/* @__PURE__ */ jsx(Form.Hint, { children: "
|
|
575
|
+
/* @__PURE__ */ jsx(Form.Hint, { children: t("commissionRates.fields.includeTaxHint") }),
|
|
576
576
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
577
577
|
] })
|
|
578
578
|
}
|
|
@@ -131,6 +131,7 @@ import "./chunk-NBMM2TZK.js";
|
|
|
131
131
|
|
|
132
132
|
// src/pages/commission-rates/commission-rate-edit/commission-rate-edit.tsx
|
|
133
133
|
import { Heading as Heading2 } from "@medusajs/ui";
|
|
134
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
134
135
|
import { useParams } from "react-router-dom";
|
|
135
136
|
|
|
136
137
|
// src/pages/commission-rates/commission-rate-edit/components/edit-commission-rate-form/edit-commission-rate-form.tsx
|
|
@@ -269,7 +270,7 @@ var EditCommissionRateForm = ({
|
|
|
269
270
|
...toDelete.length > 0 ? { delete: toDelete } : {}
|
|
270
271
|
});
|
|
271
272
|
}
|
|
272
|
-
toast.success("
|
|
273
|
+
toast.success(t("commissionRates.edit.successToast"));
|
|
273
274
|
handleSuccess();
|
|
274
275
|
} catch (e) {
|
|
275
276
|
toast.error(e.message);
|
|
@@ -404,7 +405,7 @@ var EditCommissionRateForm = ({
|
|
|
404
405
|
control: form.control,
|
|
405
406
|
name: "name",
|
|
406
407
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
407
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
408
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.name") }),
|
|
408
409
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
409
410
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
410
411
|
] })
|
|
@@ -416,7 +417,7 @@ var EditCommissionRateForm = ({
|
|
|
416
417
|
control: form.control,
|
|
417
418
|
name: "code",
|
|
418
419
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
419
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
420
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.code") }),
|
|
420
421
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
421
422
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
422
423
|
] })
|
|
@@ -428,12 +429,12 @@ var EditCommissionRateForm = ({
|
|
|
428
429
|
control: form.control,
|
|
429
430
|
name: "type",
|
|
430
431
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
431
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
432
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.type.label") }),
|
|
432
433
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
433
434
|
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
434
435
|
/* @__PURE__ */ jsxs(Select.Content, { children: [
|
|
435
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "percentage", children: "
|
|
436
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "fixed", children: "
|
|
436
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "percentage", children: t("commissionRates.fields.type.percentage") }),
|
|
437
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "fixed", children: t("commissionRates.fields.type.fixed") })
|
|
437
438
|
] })
|
|
438
439
|
] }) }),
|
|
439
440
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
@@ -446,12 +447,12 @@ var EditCommissionRateForm = ({
|
|
|
446
447
|
control: form.control,
|
|
447
448
|
name: "target",
|
|
448
449
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
449
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
450
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.target.label") }),
|
|
450
451
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
451
452
|
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
452
453
|
/* @__PURE__ */ jsxs(Select.Content, { children: [
|
|
453
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "item", children: "
|
|
454
|
-
/* @__PURE__ */ jsx(Select.Item, { value: "shipping", children: "
|
|
454
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "item", children: t("commissionRates.fields.target.item") }),
|
|
455
|
+
/* @__PURE__ */ jsx(Select.Item, { value: "shipping", children: t("commissionRates.fields.target.shipping") })
|
|
455
456
|
] })
|
|
456
457
|
] }) }),
|
|
457
458
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
@@ -464,9 +465,9 @@ var EditCommissionRateForm = ({
|
|
|
464
465
|
control: form.control,
|
|
465
466
|
name: "currency_code",
|
|
466
467
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
467
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
468
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.currencyCode") }),
|
|
468
469
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
469
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: "
|
|
470
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("commissionRates.fields.currencyPlaceholder") }) }),
|
|
470
471
|
/* @__PURE__ */ jsx(Select.Content, { children: storeCurrencies.map((currency) => /* @__PURE__ */ jsx(
|
|
471
472
|
Select.Item,
|
|
472
473
|
{
|
|
@@ -486,7 +487,7 @@ var EditCommissionRateForm = ({
|
|
|
486
487
|
control: form.control,
|
|
487
488
|
name: "value",
|
|
488
489
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
489
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
490
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.rate") }),
|
|
490
491
|
/* @__PURE__ */ jsx(Form.Control, { children: watchType === "percentage" ? /* @__PURE__ */ jsx(
|
|
491
492
|
PercentageInput,
|
|
492
493
|
{
|
|
@@ -516,7 +517,7 @@ var EditCommissionRateForm = ({
|
|
|
516
517
|
control: form.control,
|
|
517
518
|
name: "min_amount",
|
|
518
519
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
519
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
520
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.minAmount") }),
|
|
520
521
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
521
522
|
CurrencyInput,
|
|
522
523
|
{
|
|
@@ -538,7 +539,7 @@ var EditCommissionRateForm = ({
|
|
|
538
539
|
control: form.control,
|
|
539
540
|
name: "priority",
|
|
540
541
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
541
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
542
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.priority") }),
|
|
542
543
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { type: "number", ...field }) }),
|
|
543
544
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
544
545
|
] })
|
|
@@ -551,7 +552,7 @@ var EditCommissionRateForm = ({
|
|
|
551
552
|
name: "include_tax",
|
|
552
553
|
render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
553
554
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
554
|
-
/* @__PURE__ */ jsx(Form.Label, { children: "
|
|
555
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.includeTax") }),
|
|
555
556
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
556
557
|
Switch,
|
|
557
558
|
{
|
|
@@ -746,6 +747,7 @@ var EditCommissionRateForm = ({
|
|
|
746
747
|
// src/pages/commission-rates/commission-rate-edit/commission-rate-edit.tsx
|
|
747
748
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
748
749
|
var CommissionRateEdit = () => {
|
|
750
|
+
const { t } = useTranslation2();
|
|
749
751
|
const { id } = useParams();
|
|
750
752
|
const {
|
|
751
753
|
commission_rate,
|
|
@@ -757,7 +759,7 @@ var CommissionRateEdit = () => {
|
|
|
757
759
|
throw error;
|
|
758
760
|
}
|
|
759
761
|
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
760
|
-
/* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading2, { children: "
|
|
762
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading2, { children: t("commissionRates.edit.header") }) }),
|
|
761
763
|
!isLoading && commission_rate && /* @__PURE__ */ jsx2(EditCommissionRateForm, { commissionRate: commission_rate })
|
|
762
764
|
] });
|
|
763
765
|
};
|