@mercurjs/admin 2.2.0-rc.2 → 2.2.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-LI7XFHIN.js → add-campaign-promotions-KXVCLUG2.js} +3 -3
- package/dist/{campaign-detail-JR7EXZWX.js → campaign-detail-G7DKPI5W.js} +4 -4
- package/dist/{categories-metadata-3H2HUUUP.js → categories-metadata-EKGY5IY2.js} +3 -1
- package/dist/{chunk-Z3WQEPTC.js → chunk-6RMCSQBI.js} +23 -22
- package/dist/{chunk-M5DCBNFA.js → chunk-AQCA7HGL.js} +2 -2
- package/dist/{chunk-U5MJIHLY.js → chunk-BNOKKKUU.js} +2 -1
- package/dist/{chunk-XUAWHN6S.js → chunk-FU6XA7IT.js} +1 -1
- package/dist/{chunk-CK4MU7NI.js → chunk-GTFDJLHW.js} +1 -1
- package/dist/{chunk-TZGU32FW.js → chunk-HEXXU3V3.js} +3 -2
- package/dist/{chunk-67KYEPSA.js → chunk-L2HIQAOS.js} +1 -1
- package/dist/{chunk-TIG77LHS.js → chunk-LNBYVXJX.js} +1 -1
- package/dist/{chunk-577LTDI6.js → chunk-NGKC43E3.js} +1 -1
- package/dist/{chunk-BIIQUM77.js → chunk-O3Q2YJNR.js} +4 -4
- package/dist/{chunk-UVF5DZCD.js → chunk-P73BQ56H.js} +1 -1
- package/dist/{chunk-234XHCKP.js → chunk-QHVRUP4S.js} +1 -1
- package/dist/{chunk-HKNL5ARE.js → chunk-S2ZNHDPO.js} +2 -2
- package/dist/{chunk-R2LW5LGL.js → chunk-TDDEAQ3T.js} +36089 -1622
- package/dist/{chunk-MCK4I4JE.js → chunk-YCAPN5F6.js} +1 -1
- package/dist/{chunk-7YBDUUYJ.js → chunk-YDDD3MK5.js} +1 -1
- package/dist/{chunk-WRQ35W52.js → chunk-ZNEC7NSD.js} +1 -1
- package/dist/{collection-metadata-4Q4BECCH.js → collection-metadata-7FOQ22FA.js} +3 -1
- package/dist/{customer-group-metadata-Z6D2CEML.js → customer-group-metadata-V5S6BIXN.js} +3 -1
- package/dist/{customer-metadata-5Q6CQJ5W.js → customer-metadata-4LLZ4ZMR.js} +3 -1
- package/dist/index.js +47 -47
- package/dist/{inventory-metadata-6NCUXAF6.js → inventory-metadata-63TI6TPT.js} +3 -1
- package/dist/{location-service-zone-shipping-option-pricing-ARBOTMUQ.js → location-service-zone-shipping-option-pricing-VNBDBAEC.js} +3 -1
- package/dist/{marketplace-metadata-ZHJANDFF.js → marketplace-metadata-PSMQ7E3O.js} +3 -1
- package/dist/{order-detail-GH25X7LO.js → order-detail-QE4HBQ5W.js} +1 -1
- package/dist/{order-edit-billing-address-FL6JUBHR.js → order-edit-billing-address-7S2QIRSZ.js} +1 -1
- package/dist/{order-metadata-GB2PI4VA.js → order-metadata-UBUSPFTW.js} +3 -1
- package/dist/pages/index.d.ts +1 -1
- package/dist/pages/index.js +16 -16
- package/dist/{price-list-create-QU6R7GRC.js → price-list-create-4TDXQ7UF.js} +3 -3
- package/dist/{price-list-detail-I34YIISJ.js → price-list-detail-TUKXO5WG.js} +2 -2
- package/dist/{price-list-list-4ZY64YQB.js → price-list-list-TSK3TWUX.js} +2 -2
- package/dist/{price-list-prices-add-V5U64Y6Y.js → price-list-prices-add-VEQQYNEA.js} +3 -3
- package/dist/{price-list-prices-edit-DKCX3UBV.js → price-list-prices-edit-ANLZGAY4.js} +2 -2
- package/dist/{product-add-existing-attributes-BZMB7ADH.js → product-add-existing-attributes-3S3E3TDO.js} +2 -1
- package/dist/{product-create-I4USHEJB.js → product-create-KILMAWD7.js} +3 -3
- package/dist/{product-media-B4N3YJQX.js → product-media-QY4RFTYZ.js} +2 -2
- package/dist/{product-metadata-ECF7OSZP.js → product-metadata-TGAAEG4O.js} +3 -1
- package/dist/{product-organization-EJUK4CZC.js → product-organization-JPPQYC5E.js} +1 -1
- package/dist/{product-tag-metadata-UPNJHAHF.js → product-tag-metadata-VNH5GXMK.js} +3 -1
- package/dist/{product-type-metadata-HSIY6LBU.js → product-type-metadata-6KXQSYK5.js} +3 -1
- package/dist/{product-variant-metadata-VREI3USX.js → product-variant-metadata-4BULTZ3M.js} +3 -1
- package/dist/{promotion-create-OJIBTHTJ.js → promotion-create-5BJ4EVAI.js} +1 -1
- package/dist/{promotion-detail-2N75YHYC.js → promotion-detail-S5R5UXJ6.js} +3 -3
- package/dist/{promotion-list-UIWNGEVN.js → promotion-list-22NDDYPQ.js} +4 -4
- package/dist/{region-metadata-CCG5PYAN.js → region-metadata-EFQS2FU6.js} +3 -1
- package/dist/{reservation-metadata-JLX75BPV.js → reservation-metadata-44QNS5IN.js} +3 -1
- package/dist/{reset-password-LUAKAGJO.js → reset-password-CCHTZ4YX.js} +1 -1
- package/dist/{sales-channel-metadata-3SKXKLM4.js → sales-channel-metadata-2LJBDKYI.js} +3 -1
- package/dist/{shipping-profile-metadata-525ENKVW.js → shipping-profile-metadata-O3AG4LS4.js} +3 -1
- package/dist/{store-closure-edit-3HRLONIN.js → store-closure-edit-FXUECFDN.js} +5 -2
- package/dist/{store-edit-ECPS7KNP.js → store-edit-WIAZLSHU.js} +2 -2
- package/dist/{tax-region-create-BNC2BIYK.js → tax-region-create-2NPI4MUT.js} +1 -1
- package/dist/{tax-region-metadata-EDVNCFIM.js → tax-region-metadata-OQX67IIE.js} +3 -1
- package/dist/{tax-region-tax-override-create-G7VXNVNU.js → tax-region-tax-override-create-NRO7QCVL.js} +1 -1
- package/dist/{tax-region-tax-override-edit-NC3WIM7X.js → tax-region-tax-override-edit-POJATJRW.js} +1 -1
- package/dist/{user-metadata-U7UIEIWL.js → user-metadata-PNIWSBYP.js} +3 -1
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LNBYVXJX.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-L2HIQAOS.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-TDDEAQ3T.js";
|
|
14
14
|
import "./chunk-TKGWSUEI.js";
|
|
15
15
|
import {
|
|
16
16
|
KeyboundForm
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NGKC43E3.js";
|
|
5
|
+
import "./chunk-LNBYVXJX.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-L2HIQAOS.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-TDDEAQ3T.js";
|
|
14
14
|
import "./chunk-IQPN4PZJ.js";
|
|
15
15
|
import "./chunk-E74OUNA3.js";
|
|
16
16
|
import "./chunk-H6MYB7GB.js";
|
|
@@ -52,9 +52,11 @@ import "./chunk-NBMM2TZK.js";
|
|
|
52
52
|
|
|
53
53
|
// src/pages/categories/categories-metadata/categories-metadata.tsx
|
|
54
54
|
import { useParams } from "react-router-dom";
|
|
55
|
+
import { useTranslation } from "react-i18next";
|
|
55
56
|
import { ClientError } from "@mercurjs/client";
|
|
56
57
|
import { jsx } from "react/jsx-runtime";
|
|
57
58
|
var CategoriesMetadata = () => {
|
|
59
|
+
const { t } = useTranslation();
|
|
58
60
|
const { id } = useParams();
|
|
59
61
|
const { product_category, isPending, isError, error } = useProductCategory(id);
|
|
60
62
|
const { mutateAsync, isPending: isMutating } = useUpdateProductCategory(id);
|
|
@@ -69,7 +71,7 @@ var CategoriesMetadata = () => {
|
|
|
69
71
|
callbacks.onSuccess?.();
|
|
70
72
|
return result;
|
|
71
73
|
} catch (error2) {
|
|
72
|
-
const message = error2 instanceof ClientError ? error2.message : "
|
|
74
|
+
const message = error2 instanceof ClientError ? error2.message : t("errorBoundary.defaultTitle");
|
|
73
75
|
callbacks.onError?.(message);
|
|
74
76
|
throw error2;
|
|
75
77
|
}
|
|
@@ -35,16 +35,17 @@ import {
|
|
|
35
35
|
} from "./chunk-Y7QKP6QU.js";
|
|
36
36
|
|
|
37
37
|
// src/pages/promotions/promotion-create/components/create-promotion-form/form-schema.ts
|
|
38
|
+
import i18n from "i18next";
|
|
38
39
|
import { z } from "zod";
|
|
39
40
|
var RuleSchema = z.array(
|
|
40
41
|
z.object({
|
|
41
42
|
id: z.string().optional(),
|
|
42
|
-
attribute: z.string().min(1, { message: "
|
|
43
|
-
operator: z.string().min(1, { message: "
|
|
43
|
+
attribute: z.string().min(1, { message: i18n.t("validation.requiredField") }),
|
|
44
|
+
operator: z.string().min(1, { message: i18n.t("validation.requiredField") }),
|
|
44
45
|
values: z.union([
|
|
45
|
-
z.number().min(1, { message: "
|
|
46
|
-
z.string().min(1, { message: "
|
|
47
|
-
z.array(z.string()).min(1, { message: "
|
|
46
|
+
z.number().min(1, { message: i18n.t("validation.requiredField") }),
|
|
47
|
+
z.string().min(1, { message: i18n.t("validation.requiredField") }),
|
|
48
|
+
z.array(z.string()).min(1, { message: i18n.t("validation.requiredField") })
|
|
48
49
|
]),
|
|
49
50
|
required: z.boolean().optional(),
|
|
50
51
|
disguised: z.boolean().optional(),
|
|
@@ -81,7 +82,7 @@ var CreatePromotionSchema = z.object({
|
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
path: ["application_method.max_quantity"],
|
|
84
|
-
message:
|
|
85
|
+
message: i18n.t("validation.requiredField")
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
88
|
|
|
@@ -176,7 +177,7 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
176
177
|
"data-testid": "promotion-create-form-promotion-heading",
|
|
177
178
|
children: [
|
|
178
179
|
t(`promotions.sections.details`),
|
|
179
|
-
currentTemplate?.
|
|
180
|
+
currentTemplate?.titleKey && /* @__PURE__ */ jsx2(
|
|
180
181
|
Badge,
|
|
181
182
|
{
|
|
182
183
|
className: "ml-2 align-middle",
|
|
@@ -184,7 +185,7 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
184
185
|
size: "2xsmall",
|
|
185
186
|
rounded: "full",
|
|
186
187
|
"data-testid": "promotion-create-form-promotion-template-badge",
|
|
187
|
-
children: currentTemplate
|
|
188
|
+
children: t(currentTemplate.titleKey)
|
|
188
189
|
}
|
|
189
190
|
)
|
|
190
191
|
]
|
|
@@ -770,8 +771,8 @@ var templates = [
|
|
|
770
771
|
{
|
|
771
772
|
id: "amount_off_products",
|
|
772
773
|
type: "standard",
|
|
773
|
-
|
|
774
|
-
|
|
774
|
+
titleKey: "promotions.templates.amountOffProducts.title",
|
|
775
|
+
descriptionKey: "promotions.templates.amountOffProducts.description",
|
|
775
776
|
hiddenFields: amountOfProductHiddenFields,
|
|
776
777
|
defaults: {
|
|
777
778
|
is_automatic: "false",
|
|
@@ -786,8 +787,8 @@ var templates = [
|
|
|
786
787
|
{
|
|
787
788
|
id: "amount_off_order",
|
|
788
789
|
type: "standard",
|
|
789
|
-
|
|
790
|
-
|
|
790
|
+
titleKey: "promotions.templates.amountOffOrder.title",
|
|
791
|
+
descriptionKey: "promotions.templates.amountOffOrder.description",
|
|
791
792
|
hiddenFields: amountOfOrderHiddenFields,
|
|
792
793
|
defaults: {
|
|
793
794
|
is_automatic: "false",
|
|
@@ -802,8 +803,8 @@ var templates = [
|
|
|
802
803
|
{
|
|
803
804
|
id: "percentage_off_product",
|
|
804
805
|
type: "standard",
|
|
805
|
-
|
|
806
|
-
|
|
806
|
+
titleKey: "promotions.templates.percentageOffProduct.title",
|
|
807
|
+
descriptionKey: "promotions.templates.percentageOffProduct.description",
|
|
807
808
|
hiddenFields: percentageOfProductHiddenFields,
|
|
808
809
|
defaults: {
|
|
809
810
|
is_automatic: "false",
|
|
@@ -818,8 +819,8 @@ var templates = [
|
|
|
818
819
|
{
|
|
819
820
|
id: "percentage_off_order",
|
|
820
821
|
type: "standard",
|
|
821
|
-
|
|
822
|
-
|
|
822
|
+
titleKey: "promotions.templates.percentageOffOrder.title",
|
|
823
|
+
descriptionKey: "promotions.templates.percentageOffOrder.description",
|
|
823
824
|
hiddenFields: percentageOfOrderHiddenFields,
|
|
824
825
|
defaults: {
|
|
825
826
|
is_automatic: "false",
|
|
@@ -834,8 +835,8 @@ var templates = [
|
|
|
834
835
|
{
|
|
835
836
|
id: "buy_get",
|
|
836
837
|
type: "buy_get",
|
|
837
|
-
|
|
838
|
-
|
|
838
|
+
titleKey: "promotions.templates.buyGet.title",
|
|
839
|
+
descriptionKey: "promotions.templates.buyGet.description",
|
|
839
840
|
hiddenFields: buyGetHiddenFields,
|
|
840
841
|
defaults: {
|
|
841
842
|
is_automatic: "false",
|
|
@@ -851,8 +852,8 @@ var templates = [
|
|
|
851
852
|
{
|
|
852
853
|
id: "shipping_discount",
|
|
853
854
|
type: "standard",
|
|
854
|
-
|
|
855
|
-
|
|
855
|
+
titleKey: "promotions.templates.freeShipping.title",
|
|
856
|
+
descriptionKey: "promotions.templates.freeShipping.description",
|
|
856
857
|
hiddenFields: freeShippingHiddenFields,
|
|
857
858
|
defaults: {
|
|
858
859
|
is_automatic: "false",
|
|
@@ -894,8 +895,8 @@ var Root3 = () => {
|
|
|
894
895
|
RadioGroup2.ChoiceBox,
|
|
895
896
|
{
|
|
896
897
|
value: template.id,
|
|
897
|
-
label: template.
|
|
898
|
-
description: template.
|
|
898
|
+
label: t(template.titleKey),
|
|
899
|
+
description: t(template.descriptionKey),
|
|
899
900
|
"data-testid": `promotion-create-form-template-option-${template.id}`
|
|
900
901
|
},
|
|
901
902
|
template.id
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
PriceListCreateProductsSchema,
|
|
3
3
|
usePriceListCurrencyData,
|
|
4
4
|
usePriceListGridColumns
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YDDD3MK5.js";
|
|
6
6
|
import {
|
|
7
7
|
exctractPricesFromProducts,
|
|
8
8
|
isProductRow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BNOKKKUU.js";
|
|
10
10
|
import {
|
|
11
11
|
useProductTableColumns
|
|
12
12
|
} from "./chunk-D24Q3XHG.js";
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-SMQT3ZNO.js";
|
|
4
4
|
|
|
5
5
|
// src/pages/price-lists/common/utils.ts
|
|
6
|
+
import i18n from "i18next";
|
|
6
7
|
var getValues = (priceList) => {
|
|
7
8
|
const startsAt = priceList.starts_at;
|
|
8
9
|
const endsAt = priceList.ends_at;
|
|
@@ -49,7 +50,7 @@ var extractPricesFromVariants = (variantId, variant, regions) => {
|
|
|
49
50
|
const currencyCode = priceType === "currency" ? id : regions.find((r) => r.id === id)?.currency_code;
|
|
50
51
|
if (!currencyCode) {
|
|
51
52
|
throw new Response(
|
|
52
|
-
JSON.stringify({ message: "
|
|
53
|
+
JSON.stringify({ message: i18n.t("validation.currencyCodeNotFound") }),
|
|
53
54
|
{ status: 400, headers: { "Content-Type": "application/json" } }
|
|
54
55
|
);
|
|
55
56
|
}
|
|
@@ -3664,6 +3664,7 @@ var OrderRemainingOrdersGroupSection = () => {
|
|
|
3664
3664
|
};
|
|
3665
3665
|
var columnHelper = createColumnHelper();
|
|
3666
3666
|
var useColumns = () => {
|
|
3667
|
+
const { t } = useTranslation18();
|
|
3667
3668
|
return useMemo4(
|
|
3668
3669
|
() => [
|
|
3669
3670
|
columnHelper.accessor("display_id", {
|
|
@@ -3672,7 +3673,7 @@ var useColumns = () => {
|
|
|
3672
3673
|
}),
|
|
3673
3674
|
columnHelper.display({
|
|
3674
3675
|
id: "seller",
|
|
3675
|
-
header: () => /* @__PURE__ */ jsx18(TextHeader, { text: "
|
|
3676
|
+
header: () => /* @__PURE__ */ jsx18(TextHeader, { text: t("fields.store") }),
|
|
3676
3677
|
cell: ({ row }) => {
|
|
3677
3678
|
const seller = row.original.seller;
|
|
3678
3679
|
return /* @__PURE__ */ jsx18(TextCell, { text: seller?.name ?? "-" });
|
|
@@ -3701,7 +3702,7 @@ var useColumns = () => {
|
|
|
3701
3702
|
)
|
|
3702
3703
|
})
|
|
3703
3704
|
],
|
|
3704
|
-
[]
|
|
3705
|
+
[t]
|
|
3705
3706
|
);
|
|
3706
3707
|
};
|
|
3707
3708
|
|
|
@@ -82,7 +82,7 @@ var useShippingOptionTableColumns = () => {
|
|
|
82
82
|
}),
|
|
83
83
|
columnHelper.accessor("shipping_profile", {
|
|
84
84
|
header: () => t("fields.shippingProfile"),
|
|
85
|
-
cell: ({ row }) => /* @__PURE__ */ jsx(TextCell, { text: row.original.shipping_profile?.name || "
|
|
85
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(TextCell, { text: row.original.shipping_profile?.name || t("general.notAvailable") })
|
|
86
86
|
}),
|
|
87
87
|
columnHelper.display({
|
|
88
88
|
id: "location",
|
|
@@ -99,14 +99,14 @@ var useShippingOptionTableColumns = () => {
|
|
|
99
99
|
header: () => t("fields.serviceZone"),
|
|
100
100
|
cell: ({ row }) => {
|
|
101
101
|
const serviceZoneName = row.original.service_zone?.name;
|
|
102
|
-
return /* @__PURE__ */ jsx(TextCell, { text: serviceZoneName || "
|
|
102
|
+
return /* @__PURE__ */ jsx(TextCell, { text: serviceZoneName || t("general.notAvailable") });
|
|
103
103
|
}
|
|
104
104
|
}),
|
|
105
105
|
columnHelper.display({
|
|
106
106
|
id: "enabled_in_store",
|
|
107
107
|
header: () => t("fields.enabledInStore"),
|
|
108
108
|
cell: ({ row }) => {
|
|
109
|
-
let text = "
|
|
109
|
+
let text = t("general.notAvailable");
|
|
110
110
|
const val = row.original.rules?.find(
|
|
111
111
|
(r) => r.attribute === "enabled_in_store"
|
|
112
112
|
);
|
|
@@ -120,7 +120,7 @@ var useShippingOptionTableColumns = () => {
|
|
|
120
120
|
id: "is_return",
|
|
121
121
|
header: () => t("fields.isReturn"),
|
|
122
122
|
cell: ({ row }) => {
|
|
123
|
-
let text = "
|
|
123
|
+
let text = t("general.notAvailable");
|
|
124
124
|
const val = row.original.rules?.find(
|
|
125
125
|
(r) => r.attribute === "is_return"
|
|
126
126
|
);
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
PriceListRulesSchema,
|
|
7
7
|
usePriceListCurrencyData,
|
|
8
8
|
usePriceListGridColumns
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YDDD3MK5.js";
|
|
10
10
|
import {
|
|
11
11
|
exctractPricesFromProducts,
|
|
12
12
|
isProductRow
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BNOKKKUU.js";
|
|
14
14
|
import {
|
|
15
15
|
useProductTableColumns
|
|
16
16
|
} from "./chunk-D24Q3XHG.js";
|