@mercurjs/admin 2.2.0-canary.21 → 2.2.0-canary.23
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/{category-detail-ABK4MEZP.js → category-detail-SNN3ZBPS.js} +1 -1
- package/dist/{category-icon-edit-4GXAK4JZ.js → category-icon-edit-SP5TQYA7.js} +1 -1
- package/dist/{category-list-PFOINLTU.js → category-list-OKKJX73E.js} +1 -1
- package/dist/{category-media-7SLAXXXM.js → category-media-IGRRTZ65.js} +2 -2
- 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-ZLETFDWJ.js → chunk-746L7AHM.js} +2 -2
- 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-67RX3M6X.js → chunk-MEAFCHUY.js} +2 -2
- package/dist/{chunk-EDDKIVMF.js → chunk-NONPU75Q.js} +1 -1
- package/dist/{chunk-EG45GIE3.js → chunk-PAGH4K4C.js} +47 -14
- package/dist/{chunk-ARN66CDK.js → chunk-PQAEYURH.js} +1 -1
- package/dist/{chunk-6YPV4T3R.js → chunk-RXZZEPW3.js} +1 -1
- package/dist/{chunk-PN5C4AND.js → chunk-STPSVH3T.js} +1 -1
- package/dist/{chunk-LLHYICP5.js → chunk-UWKKDBBZ.js} +1 -1
- package/dist/{chunk-JAPKOO4T.js → chunk-ZIIZGCTQ.js} +1 -1
- package/dist/{collection-detail-36QTD3ZU.js → collection-detail-UDBTTHLK.js} +1 -1
- package/dist/{collection-icon-edit-V4SNBMD5.js → collection-icon-edit-HNYGQJXC.js} +1 -1
- package/dist/{collection-list-UN7C36DU.js → collection-list-U74G2R6W.js} +2 -2
- package/dist/{collection-media-ESJUYVF7.js → collection-media-G42DRQ6K.js} +2 -2
- 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 +39 -39
- package/dist/{order-edit-billing-address-R7DOKCV5.js → order-edit-billing-address-5XHAAGT7.js} +1 -1
- package/dist/pages/index.d.ts +2 -2
- package/dist/pages/index.js +17 -17
- 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/{product-tag-detail-NVTDW7BR.js → product-tag-detail-LPILT2ZS.js} +1 -1
- package/dist/{product-tag-list-T6BDTH24.js → product-tag-list-CK6W4LSP.js} +1 -1
- 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/{refund-reason-list-F56TJAGR.js → refund-reason-list-LDLZ4JL6.js} +1 -1
- package/dist/{reset-password-Y7HXY2NX.js → reset-password-GA3NEKEX.js} +1 -1
- package/dist/{return-reason-list-EJ5DLDR2.js → return-reason-list-2LFMI7CT.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/dist/{tax-region-tax-override-create-5MIAKHY6.js → tax-region-tax-override-create-I5FQMBBC.js} +1 -1
- package/dist/{tax-region-tax-override-edit-EHLIO56A.js → tax-region-tax-override-edit-4X56DGNL.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";
|
|
@@ -43,7 +43,7 @@ var EditCategoryIconSchema = z.object({
|
|
|
43
43
|
var EditCategoryIconForm = ({ category }) => {
|
|
44
44
|
const { t } = useTranslation();
|
|
45
45
|
const { handleSuccess } = useRouteModal();
|
|
46
|
-
const existingIcon = getCategoryIcon(category.
|
|
46
|
+
const existingIcon = getCategoryIcon(category.media_images);
|
|
47
47
|
const form = useForm({
|
|
48
48
|
defaultValues: {
|
|
49
49
|
icon: existingIcon ? { url: existingIcon.url, file: null } : null
|
|
@@ -89,7 +89,7 @@ var EditCategoryMediaForm = ({
|
|
|
89
89
|
const { handleSuccess } = useRouteModal();
|
|
90
90
|
const form = useForm({
|
|
91
91
|
defaultValues: {
|
|
92
|
-
media: getCategoryGallery(category.
|
|
92
|
+
media: getCategoryGallery(category.media_images).map((image) => ({
|
|
93
93
|
id: image.id,
|
|
94
94
|
url: image.url,
|
|
95
95
|
file: null,
|
|
@@ -402,7 +402,7 @@ var CategoryMediaGallery = ({
|
|
|
402
402
|
const { t } = useTranslation2();
|
|
403
403
|
const prompt = usePrompt();
|
|
404
404
|
const { mutateAsync, isPending } = useUpdateProductCategory(category.id);
|
|
405
|
-
const media = getCategoryGallery(category.
|
|
405
|
+
const media = getCategoryGallery(category.media_images);
|
|
406
406
|
const next = useCallback2(() => {
|
|
407
407
|
if (isPending) {
|
|
408
408
|
return;
|
|
@@ -119,7 +119,7 @@ var CategoryIconSection = ({
|
|
|
119
119
|
category
|
|
120
120
|
}) => {
|
|
121
121
|
const { t } = useTranslation2();
|
|
122
|
-
const icon = getCategoryIcon(category.
|
|
122
|
+
const icon = getCategoryIcon(category.media_images);
|
|
123
123
|
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", "data-testid": "category-icon-section", children: [
|
|
124
124
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
125
125
|
/* @__PURE__ */ jsx2(Heading2, { children: t("categories.icon.label") }),
|
|
@@ -174,7 +174,7 @@ var CategoryMediaSection = ({
|
|
|
174
174
|
category
|
|
175
175
|
}) => {
|
|
176
176
|
const { t } = useTranslation3();
|
|
177
|
-
const gallery = getCategoryGallery(category.
|
|
177
|
+
const gallery = getCategoryGallery(category.media_images);
|
|
178
178
|
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", "data-testid": "category-media-section", children: [
|
|
179
179
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
180
180
|
/* @__PURE__ */ jsx3(Heading3, { children: t("categories.media.label") }),
|
|
@@ -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: {
|
|
@@ -114,7 +114,7 @@ var CollectionIconSection = ({
|
|
|
114
114
|
collection
|
|
115
115
|
}) => {
|
|
116
116
|
const { t } = useTranslation2();
|
|
117
|
-
const icon = getCollectionIcon(collection.
|
|
117
|
+
const icon = getCollectionIcon(collection.media_images);
|
|
118
118
|
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", "data-testid": "collection-icon-section", children: [
|
|
119
119
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
120
120
|
/* @__PURE__ */ jsx2(Heading2, { level: "h2", children: t("collections.icon.label") }),
|
|
@@ -169,7 +169,7 @@ var CollectionMediaSection = ({
|
|
|
169
169
|
collection
|
|
170
170
|
}) => {
|
|
171
171
|
const { t } = useTranslation3();
|
|
172
|
-
const gallery = getCollectionGallery(collection.
|
|
172
|
+
const gallery = getCollectionGallery(collection.media_images);
|
|
173
173
|
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", "data-testid": "collection-media-section", children: [
|
|
174
174
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
175
175
|
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("collections.media.label") }),
|
|
@@ -22,7 +22,7 @@ var useCollectionTableColumns = () => {
|
|
|
22
22
|
header: t("fields.title"),
|
|
23
23
|
cell: ({ getValue, row }) => {
|
|
24
24
|
const gallery = getCollectionGallery(
|
|
25
|
-
row.original.
|
|
25
|
+
row.original.media_images
|
|
26
26
|
);
|
|
27
27
|
const thumbnailSrc = gallery.find((image) => image.is_thumbnail)?.url ?? gallery[0]?.url ?? null;
|
|
28
28
|
return /* @__PURE__ */ jsxs("div", { className: "flex size-full items-center gap-x-3 overflow-hidden", children: [
|
|
@@ -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) => ({
|
|
@@ -114,7 +114,7 @@ var useCategoryTableColumns = () => {
|
|
|
114
114
|
)) });
|
|
115
115
|
}
|
|
116
116
|
const gallery = getCategoryGallery(
|
|
117
|
-
row.original.
|
|
117
|
+
row.original.media_images
|
|
118
118
|
);
|
|
119
119
|
const thumbnailSrc = gallery.find((image) => image.is_thumbnail)?.url ?? gallery[0]?.url ?? null;
|
|
120
120
|
return /* @__PURE__ */ jsxs2("div", { className: "flex size-full items-center gap-x-3 overflow-hidden", children: [
|
|
@@ -45,7 +45,7 @@ var EditCollectionIconForm = ({
|
|
|
45
45
|
}) => {
|
|
46
46
|
const { t } = useTranslation();
|
|
47
47
|
const { handleSuccess } = useRouteModal();
|
|
48
|
-
const existingIcon = getCollectionIcon(collection.
|
|
48
|
+
const existingIcon = getCollectionIcon(collection.media_images);
|
|
49
49
|
const form = useForm({
|
|
50
50
|
defaultValues: {
|
|
51
51
|
icon: existingIcon ? { url: existingIcon.url, file: null } : null
|
|
@@ -89,7 +89,7 @@ var EditCollectionMediaForm = ({
|
|
|
89
89
|
const { handleSuccess } = useRouteModal();
|
|
90
90
|
const form = useForm({
|
|
91
91
|
defaultValues: {
|
|
92
|
-
media: getCollectionGallery(collection.
|
|
92
|
+
media: getCollectionGallery(collection.media_images).map((image) => ({
|
|
93
93
|
id: image.id,
|
|
94
94
|
url: image.url,
|
|
95
95
|
file: null,
|
|
@@ -402,7 +402,7 @@ var CollectionMediaGallery = ({
|
|
|
402
402
|
const { t } = useTranslation2();
|
|
403
403
|
const prompt = usePrompt();
|
|
404
404
|
const { mutateAsync, isPending } = useUpdateCollection(collection.id);
|
|
405
|
-
const media = getCollectionGallery(collection.
|
|
405
|
+
const media = getCollectionGallery(collection.media_images);
|
|
406
406
|
const next = useCallback2(() => {
|
|
407
407
|
if (isPending) {
|
|
408
408
|
return;
|
|
@@ -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();
|