@mercurjs/admin 2.1.0-canary.5 → 2.1.0-canary.6
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-LE2WUOTX.js → add-campaign-promotions-VKH6RC3R.js} +3 -3
- package/dist/{adjust-inventory-TCBV3PCL.js → adjust-inventory-NVBPZYOF.js} +1 -1
- package/dist/{api-key-management-detail-LH3I7OZB.js → api-key-management-detail-Q5RBMX4J.js} +4 -3
- package/dist/{api-key-management-sales-channels-SCIDNYW5.js → api-key-management-sales-channels-UGAAKILD.js} +2 -1
- package/dist/{attribute-create-CJBFOEGI.js → attribute-create-IVRJPVG5.js} +1 -1
- package/dist/{attribute-detail-2RDAGHQB.js → attribute-detail-E6ILEV4C.js} +1 -1
- package/dist/{attribute-edit-TDMQJYAP.js → attribute-edit-DRHFOHMK.js} +2 -2
- package/dist/{attribute-list-MK2EUELY.js → attribute-list-SFUKKH25.js} +1 -1
- package/dist/{campaign-detail-GVJ3PO4I.js → campaign-detail-OJF24KXP.js} +5 -5
- package/dist/{categories-metadata-M3GDS27H.js → categories-metadata-YVUNHMQT.js} +1 -1
- package/dist/{category-create-5WS4XGYI.js → category-create-XH6AM3NM.js} +2 -2
- package/dist/{category-detail-TTJ6XGLM.js → category-detail-YELQ7OSB.js} +3 -3
- package/dist/{category-edit-GOB4ASBP.js → category-edit-IXU6E3YT.js} +1 -1
- package/dist/{category-products-NRPWJHDW.js → category-products-G6XFVWWK.js} +2 -2
- package/dist/{chunk-PXZQSL5A.js → chunk-22YCBNLL.js} +1 -1
- package/dist/{chunk-LAN52TLS.js → chunk-3LPDWXLV.js} +1 -1
- package/dist/{chunk-YSGXL7CX.js → chunk-3WQCJEAS.js} +1 -1
- package/dist/{chunk-YFSTGK5R.js → chunk-6BOPJWOS.js} +1 -1
- package/dist/{chunk-GBRUBIGE.js → chunk-6F6T6O6R.js} +1 -1
- package/dist/{chunk-QFOEY6RN.js → chunk-C2GSCU65.js} +5 -63
- package/dist/{chunk-X2X7M3B6.js → chunk-C43DG3K3.js} +1 -1
- package/dist/{chunk-NZN7PFPB.js → chunk-CKNQJPAG.js} +6 -40
- package/dist/{chunk-AQANSGTS.js → chunk-DW7BD2BR.js} +26 -6
- package/dist/{chunk-BH5LSB6O.js → chunk-EV6CDI37.js} +1 -1
- package/dist/{chunk-UROZLRSZ.js → chunk-F2ZHPWHP.js} +1 -1
- package/dist/{chunk-5XENZ4RY.js → chunk-FCQMQF2U.js} +3 -3
- package/dist/{chunk-AVUWXDRQ.js → chunk-G2GB77RC.js} +1 -1
- package/dist/chunk-HJ56YXBU.js +46 -0
- package/dist/{chunk-SIM42VD3.js → chunk-IK6MPP7K.js} +1 -1
- package/dist/{chunk-T3E6EVLQ.js → chunk-IO3TLOTN.js} +1 -1
- package/dist/{chunk-2FLBJM53.js → chunk-LEG67A2R.js} +0 -16
- package/dist/{chunk-TBRKUYQX.js → chunk-LGYQGZNR.js} +1 -1
- package/dist/{chunk-SUQJGDPA.js → chunk-LNAXUDW2.js} +1 -1
- package/dist/{chunk-KZE2BXFZ.js → chunk-M3LFFRPG.js} +1 -1
- package/dist/chunk-MDABSESI.js +38 -0
- package/dist/{chunk-DGSPRILL.js → chunk-MVSHIITK.js} +1 -1
- package/dist/{chunk-LRCMPXIA.js → chunk-NUMAHMW2.js} +1 -1
- package/dist/{chunk-AVW3A7X5.js → chunk-NZ4BXIO6.js} +1 -1
- package/dist/{chunk-N46VH2AV.js → chunk-QONWYA46.js} +1 -1
- package/dist/{chunk-J73MGZ2C.js → chunk-SZO2SCY2.js} +1 -1
- package/dist/{chunk-DKIXS7MS.js → chunk-T3ZRBKEC.js} +179 -200
- package/dist/{chunk-DMWRKJV5.js → chunk-Z4OJNCER.js} +1 -1
- package/dist/{chunk-RXBYBQDN.js → chunk-ZFQ5XQ2W.js} +1 -1
- package/dist/{collection-add-products-V34BC5KZ.js → collection-add-products-VSSL3PJV.js} +2 -2
- package/dist/{collection-create-T3I4AQ6T.js → collection-create-3BTRORHU.js} +1 -1
- package/dist/{collection-detail-FBF245L5.js → collection-detail-AAD4X24M.js} +3 -3
- package/dist/{collection-list-2NU2RHF6.js → collection-list-J32PG7BB.js} +2 -2
- package/dist/{collection-metadata-4CATBMBR.js → collection-metadata-KHGPTV5C.js} +1 -1
- package/dist/{commission-rate-create-BX5ON475.js → commission-rate-create-KTQR4WCZ.js} +3 -3
- package/dist/{commission-rate-detail-2FIUCRWQ.js → commission-rate-detail-7I4M7GOE.js} +1 -1
- package/dist/{commission-rate-edit-QO54ISLU.js → commission-rate-edit-52CJF2EX.js} +3 -3
- package/dist/{customer-detail-X7RDPYCB.js → customer-detail-4J4RSVSG.js} +1 -1
- package/dist/{customer-group-detail-LG45HYN7.js → customer-group-detail-KCKJEPSN.js} +1 -1
- package/dist/{customer-group-list-AKB2QL2I.js → customer-group-list-IQGAXHVE.js} +1 -1
- package/dist/{customer-group-metadata-5EY56USK.js → customer-group-metadata-YJXZFSFG.js} +1 -1
- package/dist/{customer-metadata-UI7VJNBB.js → customer-metadata-SG6M7X3Q.js} +1 -1
- package/dist/{customers-add-customer-group-WXARGETR.js → customers-add-customer-group-ASX6POFR.js} +1 -1
- package/dist/{edit-inventory-item-7LUBIEJG.js → edit-inventory-item-TDG2ZTPM.js} +1 -1
- package/dist/{edit-inventory-item-attributes-GPWA3SHB.js → edit-inventory-item-attributes-T56PJTCT.js} +1 -1
- package/dist/{edit-rules-MOJW3IY6.js → edit-rules-BRXIELG2.js} +1 -1
- package/dist/index.js +153 -153
- package/dist/{inventory-create-G4PFD6IN.js → inventory-create-3GAK5IYZ.js} +1 -1
- package/dist/{inventory-detail-N2YB6A4C.js → inventory-detail-KU5IMRS6.js} +1 -1
- package/dist/{inventory-metadata-R35MGH5G.js → inventory-metadata-LUGA3KNV.js} +1 -1
- package/dist/{inventory-stock-VKNHPP3I.js → inventory-stock-JZNONQAL.js} +1 -1
- package/dist/{location-detail-SHY5JFEP.js → location-detail-RY65FCD3.js} +1 -1
- package/dist/{location-fulfillment-providers-XJWKGU5I.js → location-fulfillment-providers-FNXAQUCV.js} +2 -2
- package/dist/{location-list-B4EVW7LE.js → location-list-XGFUQY7T.js} +1 -1
- package/dist/{location-sales-channels-D5SNTEWM.js → location-sales-channels-IRGVGAVC.js} +2 -1
- package/dist/{location-service-zone-shipping-option-create-VKRDPJY5.js → location-service-zone-shipping-option-create-OOU6YVRS.js} +1 -1
- package/dist/{login-GQ2TKLJX.js → login-T5DP5BZ3.js} +1 -1
- package/dist/{marketplace-detail-D5AXFDDY.js → marketplace-detail-QQ2WZ27G.js} +1 -1
- package/dist/{marketplace-metadata-6E3EUPQR.js → marketplace-metadata-VYCPYFJD.js} +1 -1
- package/dist/{order-create-claim-TASIQWLS.js → order-create-claim-GAGJ7QNH.js} +1 -1
- package/dist/{order-create-edit-AEWAUNSL.js → order-create-edit-R5AK2LPP.js} +1 -1
- package/dist/{order-create-exchange-BZULQKWC.js → order-create-exchange-P3PLSEME.js} +1 -1
- package/dist/{order-create-fulfillment-ZQLJDGCV.js → order-create-fulfillment-BB2FCLAH.js} +1 -1
- package/dist/{order-create-refund-MPWH7PYP.js → order-create-refund-LDODI2AP.js} +1 -1
- package/dist/{order-create-shipment-UDYZFTKL.js → order-create-shipment-7XP6PDTD.js} +1 -1
- package/dist/{order-detail-43QRHVIH.js → order-detail-RL4RFNAM.js} +1 -1
- package/dist/{order-edit-billing-address-6PKPD4GI.js → order-edit-billing-address-C5OLRWHW.js} +2 -2
- package/dist/{order-edit-email-TRDITOOM.js → order-edit-email-AZIA6X5Q.js} +1 -1
- package/dist/{order-edit-shipping-address-RU4NGJNM.js → order-edit-shipping-address-GJMUSOPK.js} +1 -1
- package/dist/{order-list-DNYS57KP.js → order-list-UBH5RRTI.js} +2 -2
- package/dist/{order-metadata-AJZBUN36.js → order-metadata-RXIJOP4V.js} +1 -1
- package/dist/{order-receive-return-D5ZVVYMY.js → order-receive-return-6IU2HGAD.js} +1 -1
- package/dist/{order-request-transfer-DAUOVTRI.js → order-request-transfer-6IZVCHGV.js} +1 -1
- package/dist/pages/index.js +28 -27
- package/dist/{price-list-create-NVCPOU2Y.js → price-list-create-VWLNTKY7.js} +3 -3
- package/dist/{price-list-detail-ANVE56H3.js → price-list-detail-3XN7D2PU.js} +3 -3
- package/dist/{price-list-prices-add-JSWTZXIB.js → price-list-prices-add-YY33AL6G.js} +3 -3
- package/dist/{price-list-prices-edit-5OKGMVHM.js → price-list-prices-edit-WSLGG7VC.js} +1 -1
- package/dist/{product-create-B6OYB6QQ.js → product-create-XCQ2TZ7B.js} +7 -6
- package/dist/{product-create-variant-HVY3YA5T.js → product-create-variant-TJB7NNKY.js} +1 -1
- package/dist/{product-detail-IL6J7IDR.js → product-detail-7T5PLGCJ.js} +1 -1
- package/dist/{product-export-FYASMR3R.js → product-export-773L2V63.js} +2 -2
- package/dist/{product-import-RDTWXZSA.js → product-import-JB7S4EL6.js} +1 -1
- package/dist/{product-list-E26DQCLM.js → product-list-5WTGEHDX.js} +3 -3
- package/dist/{product-media-FAZR34OC.js → product-media-4QKZILIM.js} +2 -2
- package/dist/{product-metadata-RYDY2LBO.js → product-metadata-GJ7C2UJG.js} +1 -1
- package/dist/{product-sales-channels-7HVGLKJQ.js → product-sales-channels-53YVZ5G5.js} +2 -1
- package/dist/{product-stock-NXLCWJ7S.js → product-stock-XB3HKT5G.js} +1 -1
- package/dist/{product-tag-create-5JKOHKHR.js → product-tag-create-PHJICTE4.js} +1 -1
- package/dist/{product-tag-detail-4P36B7AC.js → product-tag-detail-DAVCOGGL.js} +3 -3
- package/dist/{product-tag-edit-QZOCJSA3.js → product-tag-edit-G4UNGXPT.js} +1 -1
- package/dist/{product-tag-list-IOUBMHTR.js → product-tag-list-YBRNLXCK.js} +2 -2
- package/dist/{product-tag-metadata-HDTR5225.js → product-tag-metadata-I4V6CR6Z.js} +1 -1
- package/dist/{product-type-detail-57S6OUU7.js → product-type-detail-JEFUXSFV.js} +3 -3
- package/dist/{product-type-metadata-3XHYM7AO.js → product-type-metadata-KGVRMMTQ.js} +1 -1
- package/dist/{product-variant-detail-Q6V67DO7.js → product-variant-detail-S4DAVZFS.js} +1 -1
- package/dist/{product-variant-edit-7RJL2DWH.js → product-variant-edit-L77HDGTA.js} +1 -1
- package/dist/{product-variant-metadata-QHCUMQCQ.js → product-variant-metadata-HV72UBCP.js} +1 -1
- package/dist/{promotion-create-RISO27OH.js → promotion-create-4ZEXEV4G.js} +1 -1
- package/dist/{promotion-detail-BQOADUXZ.js → promotion-detail-DL52RQ5R.js} +4 -4
- package/dist/{promotion-list-6ILZBIJZ.js → promotion-list-CJJNLF5E.js} +4 -4
- package/dist/{refund-reason-create-RWGVYY7U.js → refund-reason-create-M2CYTCEM.js} +1 -1
- package/dist/{refund-reason-edit-F3AKUO4F.js → refund-reason-edit-M4XBV633.js} +1 -1
- package/dist/{refund-reason-list-LOEY5OHX.js → refund-reason-list-VLARTCJF.js} +1 -1
- package/dist/{region-metadata-S5X464KM.js → region-metadata-4JWOEGTZ.js} +1 -1
- package/dist/{reservation-detail-CGAEHOZ6.js → reservation-detail-X3W6APD5.js} +1 -1
- package/dist/{reservation-metadata-55FYLG45.js → reservation-metadata-JFLJ27A3.js} +1 -1
- package/dist/{reset-password-VQXCSILN.js → reset-password-PCKBFFXR.js} +1 -1
- package/dist/{sales-channel-add-products-UNJBYNPM.js → sales-channel-add-products-ABMGZC7O.js} +2 -2
- package/dist/{sales-channel-detail-C62VVFTT.js → sales-channel-detail-PNWRSILX.js} +3 -3
- package/dist/{sales-channel-list-L233THQV.js → sales-channel-list-QKFVTZ6A.js} +4 -3
- package/dist/{sales-channel-metadata-XL6OAO6S.js → sales-channel-metadata-NDSKXOGH.js} +1 -1
- package/dist/{shipping-option-type-create-KSQX5DHV.js → shipping-option-type-create-MEL24PGH.js} +1 -1
- package/dist/{shipping-option-type-detail-NQFIUIZU.js → shipping-option-type-detail-OAKOWHU7.js} +1 -1
- package/dist/{shipping-option-type-edit-P5JP6TGA.js → shipping-option-type-edit-IVBHURXR.js} +1 -1
- package/dist/{shipping-option-type-list-NMG6FSD7.js → shipping-option-type-list-AB2FPIQS.js} +1 -1
- package/dist/{shipping-profile-metadata-YEKUKBUJ.js → shipping-profile-metadata-UZPX2PHJ.js} +1 -1
- package/dist/{store-address-edit-YHL23NAM.js → store-address-edit-PKIBRFH4.js} +37 -40
- package/dist/{store-bulk-edit-3WUPOXIX.js → store-bulk-edit-HCEEME3D.js} +1 -1
- package/dist/{store-closure-edit-LNMWVVWG.js → store-closure-edit-OK7MTUHY.js} +1 -1
- package/dist/{store-create-TDHCGON2.js → store-create-CUH7NDFG.js} +3 -3
- package/dist/{store-details-6THDNDJB.js → store-details-6EJNLLJU.js} +4 -3
- package/dist/{store-edit-LJKBFRJG.js → store-edit-N2V2Z4UU.js} +36 -17
- package/dist/{store-list-UA2GXT7T.js → store-list-TRXWHGBQ.js} +3 -3
- package/dist/{store-member-invite-K76O2YUD.js → store-member-invite-4GDKCSTT.js} +38 -13
- package/dist/{store-payment-details-edit-VD76VCVF.js → store-payment-details-edit-HOGHZMZC.js} +17 -29
- package/dist/{store-professional-details-edit-3QMC5OGO.js → store-professional-details-edit-DPJ4ZFDR.js} +1 -1
- package/dist/{tax-region-create-NVE7TJVZ.js → tax-region-create-UTSDM5EN.js} +2 -2
- package/dist/{tax-region-detail-6W6ZCFKH.js → tax-region-detail-IIKSTR7V.js} +1 -1
- package/dist/{tax-region-edit-XIQISIV6.js → tax-region-edit-OARZRBVK.js} +1 -1
- package/dist/{tax-region-metadata-C2IM452E.js → tax-region-metadata-XJRFOG7I.js} +1 -1
- package/dist/{tax-region-province-detail-EY77MY5Q.js → tax-region-province-detail-SQHBO2XB.js} +1 -1
- package/dist/{tax-region-tax-override-create-RJSVKZGY.js → tax-region-tax-override-create-WSZTBKMS.js} +3 -3
- package/dist/{tax-region-tax-override-edit-2UZSGMS2.js → tax-region-tax-override-edit-OE4WUDOA.js} +3 -3
- package/dist/{user-metadata-4FOEUIG2.js → user-metadata-376YJMY3.js} +1 -1
- package/package.json +3 -3
- package/dist/chunk-TLE6YHGH.js +0 -26
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
useSeller,
|
|
19
19
|
useUpdateSellerAddress
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LEG67A2R.js";
|
|
21
21
|
import "./chunk-RHKRREUU.js";
|
|
22
22
|
import "./chunk-ZA2KFUFR.js";
|
|
23
23
|
import "./chunk-ZBWL72TB.js";
|
|
@@ -30,19 +30,20 @@ import { useParams } from "react-router-dom";
|
|
|
30
30
|
|
|
31
31
|
// src/pages/stores/store-address-edit/components/store-address-edit-form.tsx
|
|
32
32
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
33
|
+
import i18n from "i18next";
|
|
33
34
|
import { Button, Input, toast } from "@medusajs/ui";
|
|
34
35
|
import { useForm } from "react-hook-form";
|
|
35
36
|
import { useTranslation } from "react-i18next";
|
|
36
37
|
import * as zod from "zod";
|
|
37
38
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
39
|
var StoreAddressSchema = zod.object({
|
|
39
|
-
name: zod.string().min(1),
|
|
40
|
+
name: zod.string().min(1, { message: i18n.t("store.address.validation.nameRequired") }),
|
|
40
41
|
address_1: zod.string().optional().or(zod.literal("")),
|
|
41
42
|
address_2: zod.string().optional().or(zod.literal("")),
|
|
42
43
|
city: zod.string().optional().or(zod.literal("")),
|
|
43
44
|
province: zod.string().optional().or(zod.literal("")),
|
|
44
45
|
postal_code: zod.string().optional().or(zod.literal("")),
|
|
45
|
-
country_code: zod.string().min(2).max(2)
|
|
46
|
+
country_code: zod.string().min(2, { message: i18n.t("store.address.validation.countryRequired") }).max(2)
|
|
46
47
|
});
|
|
47
48
|
var StoreAddressEditForm = ({
|
|
48
49
|
seller
|
|
@@ -76,9 +77,7 @@ var StoreAddressEditForm = ({
|
|
|
76
77
|
},
|
|
77
78
|
{
|
|
78
79
|
onSuccess: () => {
|
|
79
|
-
toast.success(
|
|
80
|
-
t("store.address.edit.successToast")
|
|
81
|
-
);
|
|
80
|
+
toast.success(t("store.address.edit.successToast"));
|
|
82
81
|
handleSuccess();
|
|
83
82
|
},
|
|
84
83
|
onError: (error) => {
|
|
@@ -101,7 +100,7 @@ var StoreAddressEditForm = ({
|
|
|
101
100
|
name: "name",
|
|
102
101
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
103
102
|
/* @__PURE__ */ jsx(Form.Label, { children: t("store.address.nameLabel") }),
|
|
104
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small",
|
|
103
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
105
104
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
106
105
|
] })
|
|
107
106
|
}
|
|
@@ -110,10 +109,10 @@ var StoreAddressEditForm = ({
|
|
|
110
109
|
Form.Field,
|
|
111
110
|
{
|
|
112
111
|
control: form.control,
|
|
113
|
-
name: "
|
|
112
|
+
name: "address_1",
|
|
114
113
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
115
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.
|
|
116
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
114
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.address") }),
|
|
115
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
117
116
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
118
117
|
] })
|
|
119
118
|
}
|
|
@@ -122,9 +121,9 @@ var StoreAddressEditForm = ({
|
|
|
122
121
|
Form.Field,
|
|
123
122
|
{
|
|
124
123
|
control: form.control,
|
|
125
|
-
name: "
|
|
124
|
+
name: "address_2",
|
|
126
125
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
127
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("
|
|
126
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.address.apartmentLabel", "Apartment, suite, etc.") }),
|
|
128
127
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
129
128
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
130
129
|
] })
|
|
@@ -134,40 +133,38 @@ var StoreAddressEditForm = ({
|
|
|
134
133
|
Form.Field,
|
|
135
134
|
{
|
|
136
135
|
control: form.control,
|
|
137
|
-
name: "
|
|
136
|
+
name: "postal_code",
|
|
138
137
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
139
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.
|
|
138
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.postalCode") }),
|
|
140
139
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
141
140
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
142
141
|
] })
|
|
143
142
|
}
|
|
144
143
|
),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
)
|
|
170
|
-
] }),
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
Form.Field,
|
|
146
|
+
{
|
|
147
|
+
control: form.control,
|
|
148
|
+
name: "city",
|
|
149
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
150
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.city") }),
|
|
151
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
152
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
153
|
+
] })
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
Form.Field,
|
|
158
|
+
{
|
|
159
|
+
control: form.control,
|
|
160
|
+
name: "country_code",
|
|
161
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.country") }),
|
|
163
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
|
|
164
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
165
|
+
] })
|
|
166
|
+
}
|
|
167
|
+
),
|
|
171
168
|
/* @__PURE__ */ jsx(
|
|
172
169
|
Form.Field,
|
|
173
170
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HandleInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HJ56YXBU.js";
|
|
4
4
|
import {
|
|
5
5
|
TabbedForm,
|
|
6
6
|
defineTabMeta,
|
|
@@ -36,7 +36,7 @@ import "./chunk-ZN7LWXVC.js";
|
|
|
36
36
|
import "./chunk-VYMODH6P.js";
|
|
37
37
|
import {
|
|
38
38
|
useCreateSeller
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LEG67A2R.js";
|
|
40
40
|
import "./chunk-PRBE5CM3.js";
|
|
41
41
|
import "./chunk-5TRY5IMZ.js";
|
|
42
42
|
import "./chunk-TAKEQAZZ.js";
|
|
@@ -141,7 +141,7 @@ var Root = () => {
|
|
|
141
141
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
142
142
|
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.currency") }),
|
|
143
143
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
144
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("fields.
|
|
144
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("fields.selectPlaceholder", "Select") }) }),
|
|
145
145
|
/* @__PURE__ */ jsx(Select.Content, { children: store?.supported_currencies?.map((sc) => /* @__PURE__ */ jsx(
|
|
146
146
|
Select.Item,
|
|
147
147
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StoreDetailPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T3ZRBKEC.js";
|
|
4
4
|
import "./chunk-DBYUB2YI.js";
|
|
5
5
|
import "./chunk-NOWUEJ74.js";
|
|
6
6
|
import "./chunk-TZSOL34K.js";
|
|
@@ -21,6 +21,7 @@ import "./chunk-KAZ5BYTQ.js";
|
|
|
21
21
|
import "./chunk-3EF54XFY.js";
|
|
22
22
|
import "./chunk-XIZLPYEE.js";
|
|
23
23
|
import "./chunk-IQPN4PZJ.js";
|
|
24
|
+
import "./chunk-MDABSESI.js";
|
|
24
25
|
import "./chunk-INNFZYX2.js";
|
|
25
26
|
import "./chunk-BDGZ4EQO.js";
|
|
26
27
|
import "./chunk-LAVHRER2.js";
|
|
@@ -39,7 +40,7 @@ import "./chunk-PVZBDWLK.js";
|
|
|
39
40
|
import "./chunk-3B6MTW5G.js";
|
|
40
41
|
import "./chunk-VKOE5J66.js";
|
|
41
42
|
import "./chunk-DY3XQPHC.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-LNAXUDW2.js";
|
|
43
44
|
import "./chunk-VVWB3GIK.js";
|
|
44
45
|
import "./chunk-KBYZLKI4.js";
|
|
45
46
|
import "./chunk-YWWUOGJA.js";
|
|
@@ -70,7 +71,7 @@ import "./chunk-VYMODH6P.js";
|
|
|
70
71
|
import {
|
|
71
72
|
sellersQueryKeys,
|
|
72
73
|
useSeller
|
|
73
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-LEG67A2R.js";
|
|
74
75
|
import "./chunk-PRBE5CM3.js";
|
|
75
76
|
import "./chunk-5TRY5IMZ.js";
|
|
76
77
|
import "./chunk-TAKEQAZZ.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HandleInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HJ56YXBU.js";
|
|
4
4
|
import {
|
|
5
5
|
currencies
|
|
6
6
|
} from "./chunk-IQPN4PZJ.js";
|
|
7
7
|
import {
|
|
8
8
|
MediaSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3LPDWXLV.js";
|
|
10
10
|
import "./chunk-UXD3VNBO.js";
|
|
11
11
|
import "./chunk-SMQT3ZNO.js";
|
|
12
12
|
import {
|
|
13
13
|
SwitchBox
|
|
14
14
|
} from "./chunk-2EME4AWX.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-DW7BD2BR.js";
|
|
16
16
|
import "./chunk-TKGWSUEI.js";
|
|
17
17
|
import {
|
|
18
18
|
KeyboundForm
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
useSeller,
|
|
35
35
|
useUpdateSeller
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LEG67A2R.js";
|
|
37
37
|
import "./chunk-RHKRREUU.js";
|
|
38
38
|
import "./chunk-ZA2KFUFR.js";
|
|
39
39
|
import {
|
|
@@ -50,6 +50,7 @@ import { useParams } from "react-router-dom";
|
|
|
50
50
|
|
|
51
51
|
// src/pages/stores/store-edit/components/store-edit-form.tsx
|
|
52
52
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
53
|
+
import i18n from "i18next";
|
|
53
54
|
import { InformationCircleSolid } from "@medusajs/icons";
|
|
54
55
|
import {
|
|
55
56
|
Button,
|
|
@@ -68,10 +69,10 @@ var import_types = __toESM(require_dist(), 1);
|
|
|
68
69
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
69
70
|
var EditStoreSchema = zod.object({
|
|
70
71
|
status: zod.nativeEnum(import_types.SellerStatus),
|
|
71
|
-
name: zod.string().min(1),
|
|
72
|
+
name: zod.string().min(1, { message: i18n.t("stores.create.validation.nameRequired") }),
|
|
72
73
|
description: zod.string().optional().or(zod.literal("")),
|
|
73
74
|
handle: zod.string().optional().or(zod.literal("")),
|
|
74
|
-
email: zod.string().
|
|
75
|
+
email: zod.string().min(1, { message: i18n.t("stores.create.validation.emailRequired") }).email({ message: i18n.t("stores.create.validation.emailInvalid") }),
|
|
75
76
|
phone: zod.string().optional().or(zod.literal("")),
|
|
76
77
|
website_url: zod.string().optional().or(zod.literal("")),
|
|
77
78
|
is_premium: zod.boolean(),
|
|
@@ -94,6 +95,24 @@ var SUPPORTED_FORMATS_FILE_EXTENSIONS = [
|
|
|
94
95
|
".heic",
|
|
95
96
|
".svg"
|
|
96
97
|
];
|
|
98
|
+
var stripWebsiteProtocol = (url) => url ? url.replace(/^https?:\/\//i, "") : "";
|
|
99
|
+
var getFileNameFromUrl = (url) => {
|
|
100
|
+
if (!url || url.startsWith("blob:")) return void 0;
|
|
101
|
+
try {
|
|
102
|
+
const pathname = new URL(url).pathname;
|
|
103
|
+
const last = pathname.split("/").filter(Boolean).pop();
|
|
104
|
+
return last ? decodeURIComponent(last) : void 0;
|
|
105
|
+
} catch {
|
|
106
|
+
const last = url.split("?")[0].split("/").filter(Boolean).pop();
|
|
107
|
+
return last ? decodeURIComponent(last) : void 0;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var ensureWebsiteProtocol = (url) => {
|
|
111
|
+
const trimmed = url.trim();
|
|
112
|
+
if (!trimmed) return null;
|
|
113
|
+
if (/^https?:\/\//i.test(trimmed)) return trimmed;
|
|
114
|
+
return `https://${trimmed}`;
|
|
115
|
+
};
|
|
97
116
|
var StoreEditForm = ({ seller }) => {
|
|
98
117
|
const { t } = useTranslation();
|
|
99
118
|
const { handleSuccess } = useRouteModal();
|
|
@@ -105,7 +124,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
105
124
|
handle: seller.handle ?? "",
|
|
106
125
|
email: seller.email ?? "",
|
|
107
126
|
phone: seller.phone ?? "",
|
|
108
|
-
website_url: seller.website_url
|
|
127
|
+
website_url: stripWebsiteProtocol(seller.website_url),
|
|
109
128
|
is_premium: seller.is_premium ?? false,
|
|
110
129
|
media: seller.logo ? [{ id: "existing-logo", url: seller.logo, isThumbnail: false, file: null }] : [],
|
|
111
130
|
bannerMedia: seller.banner ? [{ id: "existing-banner", url: seller.banner, isThumbnail: false, file: null }] : []
|
|
@@ -155,7 +174,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
155
174
|
email: values.email || void 0,
|
|
156
175
|
phone: values.phone || null,
|
|
157
176
|
description: values.description || null,
|
|
158
|
-
website_url: values.website_url
|
|
177
|
+
website_url: ensureWebsiteProtocol(values.website_url ?? ""),
|
|
159
178
|
is_premium: values.is_premium,
|
|
160
179
|
logo: logoUrl,
|
|
161
180
|
banner: bannerUrl
|
|
@@ -302,7 +321,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
302
321
|
name: "website_url",
|
|
303
322
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
304
323
|
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.website") }),
|
|
305
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(HandleInput, { ...field }) }),
|
|
324
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(HandleInput, { prefix: "https://", ...field }) }),
|
|
306
325
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
307
326
|
] })
|
|
308
327
|
}
|
|
@@ -324,6 +343,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
324
343
|
description: t("stores.premium.description")
|
|
325
344
|
}
|
|
326
345
|
),
|
|
346
|
+
/* @__PURE__ */ jsx("div", { className: "border-ui-border-base border-t" }),
|
|
327
347
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
328
348
|
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("stores.edit.mediaHeading") }),
|
|
329
349
|
/* @__PURE__ */ jsx(
|
|
@@ -340,7 +360,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
340
360
|
FileUpload,
|
|
341
361
|
{
|
|
342
362
|
uploadedImage: previewUrl,
|
|
343
|
-
fileName: logoFile?.file?.name,
|
|
363
|
+
fileName: logoFile?.file?.name ?? getFileNameFromUrl(logoFile?.url),
|
|
344
364
|
fileSize: logoFile?.file?.size,
|
|
345
365
|
multiple: false,
|
|
346
366
|
label: t("products.media.uploadImagesLabel"),
|
|
@@ -370,7 +390,7 @@ var StoreEditForm = ({ seller }) => {
|
|
|
370
390
|
FileUpload,
|
|
371
391
|
{
|
|
372
392
|
uploadedImage: previewUrl,
|
|
373
|
-
fileName: bannerFile?.file?.name,
|
|
393
|
+
fileName: bannerFile?.file?.name ?? getFileNameFromUrl(bannerFile?.url),
|
|
374
394
|
fileSize: bannerFile?.file?.size,
|
|
375
395
|
multiple: false,
|
|
376
396
|
label: t("products.media.uploadImagesLabel"),
|
|
@@ -386,12 +406,11 @@ var StoreEditForm = ({ seller }) => {
|
|
|
386
406
|
}
|
|
387
407
|
}
|
|
388
408
|
),
|
|
389
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-
|
|
390
|
-
/* @__PURE__ */ jsx(InformationCircleSolid, { className: "text-ui-fg-
|
|
391
|
-
/* @__PURE__ */ jsxs(
|
|
392
|
-
/* @__PURE__ */ jsx("
|
|
393
|
-
" ",
|
|
394
|
-
t("stores.edit.mediaTipBody")
|
|
409
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-component shadow-elevation-card-rest flex items-start gap-x-2 rounded-lg px-4 py-3", children: [
|
|
410
|
+
/* @__PURE__ */ jsx(InformationCircleSolid, { className: "text-ui-fg-interactive mt-[2px]" }),
|
|
411
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-0.5", children: [
|
|
412
|
+
/* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", className: "text-ui-fg-base", children: t("stores.edit.mediaTipLabel") }),
|
|
413
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("stores.edit.mediaTipBody") })
|
|
395
414
|
] })
|
|
396
415
|
] })
|
|
397
416
|
] })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StoreListPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C2GSCU65.js";
|
|
4
4
|
import "./chunk-25LYVP3C.js";
|
|
5
5
|
import "./chunk-DB6ANJBO.js";
|
|
6
6
|
import "./chunk-PHOCVOZ5.js";
|
|
@@ -37,7 +37,7 @@ import "./chunk-PVZBDWLK.js";
|
|
|
37
37
|
import "./chunk-3B6MTW5G.js";
|
|
38
38
|
import "./chunk-VKOE5J66.js";
|
|
39
39
|
import "./chunk-DY3XQPHC.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-LNAXUDW2.js";
|
|
41
41
|
import "./chunk-VVWB3GIK.js";
|
|
42
42
|
import "./chunk-KBYZLKI4.js";
|
|
43
43
|
import "./chunk-YWWUOGJA.js";
|
|
@@ -63,7 +63,7 @@ import "./chunk-DBNPVU3L.js";
|
|
|
63
63
|
import "./chunk-U7WZYWGA.js";
|
|
64
64
|
import "./chunk-ZN7LWXVC.js";
|
|
65
65
|
import "./chunk-VYMODH6P.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-LEG67A2R.js";
|
|
67
67
|
import "./chunk-PRBE5CM3.js";
|
|
68
68
|
import "./chunk-5TRY5IMZ.js";
|
|
69
69
|
import "./chunk-TAKEQAZZ.js";
|
|
@@ -17,8 +17,10 @@ import {
|
|
|
17
17
|
} from "./chunk-WJJXUXSO.js";
|
|
18
18
|
import {
|
|
19
19
|
useAddSellerMember,
|
|
20
|
-
useInviteSellerMember
|
|
21
|
-
|
|
20
|
+
useInviteSellerMember,
|
|
21
|
+
useSellerInvites,
|
|
22
|
+
useSellerMembers
|
|
23
|
+
} from "./chunk-LEG67A2R.js";
|
|
22
24
|
import "./chunk-RHKRREUU.js";
|
|
23
25
|
import "./chunk-ZA2KFUFR.js";
|
|
24
26
|
import "./chunk-ZBWL72TB.js";
|
|
@@ -32,6 +34,7 @@ import { useTranslation as useTranslation2 } from "react-i18next";
|
|
|
32
34
|
|
|
33
35
|
// src/pages/stores/store-member-invite/components/invite-member-form.tsx
|
|
34
36
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
37
|
+
import i18n from "i18next";
|
|
35
38
|
import { Button, Input, Select, Text, clx, toast } from "@medusajs/ui";
|
|
36
39
|
import { useMemo, useState } from "react";
|
|
37
40
|
import { useForm } from "react-hook-form";
|
|
@@ -57,8 +60,8 @@ var ROLE_OPTIONS = [
|
|
|
57
60
|
{ value: import_types.SellerRole.SUPPORT, labelKey: "users.roles.support" }
|
|
58
61
|
];
|
|
59
62
|
var InviteMemberSchema = zod.object({
|
|
60
|
-
email: zod.string().email(),
|
|
61
|
-
role_id: zod.string().min(1)
|
|
63
|
+
email: zod.string().min(1, { message: i18n.t("stores.create.validation.emailRequired") }).email({ message: i18n.t("stores.create.validation.emailInvalid") }),
|
|
64
|
+
role_id: zod.string().min(1, { message: i18n.t("stores.members.addUser.validation.roleRequired") })
|
|
62
65
|
});
|
|
63
66
|
var InviteMemberForm = () => {
|
|
64
67
|
const { t } = useTranslation();
|
|
@@ -70,6 +73,8 @@ var InviteMemberForm = () => {
|
|
|
70
73
|
email: "",
|
|
71
74
|
role_id: ""
|
|
72
75
|
},
|
|
76
|
+
mode: "onSubmit",
|
|
77
|
+
reValidateMode: "onSubmit",
|
|
73
78
|
resolver: zodResolver(InviteMemberSchema)
|
|
74
79
|
});
|
|
75
80
|
const emailValue = form.watch("email");
|
|
@@ -77,10 +82,32 @@ var InviteMemberForm = () => {
|
|
|
77
82
|
{ q: emailValue || void 0, limit: 10 },
|
|
78
83
|
{ placeholderData: (prev) => prev }
|
|
79
84
|
);
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
);
|
|
85
|
+
const { seller_members: currentMembers } = useSellerMembers(id, {
|
|
86
|
+
limit: 100,
|
|
87
|
+
offset: 0
|
|
88
|
+
});
|
|
89
|
+
const { member_invites: pendingInvites } = useSellerInvites(id);
|
|
90
|
+
const existingEmails = useMemo(() => {
|
|
91
|
+
const emails = /* @__PURE__ */ new Set();
|
|
92
|
+
(currentMembers ?? []).forEach((sm) => {
|
|
93
|
+
const email = sm.member?.email;
|
|
94
|
+
if (email) {
|
|
95
|
+
emails.add(email.toLowerCase());
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
(pendingInvites ?? []).filter((invite) => !invite.accepted).forEach((invite) => {
|
|
99
|
+
if (invite.email) {
|
|
100
|
+
emails.add(invite.email.toLowerCase());
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return emails;
|
|
104
|
+
}, [currentMembers, pendingInvites]);
|
|
105
|
+
const memberList = useMemo(() => {
|
|
106
|
+
const all = members ?? [];
|
|
107
|
+
return all.filter(
|
|
108
|
+
(m) => !existingEmails.has(m.email.toLowerCase())
|
|
109
|
+
);
|
|
110
|
+
}, [members, existingEmails]);
|
|
84
111
|
const { mutateAsync: inviteMember, isPending: isInviting } = useInviteSellerMember(id);
|
|
85
112
|
const { mutateAsync: addMember, isPending: isAdding } = useAddSellerMember(
|
|
86
113
|
id
|
|
@@ -96,15 +123,13 @@ var InviteMemberForm = () => {
|
|
|
96
123
|
member_id: matched.id,
|
|
97
124
|
role_id: values.role_id
|
|
98
125
|
});
|
|
99
|
-
toast.success(
|
|
100
|
-
t("stores.members.addUser.assignSuccess", { email: values.email })
|
|
101
|
-
);
|
|
126
|
+
toast.success(t("stores.members.addUser.addedToast"));
|
|
102
127
|
} else {
|
|
103
128
|
await inviteMember({
|
|
104
129
|
email: values.email,
|
|
105
130
|
role_id: values.role_id
|
|
106
131
|
});
|
|
107
|
-
toast.success(t("
|
|
132
|
+
toast.success(t("stores.members.addUser.invitedToast"));
|
|
108
133
|
}
|
|
109
134
|
handleSuccess();
|
|
110
135
|
} catch (error) {
|
|
@@ -174,7 +199,7 @@ var InviteMemberForm = () => {
|
|
|
174
199
|
render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
175
200
|
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.role") }),
|
|
176
201
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
|
|
177
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("
|
|
202
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("fields.selectPlaceholder", "Select") }) }),
|
|
178
203
|
/* @__PURE__ */ jsx(Select.Content, { children: ROLE_OPTIONS.map((role) => /* @__PURE__ */ jsx(Select.Item, { value: role.value, children: t(role.labelKey) }, role.value)) })
|
|
179
204
|
] }) }),
|
|
180
205
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
package/dist/{store-payment-details-edit-VD76VCVF.js → store-payment-details-edit-HOGHZMZC.js}
RENAMED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
useSeller,
|
|
18
18
|
useUpdateSellerPaymentDetails
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LEG67A2R.js";
|
|
20
20
|
import "./chunk-RHKRREUU.js";
|
|
21
21
|
import "./chunk-ZA2KFUFR.js";
|
|
22
22
|
import "./chunk-ZBWL72TB.js";
|
|
@@ -29,15 +29,19 @@ import { useParams } from "react-router-dom";
|
|
|
29
29
|
|
|
30
30
|
// src/pages/stores/store-payment-details-edit/components/store-payment-details-form.tsx
|
|
31
31
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
32
|
+
import i18n from "i18next";
|
|
32
33
|
import { Button, Input, toast } from "@medusajs/ui";
|
|
33
34
|
import { useForm } from "react-hook-form";
|
|
34
35
|
import { useTranslation } from "react-i18next";
|
|
35
36
|
import * as zod from "zod";
|
|
36
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
37
38
|
var StorePaymentDetailsSchema = zod.object({
|
|
38
|
-
country_code: zod.string().min(1
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
country_code: zod.string().min(1, {
|
|
40
|
+
message: i18n.t("store.paymentDetails.validation.countryRequired")
|
|
41
|
+
}),
|
|
42
|
+
holder_name: zod.string().min(1, {
|
|
43
|
+
message: i18n.t("store.paymentDetails.validation.accountNameRequired")
|
|
44
|
+
}),
|
|
41
45
|
iban: zod.string().optional().or(zod.literal("")),
|
|
42
46
|
bic: zod.string().optional().or(zod.literal("")),
|
|
43
47
|
routing_number: zod.string().optional().or(zod.literal("")),
|
|
@@ -53,7 +57,6 @@ var StorePaymentDetailsForm = ({
|
|
|
53
57
|
defaultValues: {
|
|
54
58
|
country_code: details?.country_code ?? "",
|
|
55
59
|
holder_name: details?.holder_name ?? "",
|
|
56
|
-
bank_name: details?.bank_name ?? "",
|
|
57
60
|
iban: details?.iban ?? "",
|
|
58
61
|
bic: details?.bic ?? "",
|
|
59
62
|
routing_number: details?.routing_number ?? "",
|
|
@@ -69,7 +72,6 @@ var StorePaymentDetailsForm = ({
|
|
|
69
72
|
{
|
|
70
73
|
country_code: values.country_code,
|
|
71
74
|
holder_name: values.holder_name,
|
|
72
|
-
bank_name: values.bank_name || null,
|
|
73
75
|
iban: isABA ? null : values.iban || null,
|
|
74
76
|
bic: isABA ? null : values.bic || null,
|
|
75
77
|
routing_number: isABA ? values.routing_number || null : null,
|
|
@@ -77,9 +79,7 @@ var StorePaymentDetailsForm = ({
|
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
onSuccess: () => {
|
|
80
|
-
toast.success(
|
|
81
|
-
t("store.paymentDetails.edit.successToast")
|
|
82
|
-
);
|
|
82
|
+
toast.success(t("store.paymentDetails.edit.successToast"));
|
|
83
83
|
handleSuccess();
|
|
84
84
|
},
|
|
85
85
|
onError: (error) => {
|
|
@@ -119,26 +119,14 @@ var StorePaymentDetailsForm = ({
|
|
|
119
119
|
] })
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
Form.Field,
|
|
124
|
-
{
|
|
125
|
-
control: form.control,
|
|
126
|
-
name: "bank_name",
|
|
127
|
-
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
128
|
-
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.bankName") }),
|
|
129
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
130
|
-
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
131
|
-
] })
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
selectedCountry === "us" ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
122
|
+
selectedCountry === "us" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
123
|
/* @__PURE__ */ jsx(
|
|
136
124
|
Form.Field,
|
|
137
125
|
{
|
|
138
126
|
control: form.control,
|
|
139
127
|
name: "account_number",
|
|
140
128
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
141
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.paymentDetails.fields.accountNumber") }),
|
|
129
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.accountNumber") }),
|
|
142
130
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
143
131
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
144
132
|
] })
|
|
@@ -150,20 +138,20 @@ var StorePaymentDetailsForm = ({
|
|
|
150
138
|
control: form.control,
|
|
151
139
|
name: "routing_number",
|
|
152
140
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
153
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.paymentDetails.fields.achRoutingNumber") }),
|
|
141
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.achRoutingNumber") }),
|
|
154
142
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
155
143
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
156
144
|
] })
|
|
157
145
|
}
|
|
158
146
|
)
|
|
159
|
-
] }) : /* @__PURE__ */ jsxs(
|
|
147
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
160
148
|
/* @__PURE__ */ jsx(
|
|
161
149
|
Form.Field,
|
|
162
150
|
{
|
|
163
151
|
control: form.control,
|
|
164
152
|
name: "iban",
|
|
165
153
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
166
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.paymentDetails.fields.iban") }),
|
|
154
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.iban") }),
|
|
167
155
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
168
156
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
169
157
|
] })
|
|
@@ -175,7 +163,7 @@ var StorePaymentDetailsForm = ({
|
|
|
175
163
|
control: form.control,
|
|
176
164
|
name: "account_number",
|
|
177
165
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
178
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.paymentDetails.fields.accountNumber") }),
|
|
166
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.accountNumber") }),
|
|
179
167
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
180
168
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
181
169
|
] })
|
|
@@ -187,7 +175,7 @@ var StorePaymentDetailsForm = ({
|
|
|
187
175
|
control: form.control,
|
|
188
176
|
name: "bic",
|
|
189
177
|
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
190
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.paymentDetails.fields.swiftBic") }),
|
|
178
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("store.paymentDetails.fields.swiftBic") }),
|
|
191
179
|
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
192
180
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
193
181
|
] })
|