@mercurjs/admin 2.2.0-canary.21 → 2.2.0-canary.22
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-EB2MYHMZ.js → add-campaign-promotions-2IOKLEMG.js} +3 -3
- package/dist/{campaign-detail-EAARQB3E.js → campaign-detail-5WNSQVKG.js} +4 -4
- package/dist/{chunk-3LYOKDUA.js → chunk-2H3KXP53.js} +1 -1
- package/dist/{chunk-KZB7LCF2.js → chunk-3EQOAHVG.js} +1 -1
- package/dist/{chunk-YUECTKEY.js → chunk-3ZCBTIIC.js} +1 -1
- package/dist/{chunk-2KPITPB7.js → chunk-5PWXUMCA.js} +1 -1
- package/dist/{chunk-AH3KBVKC.js → chunk-7PAVVX2P.js} +1 -1
- package/dist/{chunk-JEJQKTZO.js → chunk-ASNNJIW7.js} +2 -2
- package/dist/{chunk-RXRDZ47F.js → chunk-BHJFT3ST.js} +3 -3
- package/dist/{chunk-5NQUJQXX.js → chunk-FP6YPFKF.js} +23 -7
- package/dist/{chunk-G66KMUI5.js → chunk-K7EOVKKV.js} +1 -1
- package/dist/{chunk-EG45GIE3.js → chunk-PAGH4K4C.js} +47 -14
- package/dist/{chunk-6YPV4T3R.js → chunk-RXZZEPW3.js} +1 -1
- package/dist/{chunk-PN5C4AND.js → chunk-STPSVH3T.js} +1 -1
- package/dist/{chunk-JAPKOO4T.js → chunk-ZIIZGCTQ.js} +1 -1
- package/dist/{commission-rule-commission-edit-TA3H3EEN.js → commission-rule-commission-edit-EAOSJNA2.js} +3 -3
- package/dist/{commission-rule-create-O7Z25SC7.js → commission-rule-create-X3AYVCQG.js} +183 -67
- package/dist/{commission-rule-detail-I7LVSNAM.js → commission-rule-detail-EITJYZG5.js} +3 -3
- package/dist/{commission-rule-edit-YSHDTYZY.js → commission-rule-edit-FZLHYL4A.js} +2 -2
- package/dist/{commissions-list-OUGVPED6.js → commissions-list-TT2ITT75.js} +4 -3
- package/dist/{global-commission-edit-LCD6JJUX.js → global-commission-edit-3CEVUAAP.js} +46 -29
- package/dist/index.js +20 -20
- package/dist/{order-edit-billing-address-R7DOKCV5.js → order-edit-billing-address-5XHAAGT7.js} +1 -1
- package/dist/pages/index.js +12 -12
- package/dist/{product-create-R5HJ2GYT.js → product-create-LY3HDOLG.js} +3 -3
- package/dist/{product-media-OL4ETNFW.js → product-media-PWPVCTC2.js} +2 -2
- package/dist/{promotion-detail-SCS7MWD7.js → promotion-detail-ORDL76NG.js} +3 -3
- package/dist/{promotion-list-ZFF4E4ZW.js → promotion-list-NMD23NXJ.js} +4 -4
- package/dist/{reset-password-Y7HXY2NX.js → reset-password-GA3NEKEX.js} +1 -1
- package/dist/{store-edit-YEWQFHHM.js → store-edit-QJXV27DI.js} +2 -2
- package/dist/{tax-region-create-YQ5YBOC3.js → tax-region-create-MS6G5YVE.js} +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7PAVVX2P.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-K7EOVKKV.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import "./chunk-YN3FGNJM.js";
|
|
19
19
|
import "./chunk-KAZ5BYTQ.js";
|
|
20
20
|
import "./chunk-634XVU3D.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-FP6YPFKF.js";
|
|
22
22
|
import "./chunk-TKGWSUEI.js";
|
|
23
23
|
import {
|
|
24
24
|
KeyboundForm
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-RXZZEPW3.js";
|
|
5
|
+
import "./chunk-7PAVVX2P.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-K7EOVKKV.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-NQEXDLYH.js";
|
|
|
15
15
|
import "./chunk-YN3FGNJM.js";
|
|
16
16
|
import "./chunk-KAZ5BYTQ.js";
|
|
17
17
|
import "./chunk-634XVU3D.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-FP6YPFKF.js";
|
|
19
19
|
import "./chunk-IQPN4PZJ.js";
|
|
20
20
|
import "./chunk-E74OUNA3.js";
|
|
21
21
|
import "./chunk-H6MYB7GB.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDeleteCommissionRuleAction,
|
|
3
3
|
useScopeReferenceNames
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BHJFT3ST.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCommissionValue,
|
|
7
7
|
getIsActiveProps,
|
|
8
8
|
getScopeSummary,
|
|
9
9
|
getScopeTypeLabel,
|
|
10
10
|
referenceIds
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-STPSVH3T.js";
|
|
12
12
|
import {
|
|
13
13
|
SectionRow
|
|
14
14
|
} from "./chunk-3XPXUIK3.js";
|
|
@@ -22,10 +22,10 @@ var useDeleteCommissionRuleAction = (rule) => {
|
|
|
22
22
|
const { mutateAsync } = useDeleteCommissionRule(rule.id);
|
|
23
23
|
return async () => {
|
|
24
24
|
const confirmed = await prompt({
|
|
25
|
-
title: t("
|
|
25
|
+
title: t("commissions.delete.title", "Delete commission rule"),
|
|
26
26
|
description: t("commissions.delete.description", {
|
|
27
27
|
name: rule.name,
|
|
28
|
-
defaultValue: `
|
|
28
|
+
defaultValue: `You are about to delete commission rule ${rule.name}. This action cannot be undone.`
|
|
29
29
|
}),
|
|
30
30
|
confirmText: t("actions.delete"),
|
|
31
31
|
cancelText: t("actions.cancel")
|
|
@@ -37,7 +37,7 @@ var useDeleteCommissionRuleAction = (rule) => {
|
|
|
37
37
|
onSuccess: () => {
|
|
38
38
|
toast.success(
|
|
39
39
|
t("commissions.delete.successToast", {
|
|
40
|
-
defaultValue: "Commission rule deleted"
|
|
40
|
+
defaultValue: "Commission rule was successfully deleted."
|
|
41
41
|
})
|
|
42
42
|
);
|
|
43
43
|
navigate("/settings/commissions");
|
|
@@ -12673,15 +12673,20 @@ var en_default = {
|
|
|
12673
12673
|
header: "Create Commission Rule",
|
|
12674
12674
|
details: "Details",
|
|
12675
12675
|
commission: "Commission",
|
|
12676
|
-
successToast: "Commission rule created"
|
|
12676
|
+
successToast: "Commission rule was successfully created."
|
|
12677
12677
|
},
|
|
12678
12678
|
edit: {
|
|
12679
12679
|
header: "Edit Commission Rule",
|
|
12680
|
-
successToast: "Commission rule updated"
|
|
12680
|
+
successToast: "Commission rule was successfully updated."
|
|
12681
|
+
},
|
|
12682
|
+
commissionEdit: {
|
|
12683
|
+
header: "Edit Commission",
|
|
12684
|
+
successToast: "Commission was successfully updated."
|
|
12681
12685
|
},
|
|
12682
12686
|
delete: {
|
|
12683
|
-
|
|
12684
|
-
|
|
12687
|
+
title: "Delete commission rule",
|
|
12688
|
+
description: "You are about to delete commission rule {{name}}. This action cannot be undone.",
|
|
12689
|
+
successToast: "Commission rule was successfully deleted."
|
|
12685
12690
|
},
|
|
12686
12691
|
fields: {
|
|
12687
12692
|
code: "Code",
|
|
@@ -12698,7 +12703,9 @@ var en_default = {
|
|
|
12698
12703
|
type: {
|
|
12699
12704
|
label: "Type",
|
|
12700
12705
|
percentage: "Percentage",
|
|
12701
|
-
fixed: "Fixed"
|
|
12706
|
+
fixed: "Fixed",
|
|
12707
|
+
percentageHint: "Charge a percentage of the order total.",
|
|
12708
|
+
fixedHint: "Charge a fixed amount per order."
|
|
12702
12709
|
},
|
|
12703
12710
|
scopeType: {
|
|
12704
12711
|
label: "Type",
|
|
@@ -12706,7 +12713,12 @@ var en_default = {
|
|
|
12706
12713
|
productType: "Product Type",
|
|
12707
12714
|
category: "Category",
|
|
12708
12715
|
storeProductType: "Store + Product Type",
|
|
12709
|
-
storeCategory: "Store + Category"
|
|
12716
|
+
storeCategory: "Store + Category",
|
|
12717
|
+
storeHint: "Apply to specific stores.",
|
|
12718
|
+
productTypeHint: "Apply to specific product types.",
|
|
12719
|
+
categoryHint: "Apply to specific categories.",
|
|
12720
|
+
storeProductTypeHint: "Apply to product types within specific stores.",
|
|
12721
|
+
storeCategoryHint: "Apply to categories within specific stores."
|
|
12710
12722
|
}
|
|
12711
12723
|
},
|
|
12712
12724
|
global: {
|
|
@@ -12720,7 +12732,7 @@ var en_default = {
|
|
|
12720
12732
|
notIncluded: "Not included in commission",
|
|
12721
12733
|
edit: {
|
|
12722
12734
|
header: "Edit Global Commission",
|
|
12723
|
-
successToast: "Global commission updated"
|
|
12735
|
+
successToast: "Global commission was successfully updated."
|
|
12724
12736
|
}
|
|
12725
12737
|
},
|
|
12726
12738
|
rules: {
|
|
@@ -12731,6 +12743,10 @@ var en_default = {
|
|
|
12731
12743
|
type: "Type",
|
|
12732
12744
|
value: "Value",
|
|
12733
12745
|
status: "Status"
|
|
12746
|
+
},
|
|
12747
|
+
empty: {
|
|
12748
|
+
heading: "No commission rules yet",
|
|
12749
|
+
description: "Create a commission rule to override the global commission for specific stores, product types, or categories."
|
|
12734
12750
|
}
|
|
12735
12751
|
},
|
|
12736
12752
|
status: {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDeleteCommissionRuleAction,
|
|
3
3
|
useScopeReferenceNames
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BHJFT3ST.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCommissionValue,
|
|
7
7
|
getIsActiveProps,
|
|
8
8
|
getScopeSummary,
|
|
9
9
|
getScopeTypeLabel
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-STPSVH3T.js";
|
|
11
11
|
import {
|
|
12
12
|
TextCell,
|
|
13
13
|
TextHeader
|
|
14
14
|
} from "./chunk-JHIMVLB2.js";
|
|
15
|
+
import {
|
|
16
|
+
StatusCell
|
|
17
|
+
} from "./chunk-DB6ANJBO.js";
|
|
15
18
|
import {
|
|
16
19
|
_DataTable,
|
|
17
20
|
useDataTable
|
|
@@ -130,7 +133,6 @@ import { Container as Container2 } from "@medusajs/ui";
|
|
|
130
133
|
|
|
131
134
|
// src/pages/commissions/commissions-list/components/commission-rules-table/commission-rules-data-table.tsx
|
|
132
135
|
import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
|
|
133
|
-
import { StatusBadge } from "@medusajs/ui";
|
|
134
136
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
135
137
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
136
138
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -144,18 +146,39 @@ var useCommissionRulesFilters = () => {
|
|
|
144
146
|
return useMemo(
|
|
145
147
|
() => [
|
|
146
148
|
{
|
|
147
|
-
key: "
|
|
148
|
-
label: t("commissions.fields.
|
|
149
|
+
key: "scope_type",
|
|
150
|
+
label: t("commissions.fields.scopeType.label", "Type"),
|
|
149
151
|
type: "select",
|
|
150
152
|
multiple: true,
|
|
151
153
|
options: [
|
|
152
154
|
{
|
|
153
|
-
label: t("commissions.fields.
|
|
154
|
-
value: "
|
|
155
|
+
label: t("commissions.fields.scopeType.store", "Store"),
|
|
156
|
+
value: "store"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: t(
|
|
160
|
+
"commissions.fields.scopeType.productType",
|
|
161
|
+
"Product Type"
|
|
162
|
+
),
|
|
163
|
+
value: "product_type"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: t("commissions.fields.scopeType.category", "Category"),
|
|
167
|
+
value: "category"
|
|
155
168
|
},
|
|
156
169
|
{
|
|
157
|
-
label: t(
|
|
158
|
-
|
|
170
|
+
label: t(
|
|
171
|
+
"commissions.fields.scopeType.storeProductType",
|
|
172
|
+
"Store + Product Type"
|
|
173
|
+
),
|
|
174
|
+
value: "store_product_type"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
label: t(
|
|
178
|
+
"commissions.fields.scopeType.storeCategory",
|
|
179
|
+
"Store + Category"
|
|
180
|
+
),
|
|
181
|
+
value: "store_category"
|
|
159
182
|
}
|
|
160
183
|
]
|
|
161
184
|
},
|
|
@@ -182,17 +205,17 @@ var useCommissionRulesQuery = ({
|
|
|
182
205
|
pageSize = 20
|
|
183
206
|
} = {}) => {
|
|
184
207
|
const queryObject = useQueryParams(
|
|
185
|
-
["offset", "q", "order", "is_enabled", "
|
|
208
|
+
["offset", "q", "order", "is_enabled", "scope_type"],
|
|
186
209
|
prefix
|
|
187
210
|
);
|
|
188
|
-
const { offset, q, order, is_enabled,
|
|
211
|
+
const { offset, q, order, is_enabled, scope_type } = queryObject;
|
|
189
212
|
const searchParams = {
|
|
190
213
|
limit: pageSize,
|
|
191
214
|
offset: offset ? Number(offset) : 0,
|
|
192
215
|
order: order || void 0,
|
|
193
216
|
q: q || void 0,
|
|
194
217
|
is_enabled: is_enabled ? is_enabled === "true" : void 0,
|
|
195
|
-
|
|
218
|
+
scope_type: scope_type ? scope_type.split(",") : void 0
|
|
196
219
|
};
|
|
197
220
|
return { searchParams, raw: queryObject };
|
|
198
221
|
};
|
|
@@ -220,7 +243,10 @@ var CommissionRulesDataTable = () => {
|
|
|
220
243
|
placeholderData: keepPreviousData
|
|
221
244
|
}
|
|
222
245
|
);
|
|
223
|
-
const data =
|
|
246
|
+
const data = useMemo2(
|
|
247
|
+
() => commission_rates ?? [],
|
|
248
|
+
[commission_rates]
|
|
249
|
+
);
|
|
224
250
|
const allRules = useMemo2(
|
|
225
251
|
() => data.flatMap((rate) => rate.rules ?? []),
|
|
226
252
|
[data]
|
|
@@ -249,6 +275,13 @@ var CommissionRulesDataTable = () => {
|
|
|
249
275
|
queryObject: raw,
|
|
250
276
|
filters,
|
|
251
277
|
navigateTo: (row) => `${row.original.id}`,
|
|
278
|
+
noRecords: {
|
|
279
|
+
title: t("commissions.rules.empty.heading", "No commission rules yet"),
|
|
280
|
+
message: t(
|
|
281
|
+
"commissions.rules.empty.description",
|
|
282
|
+
"Create a commission rule to override the global commission for specific stores, product types, or categories."
|
|
283
|
+
)
|
|
284
|
+
},
|
|
252
285
|
pagination: true,
|
|
253
286
|
search: true,
|
|
254
287
|
orderBy: [
|
|
@@ -316,7 +349,7 @@ var useColumns = (names) => {
|
|
|
316
349
|
header: () => /* @__PURE__ */ jsx2(TextHeader, { text: t("commissions.rules.columns.status", "Status") }),
|
|
317
350
|
cell: ({ getValue }) => {
|
|
318
351
|
const props = getIsActiveProps(getValue(), t);
|
|
319
|
-
return /* @__PURE__ */ jsx2(
|
|
352
|
+
return /* @__PURE__ */ jsx2(StatusCell, { color: props.color, children: props.label });
|
|
320
353
|
}
|
|
321
354
|
}),
|
|
322
355
|
columnHelper.display({
|
|
@@ -89,7 +89,7 @@ var getIsActiveProps = (isEnabled, t) => isEnabled ? {
|
|
|
89
89
|
color: "green",
|
|
90
90
|
label: t("commissions.status.enabled", "Active")
|
|
91
91
|
} : {
|
|
92
|
-
color: "
|
|
92
|
+
color: "red",
|
|
93
93
|
label: t("commissions.status.disabled", "Inactive")
|
|
94
94
|
};
|
|
95
95
|
var buildValuesPayload = (currencies, fixedValues = {}) => currencies.map((code) => ({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CommissionValueFields,
|
|
3
3
|
useStoreCurrencies
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3EQOAHVG.js";
|
|
5
5
|
import {
|
|
6
6
|
buildValuesPayload,
|
|
7
7
|
fixedValuesFromRate
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-STPSVH3T.js";
|
|
9
9
|
import "./chunk-MAEP2UCK.js";
|
|
10
10
|
import {
|
|
11
11
|
SwitchBox
|
|
@@ -81,7 +81,7 @@ var EditCommissionForm = ({ rule }) => {
|
|
|
81
81
|
onSuccess: () => {
|
|
82
82
|
toast.success(
|
|
83
83
|
t("commissions.commissionEdit.successToast", {
|
|
84
|
-
defaultValue: "Commission updated"
|
|
84
|
+
defaultValue: "Commission was successfully updated."
|
|
85
85
|
})
|
|
86
86
|
);
|
|
87
87
|
handleSuccess();
|