@mercurjs/admin 2.2.0 → 2.2.1-canary.1
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-KXVCLUG2.js → add-campaign-promotions-ARQN65B6.js} +9 -8
- package/dist/{adjust-inventory-5ZJJUEMJ.js → adjust-inventory-4ZOZCMSO.js} +10 -10
- package/dist/{api-key-management-create-OXI6OTIU.js → api-key-management-create-KJAP6KDX.js} +3 -3
- package/dist/{api-key-management-detail-ZTFHZK2W.js → api-key-management-detail-RV5Q45EV.js} +12 -12
- package/dist/{api-key-management-edit-QF5SAQE5.js → api-key-management-edit-N75HXUJF.js} +3 -3
- package/dist/{api-key-management-list-44HTIZDU.js → api-key-management-list-NGPTRNEE.js} +6 -6
- package/dist/{api-key-management-sales-channels-7HNHPB4N.js → api-key-management-sales-channels-A5F3D42D.js} +4 -4
- package/dist/{attribute-create-AGLZ6QOX.js → attribute-create-WDI2GMPM.js} +15 -15
- package/dist/{attribute-detail-62HLJFM3.js → attribute-detail-ZNPHAIL7.js} +18 -18
- package/dist/{attribute-edit-ZJS7KNRQ.js → attribute-edit-LBMZVL3O.js} +2 -2
- package/dist/{attribute-edit-possible-value-XK6DK7C3.js → attribute-edit-possible-value-RWG3U7IG.js} +2 -2
- package/dist/{attribute-list-VKAQ6254.js → attribute-list-QXNNF3NN.js} +13 -13
- package/dist/{breadcrumb-OF67XUWE.js → breadcrumb-2NHCSFUI.js} +1 -1
- package/dist/{campaign-budget-edit-TCWGNELH.js → campaign-budget-edit-7NXMWE2S.js} +1 -1
- package/dist/{campaign-configuration-AFGSG3MV.js → campaign-configuration-67I6NQNR.js} +1 -1
- package/dist/{campaign-create-OZV25GTH.js → campaign-create-NCJ4NA2B.js} +2 -2
- package/dist/{campaign-detail-G7DKPI5W.js → campaign-detail-MM5I4RGN.js} +18 -18
- package/dist/{campaign-edit-F6V6FWKS.js → campaign-edit-Z6A5J2G4.js} +1 -1
- package/dist/{campaign-list-QMEX7LES.js → campaign-list-FHPFFEM5.js} +4 -4
- package/dist/{categories-metadata-EKGY5IY2.js → categories-metadata-UN7P2PDA.js} +10 -10
- package/dist/{category-create-K452J7D3.js → category-create-3F6PHBRW.js} +3 -3
- package/dist/{category-detail-HUZ7MHT5.js → category-detail-RSGX5IKI.js} +18 -18
- package/dist/{category-edit-KP2ZSV6X.js → category-edit-YIGHQ442.js} +2 -2
- package/dist/{category-icon-edit-NNA7WVQV.js → category-icon-edit-6ZVXC4ID.js} +2 -2
- package/dist/{category-list-PXL4RTYP.js → category-list-SUER3DE3.js} +6 -6
- package/dist/{category-media-RFMA5Y5K.js → category-media-IEIIXESO.js} +2 -2
- package/dist/{category-organize-NNIYSZJT.js → category-organize-7QJ4MAA4.js} +2 -2
- package/dist/{category-products-RR5RFHYX.js → category-products-NOZYZHP7.js} +16 -16
- package/dist/chunk-2IDWFEKH.js +30 -0
- package/dist/{chunk-GS7VNGVP.js → chunk-2W4YIJYV.js} +1 -1
- package/dist/{chunk-4EM4RG5L.js → chunk-34AHGPLC.js} +1 -1
- package/dist/{chunk-46WFUTZ7.js → chunk-3FOZERFM.js} +4 -4
- package/dist/{chunk-XQ5IRC23.js → chunk-3PWLO7XZ.js} +4 -4
- package/dist/{chunk-TBZRRZP2.js → chunk-3RM44AH4.js} +2 -2
- package/dist/{chunk-GPACCA4B.js → chunk-4DHTLLPG.js} +2 -2
- package/dist/{chunk-XYLQODIX.js → chunk-4DWSG7TM.js} +2 -2
- package/dist/{chunk-6FZTLQKQ.js → chunk-4JNQHJKX.js} +4 -4
- package/dist/{chunk-52KJSIHS.js → chunk-4UQMRTSC.js} +1393 -1359
- package/dist/{chunk-BAW3F2JM.js → chunk-52C7Q74T.js} +2 -2
- package/dist/{chunk-FEEYWP65.js → chunk-5346HYMP.js} +1 -1
- package/dist/{chunk-2TTWEY5U.js → chunk-53KPM2IF.js} +1 -1
- package/dist/{chunk-EU2CV4TC.js → chunk-5P2YBCU4.js} +1 -1
- package/dist/{chunk-ZYW5QC2S.js → chunk-5SJGXU6J.js} +1 -1
- package/dist/{chunk-H6PRFXGU.js → chunk-5WJ6LPXM.js} +1 -1
- package/dist/{chunk-4TW5RTWO.js → chunk-5YT4OYMI.js} +2 -2
- package/dist/{chunk-IEYTK56D.js → chunk-6AUFNHJ4.js} +1 -1
- package/dist/{chunk-Z6KZDJNZ.js → chunk-6C5EXVG7.js} +4 -4
- package/dist/{chunk-N2WNCZLR.js → chunk-6L6HRSV7.js} +2 -2
- package/dist/{chunk-MSUG6ERE.js → chunk-6ZVLQ4IK.js} +3 -3
- package/dist/{chunk-WRAOTX6G.js → chunk-AJJSAJWK.js} +8 -4
- package/dist/{chunk-PQYZXLKV.js → chunk-AYK22LJU.js} +3 -3
- package/dist/{chunk-NHKZJMNX.js → chunk-BEHI3OYC.js} +2 -2
- package/dist/{chunk-XH2SXM7F.js → chunk-BIMJMDKU.js} +1 -1
- package/dist/{chunk-NGKC43E3.js → chunk-BNT2LEY5.js} +4 -4
- package/dist/{chunk-LAS6SXKB.js → chunk-C3SCJHQN.js} +1 -1
- package/dist/{chunk-3WT5O2NN.js → chunk-COH2G4BO.js} +2 -2
- package/dist/{chunk-LEHORJ76.js → chunk-CZN2FPHR.js} +1 -1
- package/dist/{chunk-TDDEAQ3T.js → chunk-EJNYP4ZP.js} +286 -229
- package/dist/{chunk-6QXSN5IG.js → chunk-EKLQ3PFC.js} +1 -1
- package/dist/{chunk-L2HIQAOS.js → chunk-EXZFNGEH.js} +11 -1
- package/dist/{chunk-CRKA4PUH.js → chunk-F5TGLYES.js} +3 -3
- package/dist/{chunk-PZRHF4NZ.js → chunk-FGHHNTWJ.js} +1 -1
- package/dist/{chunk-Y5RHBN7J.js → chunk-FRUJ3RNF.js} +1 -1
- package/dist/{chunk-P73BQ56H.js → chunk-GAHJUTEI.js} +6 -6
- package/dist/{chunk-D24Q3XHG.js → chunk-GBSL5JTZ.js} +1 -1
- package/dist/{chunk-IHO6OGWR.js → chunk-GINON6FD.js} +1 -1
- package/dist/{chunk-5JHHADVY.js → chunk-GUXBEXAN.js} +1 -1
- package/dist/{chunk-6RMCSQBI.js → chunk-GXKT2GQ7.js} +445 -211
- package/dist/{chunk-6XYDJWNG.js → chunk-GXYCGT7P.js} +1 -1
- package/dist/{chunk-4EBW73IY.js → chunk-GYMFTVB4.js} +1 -1
- package/dist/{chunk-U7XBLL2L.js → chunk-H3PH7ZYY.js} +5 -5
- package/dist/{chunk-HC2TEEKQ.js → chunk-HKHDRY5B.js} +4 -1
- package/dist/{chunk-IB7PFZNA.js → chunk-HRDRZOL4.js} +2 -2
- package/dist/{chunk-XIB2KDE7.js → chunk-HRPM4HIB.js} +1 -1
- package/dist/{chunk-QYPNC3U5.js → chunk-IPC6RQQ7.js} +1 -1
- package/dist/{chunk-QSB2PR6Y.js → chunk-IWS4FEAA.js} +3 -3
- package/dist/{chunk-GRFWCCUW.js → chunk-IZYVY2QV.js} +1 -1
- package/dist/{chunk-ICAXGUPY.js → chunk-J37PJ6OX.js} +15 -44
- package/dist/chunk-JU5ALCEN.js +82 -0
- package/dist/{chunk-7CAQDCJ4.js → chunk-JZZLMXG4.js} +1 -1
- package/dist/{chunk-PYNVCRQK.js → chunk-K4LPEHOH.js} +1 -1
- package/dist/{chunk-3C5EMQWG.js → chunk-LKGRPE3Y.js} +4 -4
- package/dist/{chunk-VWT7NSJO.js → chunk-LU7SPDKK.js} +89 -252
- package/dist/{chunk-YCAPN5F6.js → chunk-LUPIJMZB.js} +56 -26
- package/dist/{chunk-S2ZNHDPO.js → chunk-MUAEOX6S.js} +6 -6
- package/dist/{chunk-YBMTMG47.js → chunk-MXLSIF5V.js} +1 -1
- package/dist/{chunk-XVHXE7GQ.js → chunk-MXVWKV4Z.js} +2 -2
- package/dist/{chunk-JXMEDALI.js → chunk-MZNO6GSW.js} +1 -1
- package/dist/{chunk-7LSEDXCB.js → chunk-NGJUDYMP.js} +1 -1
- package/dist/{chunk-QF22CPST.js → chunk-NSCHKQQL.js} +4 -4
- package/dist/{chunk-O4X3FYQ2.js → chunk-NUD4H2VZ.js} +2 -2
- package/dist/{chunk-QD5I3ZC4.js → chunk-OADEOZJ3.js} +6 -6
- package/dist/{chunk-GSWFRYKT.js → chunk-OPIRMBSK.js} +5 -5
- package/dist/{chunk-O3Q2YJNR.js → chunk-OT323T4H.js} +5 -5
- package/dist/{chunk-SZCQUPC6.js → chunk-OY5QD46V.js} +1 -1
- package/dist/{chunk-HI2UJ43B.js → chunk-OZEICR2S.js} +3 -3
- package/dist/{chunk-CC7MG2B7.js → chunk-PBIJMBAE.js} +2 -2
- package/dist/{chunk-EDCGEQ4V.js → chunk-PEPANIBF.js} +1 -1
- package/dist/{chunk-EITNWVKQ.js → chunk-PVNB7ETQ.js} +1 -1
- package/dist/{chunk-ZNEC7NSD.js → chunk-PW64YRH4.js} +9 -9
- package/dist/{chunk-QRN63LUS.js → chunk-QE57IFSR.js} +1 -20
- package/dist/{chunk-R6433WFI.js → chunk-QMEFPNCA.js} +1 -1
- package/dist/{chunk-2O6SLX2J.js → chunk-R55WKWFH.js} +1 -1
- package/dist/{chunk-BVVZLZBO.js → chunk-R7Q23SWH.js} +3 -3
- package/dist/{chunk-4OMNDHD2.js → chunk-RDDZLUKZ.js} +18 -12
- package/dist/{chunk-AQCA7HGL.js → chunk-RKGGKEPI.js} +5 -5
- package/dist/{chunk-42BAC3EV.js → chunk-RLOKMTTN.js} +11 -0
- package/dist/{chunk-6TJPMF7U.js → chunk-RPWO23NX.js} +2 -2
- package/dist/{chunk-FU6XA7IT.js → chunk-SNRPPG3Z.js} +3 -3
- package/dist/{chunk-LZSUKT5X.js → chunk-TF74ITJS.js} +6 -6
- package/dist/{chunk-UCA7UES2.js → chunk-U4BIWWRA.js} +1 -1
- package/dist/{chunk-I6T244NF.js → chunk-U6EIJREE.js} +1 -1
- package/dist/{chunk-XRSHPAED.js → chunk-UNNSF2VP.js} +1 -1
- package/dist/chunk-UST2RGWB.js +37 -0
- package/dist/{chunk-KX6C5FDB.js → chunk-V52NWX56.js} +1 -1
- package/dist/{chunk-7PPT3477.js → chunk-VBEQXZ2Z.js} +19 -10
- package/dist/{chunk-J5CQ6F6U.js → chunk-VKHGNAFW.js} +1 -1
- package/dist/{chunk-LNBYVXJX.js → chunk-VQN77LKF.js} +59 -10
- package/dist/{chunk-NLLX6JO6.js → chunk-WE4RBSHT.js} +3 -3
- package/dist/{chunk-XJAMGFC5.js → chunk-WIFK6L7P.js} +2 -2
- package/dist/{chunk-HPFFEXS6.js → chunk-WJJBIAJI.js} +2 -2
- package/dist/{chunk-5NC3VFXY.js → chunk-WR3WSUIV.js} +1 -1
- package/dist/{chunk-GNBUH5DG.js → chunk-WX5UZZZD.js} +1 -1
- package/dist/{chunk-GTFDJLHW.js → chunk-Y2UMDTV4.js} +22 -17
- package/dist/{chunk-HEXXU3V3.js → chunk-Y3IDGFA4.js} +3 -3
- package/dist/{chunk-CRHUF6Q6.js → chunk-YG65LX2W.js} +2 -2
- package/dist/{chunk-QHVRUP4S.js → chunk-YNPIZEWG.js} +2 -2
- package/dist/{chunk-4XRTTHJZ.js → chunk-YTBPZ5MO.js} +1 -1
- package/dist/{collection-add-products-CJEX5A53.js → collection-add-products-HPEJTRYI.js} +16 -16
- package/dist/{collection-create-TBEK75Y3.js → collection-create-3ZCR6VGP.js} +2 -2
- package/dist/{collection-detail-H2Q6WOUM.js → collection-detail-W6CGGW5S.js} +17 -17
- package/dist/{collection-edit-7RBQZNQ6.js → collection-edit-LIIDFJ6T.js} +2 -2
- package/dist/{collection-icon-edit-JQZXC2S3.js → collection-icon-edit-GMWBV5EA.js} +2 -2
- package/dist/{collection-list-ZMDJT77J.js → collection-list-AFDLBBLJ.js} +18 -18
- package/dist/{collection-media-H3CQH6DM.js → collection-media-FHD3IAES.js} +2 -2
- package/dist/{collection-metadata-7FOQ22FA.js → collection-metadata-PEBMVFM3.js} +10 -10
- package/dist/{commission-rule-detail-ISEXGPY6.js → commission-rule-detail-FSV6PA6Y.js} +4 -4
- package/dist/{commissions-list-OJ44UKGL.js → commissions-list-PRA3DROC.js} +6 -6
- package/dist/{customer-detail-LB5A5RDI.js → customer-detail-Z63YC3CC.js} +14 -14
- package/dist/{customer-group-add-customers-DK32GSHX.js → customer-group-add-customers-ZROAA2ZG.js} +2 -2
- package/dist/{customer-group-detail-TABEQDDU.js → customer-group-detail-K6TMJ66E.js} +13 -13
- package/dist/{customer-group-list-FLSK5QJD.js → customer-group-list-TJFAFJJA.js} +13 -13
- package/dist/{customer-group-metadata-V5S6BIXN.js → customer-group-metadata-2GHR645Q.js} +10 -10
- package/dist/{customer-list-E72FR2HJ.js → customer-list-BK2SAQES.js} +3 -3
- package/dist/{customer-metadata-4LLZ4ZMR.js → customer-metadata-H2BVMMPM.js} +10 -10
- package/dist/{customers-add-customer-group-FCZYSHXJ.js → customers-add-customer-group-YFNPS2EL.js} +12 -12
- package/dist/{edit-inventory-item-46KQFZVA.js → edit-inventory-item-DD5ZG32Y.js} +10 -10
- package/dist/{edit-inventory-item-attributes-ELHT4C2Y.js → edit-inventory-item-attributes-VNLOF6NO.js} +10 -10
- package/dist/{edit-reservation-PCKNMHXC.js → edit-reservation-CA6SMY3V.js} +2 -2
- package/dist/{edit-rules-GDQHJ3YV.js → edit-rules-F42247KN.js} +20 -12
- package/dist/extension-targets.d.ts +2 -2
- package/dist/index.css +14 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +215 -215
- package/dist/{inventory-create-POFYTZXF.js → inventory-create-VDO4OWZJ.js} +11 -11
- package/dist/{inventory-detail-BKRLIEBM.js → inventory-detail-CBGHNIHH.js} +13 -13
- package/dist/{inventory-list-FEV27NU6.js → inventory-list-YRGVDHKT.js} +4 -4
- package/dist/{inventory-metadata-63TI6TPT.js → inventory-metadata-SVEEQKIY.js} +10 -10
- package/dist/{inventory-stock-KUNNVL4K.js → inventory-stock-3WSWPSMT.js} +10 -10
- package/dist/{loader-MD6G3UZA.js → loader-5VHWG2HX.js} +1 -1
- package/dist/{location-detail-MHJK22BY.js → location-detail-TIHXQBZW.js} +12 -12
- package/dist/{location-fulfillment-providers-5LMLVCH3.js → location-fulfillment-providers-XULTKWDA.js} +16 -16
- package/dist/{location-list-DRCT7MJW.js → location-list-4RNLWRLN.js} +12 -11
- package/dist/{location-sales-channels-5ONDOTKC.js → location-sales-channels-MMRCF6QT.js} +3 -3
- package/dist/{location-service-zone-create-SSMZUELJ.js → location-service-zone-create-AC2PAK2X.js} +3 -3
- package/dist/{location-service-zone-manage-areas-QP3WONCG.js → location-service-zone-manage-areas-WXBQAEGB.js} +3 -3
- package/dist/{location-service-zone-shipping-option-create-QBGIX2IS.js → location-service-zone-shipping-option-create-CJI2IDS2.js} +10 -10
- package/dist/{login-BJNN5BDP.js → login-7R2QVOMB.js} +10 -10
- package/dist/{manage-locations-X76IQE2V.js → manage-locations-E2ODEJC5.js} +1 -1
- package/dist/{marketplace-add-currencies-DNI3AV3A.js → marketplace-add-currencies-GSR5IFFC.js} +2 -2
- package/dist/{marketplace-detail-73DJFMI7.js → marketplace-detail-CYNEUPOG.js} +13 -13
- package/dist/{marketplace-metadata-PSMQ7E3O.js → marketplace-metadata-75DPIUID.js} +10 -10
- package/dist/{offer-detail-page-XJFDKX4Z.js → offer-detail-page-GHSCR452.js} +16 -23
- package/dist/{offer-variant-detail-page-6QPGQSLY.js → offer-variant-detail-page-JLUJ7FQ4.js} +3 -3
- package/dist/{offers-7IRUIP7L.js → offers-NKMURHLM.js} +15 -15
- package/dist/{order-create-claim-UJKXA37S.js → order-create-claim-LF23TJ2Z.js} +2 -2
- package/dist/{order-create-edit-5U2QNJ5S.js → order-create-edit-ZF6YEUAW.js} +5 -5
- package/dist/{order-create-exchange-R5TOVSJZ.js → order-create-exchange-NM2JT5OF.js} +12 -12
- package/dist/{order-create-refund-MEAXQVIZ.js → order-create-refund-FWRG3VIW.js} +10 -10
- package/dist/{order-create-return-MEUIY4VU.js → order-create-return-YV5HXMY7.js} +2 -2
- package/dist/{order-detail-QE4HBQ5W.js → order-detail-S3ENSWQ3.js} +14 -14
- package/dist/{order-edit-billing-address-7S2QIRSZ.js → order-edit-billing-address-UYZNY77G.js} +11 -11
- package/dist/{order-edit-email-EE26NWGK.js → order-edit-email-GVGQLXNK.js} +10 -10
- package/dist/{order-edit-shipping-address-7G5JUVKW.js → order-edit-shipping-address-RS3PRPVM.js} +10 -10
- package/dist/{order-list-QILNDFBC.js → order-list-JBCU6ZZD.js} +9 -9
- package/dist/{order-metadata-UBUSPFTW.js → order-metadata-2TOR4BJY.js} +10 -10
- package/dist/{order-request-transfer-EO76XRGE.js → order-request-transfer-6JJ2FQPA.js} +10 -10
- package/dist/pages/index.d.ts +320 -41
- package/dist/pages/index.js +98 -96
- package/dist/{payout-list-R6ESKT7V.js → payout-list-N6L7HNA5.js} +3 -3
- package/dist/{price-list-configuration-D6IS7UY5.js → price-list-configuration-BGV74K6U.js} +6 -6
- package/dist/{price-list-create-4TDXQ7UF.js → price-list-create-T4P2TWFS.js} +18 -18
- package/dist/{price-list-detail-TUKXO5WG.js → price-list-detail-JBXWXU7K.js} +18 -18
- package/dist/{price-list-edit-YCR47ZXS.js → price-list-edit-FQVZW4FT.js} +2 -2
- package/dist/{price-list-list-TSK3TWUX.js → price-list-list-KINPGGQQ.js} +6 -6
- package/dist/{price-list-prices-add-VEQQYNEA.js → price-list-prices-add-2R4A2UVP.js} +17 -17
- package/dist/{price-list-prices-edit-ANLZGAY4.js → price-list-prices-edit-PZN63VWV.js} +10 -10
- package/dist/{product-add-existing-attributes-3S3E3TDO.js → product-add-existing-attributes-LQ3S5RBE.js} +16 -16
- package/dist/{product-attributes-SY656CC5.js → product-attributes-JUEMRL5V.js} +1 -1
- package/dist/{product-bulk-edit-XU2MFL4U.js → product-bulk-edit-7GWRXFUC.js} +1 -1
- package/dist/{product-create-KILMAWD7.js → product-create-RUMS2AIE.js} +17 -17
- package/dist/{product-create-attribute-XM47T3D6.js → product-create-attribute-7P4LZP5R.js} +2 -2
- package/dist/{product-create-variant-3XVP5IWI.js → product-create-variant-74KLCMEU.js} +4 -4
- package/dist/{product-detail-B4HVVOY3.js → product-detail-XHT5SGCW.js} +15 -15
- package/dist/{product-edit-ZX33LEQM.js → product-edit-GAYL53YC.js} +1 -1
- package/dist/product-edit-attribute-EBES4PJ3.js +90 -0
- package/dist/{product-list-DNZVZ3NC.js → product-list-JQRCIWTE.js} +17 -17
- package/dist/{product-media-QY4RFTYZ.js → product-media-4LDPBVQ5.js} +4 -4
- package/dist/{product-metadata-TGAAEG4O.js → product-metadata-YZKS2MQV.js} +10 -10
- package/dist/{product-organization-JPPQYC5E.js → product-organization-6TQ4HKB2.js} +4 -4
- package/dist/{product-sales-channels-CVAXZ7C7.js → product-sales-channels-K7VOMWUP.js} +3 -3
- package/dist/{product-shipping-profile-7F5GW6PQ.js → product-shipping-profile-SYGR4IF7.js} +1 -1
- package/dist/{product-tag-create-MZV3LCQT.js → product-tag-create-J6SUTGLF.js} +10 -10
- package/dist/{product-tag-detail-SANSVX5Z.js → product-tag-detail-MCHNANH4.js} +20 -20
- package/dist/{product-tag-edit-3BSAEN4H.js → product-tag-edit-XTCRJPYD.js} +10 -10
- package/dist/{product-tag-list-NFOAK7II.js → product-tag-list-4SEHT2NG.js} +20 -20
- package/dist/{product-tag-metadata-VNH5GXMK.js → product-tag-metadata-UMQPCGKY.js} +10 -10
- package/dist/{product-type-detail-ZIGX5HUJ.js → product-type-detail-SHU5N2RG.js} +17 -17
- package/dist/{product-type-list-D7GAIR2E.js → product-type-list-AVAO26QW.js} +3 -3
- package/dist/{product-type-metadata-6KXQSYK5.js → product-type-metadata-RIRSRMDO.js} +10 -10
- package/dist/{product-variant-detail-LIXWU3V2.js → product-variant-detail-XWREJ4EK.js} +11 -11
- package/dist/{product-variant-edit-GK5A2XMB.js → product-variant-edit-PCD66JBM.js} +12 -12
- package/dist/{product-variant-metadata-4BULTZ3M.js → product-variant-metadata-UJOLOTCQ.js} +10 -10
- package/dist/{promotion-add-campaign-AU43PI2F.js → promotion-add-campaign-KS5SSTMP.js} +8 -3
- package/dist/{promotion-create-5BJ4EVAI.js → promotion-create-XYXVAF67.js} +14 -14
- package/dist/{promotion-detail-S5R5UXJ6.js → promotion-detail-EFW4P6N6.js} +21 -37
- package/dist/{promotion-edit-details-GURXKLSK.js → promotion-edit-details-SH27X7GF.js} +293 -143
- package/dist/{promotion-list-22NDDYPQ.js → promotion-list-MVXEOO5I.js} +10 -9
- package/dist/{refund-reason-create-SUJIXZMY.js → refund-reason-create-XEBLTB3C.js} +10 -10
- package/dist/{refund-reason-edit-B3Q2DGXR.js → refund-reason-edit-J3KQ2FVF.js} +10 -10
- package/dist/{refund-reason-list-JLKMODL4.js → refund-reason-list-I2EACZ64.js} +15 -15
- package/dist/{region-add-countries-LF3AV6GE.js → region-add-countries-GKKZVGKH.js} +2 -2
- package/dist/{region-create-CVQVVWVA.js → region-create-2XEJLBWS.js} +2 -2
- package/dist/{region-detail-JGSC4A2U.js → region-detail-LILWL7FN.js} +3 -3
- package/dist/{region-list-ZZJNZWOP.js → region-list-E6OMK3OU.js} +3 -3
- package/dist/{region-metadata-EFQS2FU6.js → region-metadata-GDKM4ND5.js} +10 -10
- package/dist/{reservation-create-WC7RIX5E.js → reservation-create-77EYD2ZZ.js} +2 -2
- package/dist/{reservation-detail-XYRHURYY.js → reservation-detail-M7ZAEO3G.js} +11 -11
- package/dist/{reservation-list-IKDEV3JB.js → reservation-list-EJMYXNZV.js} +5 -5
- package/dist/{reservation-metadata-44QNS5IN.js → reservation-metadata-E6WP6SHE.js} +10 -10
- package/dist/{reset-password-CCHTZ4YX.js → reset-password-P45OKOT4.js} +1 -1
- package/dist/{return-reason-list-6WUNAHM6.js → return-reason-list-QWQUXSXO.js} +7 -7
- package/dist/{sales-channel-add-products-PYO5W5KK.js → sales-channel-add-products-Q6YXGNQB.js} +16 -16
- package/dist/{sales-channel-create-WSROI4MD.js → sales-channel-create-BYCHXO7N.js} +2 -2
- package/dist/{sales-channel-detail-DBVRTBF7.js → sales-channel-detail-EQMYYPW6.js} +17 -17
- package/dist/{sales-channel-edit-SNXG34Z3.js → sales-channel-edit-KHHDBZQG.js} +2 -2
- package/dist/{sales-channel-list-VWXBOQYJ.js → sales-channel-list-J4624AXE.js} +12 -12
- package/dist/{sales-channel-metadata-2LJBDKYI.js → sales-channel-metadata-QAXDOSPG.js} +10 -10
- package/dist/{shipping-option-type-create-ZRWS4PGU.js → shipping-option-type-create-AULMQGRN.js} +10 -10
- package/dist/{shipping-option-type-detail-KUGZH5YF.js → shipping-option-type-detail-EQDAW4GJ.js} +10 -10
- package/dist/{shipping-option-type-edit-24XNCOIH.js → shipping-option-type-edit-NVXGY32I.js} +10 -10
- package/dist/{shipping-option-type-list-4XTVL3AD.js → shipping-option-type-list-PW44GDWO.js} +13 -13
- package/dist/{shipping-profile-metadata-O3AG4LS4.js → shipping-profile-metadata-OW5IGIW3.js} +10 -10
- package/dist/{shipping-profiles-list-4SBV3D52.js → shipping-profiles-list-HP3GZTW6.js} +3 -3
- package/dist/{store-bulk-edit-J5G2TKVA.js → store-bulk-edit-KOBCPVNM.js} +1 -1
- package/dist/{store-create-VKLIAHQL.js → store-create-YPCF45XH.js} +10 -10
- package/dist/{store-details-DWV3WMKC.js → store-details-KDCMXPK2.js} +18 -18
- package/dist/{store-edit-WIAZLSHU.js → store-edit-BGQJW7GH.js} +3 -3
- package/dist/{store-list-HZCRXW5L.js → store-list-SBY73JTY.js} +18 -18
- package/dist/{store-member-invite-6ZIH6B7U.js → store-member-invite-2WGAJVIX.js} +1 -1
- package/dist/{tax-region-create-2NPI4MUT.js → tax-region-create-7UUVKDZM.js} +11 -11
- package/dist/{tax-region-detail-W4RAVJVN.js → tax-region-detail-B2AIDTXD.js} +14 -14
- package/dist/{tax-region-edit-RZRSLGFZ.js → tax-region-edit-UQAMWLO5.js} +10 -10
- package/dist/{tax-region-list-Y2XSQSCD.js → tax-region-list-MVDXWVIK.js} +3 -3
- package/dist/{tax-region-metadata-OQX67IIE.js → tax-region-metadata-UONPCPC6.js} +10 -10
- package/dist/{tax-region-province-detail-BS7INZML.js → tax-region-province-detail-XFUAN2R7.js} +13 -13
- package/dist/{tax-region-tax-override-create-NRO7QCVL.js → tax-region-tax-override-create-7TQVZLLY.js} +20 -20
- package/dist/{tax-region-tax-override-edit-POJATJRW.js → tax-region-tax-override-edit-ZJ6TFQRV.js} +20 -20
- package/dist/{user-detail-RNP7ADME.js → user-detail-IYB2LYGS.js} +1 -1
- package/dist/{user-invite-TUDDN7KP.js → user-invite-ZGB23H4G.js} +2 -2
- package/dist/{user-list-JT3HWEGY.js → user-list-FZ7CGJ5N.js} +3 -3
- package/dist/{user-metadata-PNIWSBYP.js → user-metadata-OXHKB6LT.js} +10 -10
- package/package.json +15 -15
- package/dist/chunk-S2WEYEQR.js +0 -14
- package/dist/product-edit-attribute-QC22TRX4.js +0 -336
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RulesFormField
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RDDZLUKZ.js";
|
|
4
4
|
import {
|
|
5
5
|
CreateCampaignSchema,
|
|
6
6
|
DEFAULT_CAMPAIGN_VALUES
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YTBPZ5MO.js";
|
|
8
8
|
import {
|
|
9
9
|
DeprecatedPercentageInput
|
|
10
10
|
} from "./chunk-MAEP2UCK.js";
|
|
11
11
|
import {
|
|
12
12
|
AddCampaignPromotionFields
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JZZLMXG4.js";
|
|
14
|
+
import {
|
|
15
|
+
useComboboxData
|
|
16
|
+
} from "./chunk-5KGMGL4N.js";
|
|
17
|
+
import {
|
|
18
|
+
Combobox
|
|
19
|
+
} from "./chunk-AW77UWCZ.js";
|
|
14
20
|
import {
|
|
15
21
|
TabbedForm,
|
|
16
22
|
defineTabMeta,
|
|
@@ -28,11 +34,15 @@ import {
|
|
|
28
34
|
Form
|
|
29
35
|
} from "./chunk-3QSRE5LS.js";
|
|
30
36
|
import {
|
|
31
|
-
useCreatePromotion
|
|
32
|
-
|
|
37
|
+
useCreatePromotion,
|
|
38
|
+
useUpsertPromotionCost
|
|
39
|
+
} from "./chunk-RLOKMTTN.js";
|
|
33
40
|
import {
|
|
34
41
|
useDocumentDirection
|
|
35
42
|
} from "./chunk-Y7QKP6QU.js";
|
|
43
|
+
import {
|
|
44
|
+
sdk
|
|
45
|
+
} from "./chunk-JTAECZCT.js";
|
|
36
46
|
|
|
37
47
|
// src/pages/promotions/promotion-create/components/create-promotion-form/form-schema.ts
|
|
38
48
|
import i18n from "i18next";
|
|
@@ -62,6 +72,10 @@ var CreatePromotionSchema = z.object({
|
|
|
62
72
|
status: z.enum(["draft", "active", "inactive"]),
|
|
63
73
|
rules: RuleSchema,
|
|
64
74
|
is_tax_inclusive: z.boolean().optional(),
|
|
75
|
+
seller_id: z.string().optional(),
|
|
76
|
+
limit: z.number().int().min(1).nullable().optional(),
|
|
77
|
+
cost_bearer: z.enum(["store", "marketplace", "shared"]),
|
|
78
|
+
shared_marketplace_percentage: z.number().min(0).max(100).nullable(),
|
|
65
79
|
application_method: z.object({
|
|
66
80
|
allocation: z.enum(["each", "across", "once"]),
|
|
67
81
|
value: z.number().min(0).or(z.string().min(1)),
|
|
@@ -84,6 +98,28 @@ var CreatePromotionSchema = z.object({
|
|
|
84
98
|
path: ["application_method.max_quantity"],
|
|
85
99
|
message: i18n.t("validation.requiredField")
|
|
86
100
|
}
|
|
101
|
+
).refine(
|
|
102
|
+
(data) => {
|
|
103
|
+
if (data.cost_bearer !== "shared") {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
return typeof data.shared_marketplace_percentage === "number";
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
path: ["shared_marketplace_percentage"],
|
|
110
|
+
message: i18n.t("validation.requiredField")
|
|
111
|
+
}
|
|
112
|
+
).refine(
|
|
113
|
+
(data) => {
|
|
114
|
+
if (data.type !== "buyget") {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
return !!data.seller_id;
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
path: ["seller_id"],
|
|
121
|
+
message: i18n.t("promotions.form.storeOffers.required")
|
|
122
|
+
}
|
|
87
123
|
);
|
|
88
124
|
|
|
89
125
|
// src/pages/promotions/promotion-create/promotion-create.tsx
|
|
@@ -129,13 +165,14 @@ import {
|
|
|
129
165
|
CurrencyInput,
|
|
130
166
|
Divider,
|
|
131
167
|
Heading,
|
|
168
|
+
InlineTip,
|
|
132
169
|
Input,
|
|
133
170
|
RadioGroup,
|
|
134
|
-
Switch,
|
|
135
171
|
Text
|
|
136
172
|
} from "@medusajs/ui";
|
|
137
173
|
import { useWatch as useWatch2 } from "react-hook-form";
|
|
138
174
|
import { Trans, useTranslation } from "react-i18next";
|
|
175
|
+
import { SwitchBox } from "@mercurjs/dashboard-shared";
|
|
139
176
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
140
177
|
var Root2 = ({ currentTemplate }) => {
|
|
141
178
|
const { t } = useTranslation();
|
|
@@ -168,6 +205,20 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
168
205
|
name: "application_method.target_type"
|
|
169
206
|
});
|
|
170
207
|
const isTargetTypeOrder = targetType === "order";
|
|
208
|
+
const watchCostBearer = useWatch2({
|
|
209
|
+
control: form.control,
|
|
210
|
+
name: "cost_bearer"
|
|
211
|
+
});
|
|
212
|
+
const isSharedCost = watchCostBearer === "shared";
|
|
213
|
+
const stores = useComboboxData({
|
|
214
|
+
queryKey: ["promotion_stores"],
|
|
215
|
+
queryFn: (params) => sdk.admin.sellers.query({ ...params, fields: "id,name" }),
|
|
216
|
+
getOptions: (data) => data.sellers.map((seller) => ({
|
|
217
|
+
label: seller.name,
|
|
218
|
+
value: seller.id
|
|
219
|
+
})),
|
|
220
|
+
enabled: isTypeBuyGet
|
|
221
|
+
});
|
|
171
222
|
return /* @__PURE__ */ jsx2("div", { className: "flex size-full flex-col items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8 py-16", children: [
|
|
172
223
|
/* @__PURE__ */ jsxs(
|
|
173
224
|
Heading,
|
|
@@ -344,58 +395,145 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
344
395
|
}
|
|
345
396
|
}
|
|
346
397
|
) }),
|
|
347
|
-
!currentTemplate?.hiddenFields?.includes("is_tax_inclusive") && /* @__PURE__ */
|
|
348
|
-
|
|
349
|
-
|
|
398
|
+
!currentTemplate?.hiddenFields?.includes("is_tax_inclusive") && /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
|
|
399
|
+
SwitchBox,
|
|
400
|
+
{
|
|
401
|
+
control: form.control,
|
|
402
|
+
name: "is_tax_inclusive",
|
|
403
|
+
label: t("promotions.form.taxInclusive.title"),
|
|
404
|
+
description: t("promotions.form.taxInclusive.description"),
|
|
405
|
+
"data-testid": "promotion-create-form-tax-inclusive-switch"
|
|
406
|
+
}
|
|
407
|
+
) }),
|
|
408
|
+
/* @__PURE__ */ jsx2(Divider, {}),
|
|
409
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
410
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
411
|
+
/* @__PURE__ */ jsx2(
|
|
412
|
+
Heading,
|
|
413
|
+
{
|
|
414
|
+
level: "h2",
|
|
415
|
+
className: "mb-2",
|
|
416
|
+
"data-testid": "promotion-create-form-cost-bearer-label",
|
|
417
|
+
children: t("promotions.form.costBearer.label")
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ jsx2(
|
|
421
|
+
Text,
|
|
422
|
+
{
|
|
423
|
+
className: "txt-small text-ui-fg-subtle",
|
|
424
|
+
"data-testid": "promotion-create-form-cost-bearer-description",
|
|
425
|
+
children: t("promotions.form.costBearer.description")
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] }),
|
|
429
|
+
/* @__PURE__ */ jsx2(
|
|
430
|
+
Form.Field,
|
|
431
|
+
{
|
|
432
|
+
control: form.control,
|
|
433
|
+
name: "cost_bearer",
|
|
434
|
+
render: ({ field }) => {
|
|
435
|
+
return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-create-form-cost-bearer-item", children: [
|
|
436
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-cost-bearer-control", children: /* @__PURE__ */ jsxs(
|
|
437
|
+
RadioGroup,
|
|
438
|
+
{
|
|
439
|
+
dir: direction,
|
|
440
|
+
className: "flex gap-y-3",
|
|
441
|
+
...field,
|
|
442
|
+
value: field.value,
|
|
443
|
+
onValueChange: field.onChange,
|
|
444
|
+
"data-testid": "promotion-create-form-cost-bearer-radio-group",
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ jsx2(
|
|
447
|
+
RadioGroup.ChoiceBox,
|
|
448
|
+
{
|
|
449
|
+
value: "store",
|
|
450
|
+
label: t("promotions.form.costBearer.store.title"),
|
|
451
|
+
description: t(
|
|
452
|
+
"promotions.form.costBearer.store.description"
|
|
453
|
+
),
|
|
454
|
+
className: clx("basis-1/3"),
|
|
455
|
+
"data-testid": "promotion-create-form-cost-bearer-option-store"
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx2(
|
|
459
|
+
RadioGroup.ChoiceBox,
|
|
460
|
+
{
|
|
461
|
+
value: "marketplace",
|
|
462
|
+
label: t(
|
|
463
|
+
"promotions.form.costBearer.marketplace.title"
|
|
464
|
+
),
|
|
465
|
+
description: t(
|
|
466
|
+
"promotions.form.costBearer.marketplace.description"
|
|
467
|
+
),
|
|
468
|
+
className: clx("basis-1/3"),
|
|
469
|
+
"data-testid": "promotion-create-form-cost-bearer-option-marketplace"
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
/* @__PURE__ */ jsx2(
|
|
473
|
+
RadioGroup.ChoiceBox,
|
|
474
|
+
{
|
|
475
|
+
value: "shared",
|
|
476
|
+
label: t("promotions.form.costBearer.shared.title"),
|
|
477
|
+
description: t(
|
|
478
|
+
"promotions.form.costBearer.shared.description"
|
|
479
|
+
),
|
|
480
|
+
className: clx("basis-1/3"),
|
|
481
|
+
"data-testid": "promotion-create-form-cost-bearer-option-shared"
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
) }),
|
|
487
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-cost-bearer-error" })
|
|
488
|
+
] });
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
isSharedCost && /* @__PURE__ */ jsx2(
|
|
350
493
|
Form.Field,
|
|
351
494
|
{
|
|
352
495
|
control: form.control,
|
|
353
|
-
name: "
|
|
496
|
+
name: "shared_marketplace_percentage",
|
|
354
497
|
render: ({ field: { onChange, value, ...field } }) => {
|
|
355
498
|
return /* @__PURE__ */ jsxs(
|
|
356
499
|
Form.Item,
|
|
357
500
|
{
|
|
358
|
-
className: "basis-
|
|
359
|
-
"data-testid": "promotion-create-form-
|
|
501
|
+
className: "basis-1/2",
|
|
502
|
+
"data-testid": "promotion-create-form-shared-percentage-item",
|
|
360
503
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
{
|
|
381
|
-
dir: "ltr",
|
|
382
|
-
className: "mt-[2px] rtl:rotate-180",
|
|
383
|
-
checked: !!value,
|
|
384
|
-
onCheckedChange: onChange,
|
|
385
|
-
...field,
|
|
386
|
-
"data-testid": "promotion-create-form-tax-inclusive-switch"
|
|
387
|
-
}
|
|
388
|
-
)
|
|
389
|
-
}
|
|
390
|
-
)
|
|
391
|
-
] }),
|
|
392
|
-
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-tax-inclusive-error" })
|
|
504
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "promotion-create-form-shared-percentage-label", children: t("promotions.form.costBearer.sharedPercentage.title") }),
|
|
505
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-shared-percentage-control", children: /* @__PURE__ */ jsx2(
|
|
506
|
+
DeprecatedPercentageInput,
|
|
507
|
+
{
|
|
508
|
+
className: "text-right",
|
|
509
|
+
min: 0,
|
|
510
|
+
max: 100,
|
|
511
|
+
...field,
|
|
512
|
+
value: value ?? "",
|
|
513
|
+
onChange: (e) => {
|
|
514
|
+
onChange(
|
|
515
|
+
e.target.value === "" ? null : parseFloat(e.target.value)
|
|
516
|
+
);
|
|
517
|
+
},
|
|
518
|
+
"data-testid": "promotion-create-form-shared-percentage-input"
|
|
519
|
+
},
|
|
520
|
+
"shared-percentage"
|
|
521
|
+
) }),
|
|
522
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-shared-percentage-error" })
|
|
393
523
|
]
|
|
394
524
|
}
|
|
395
525
|
);
|
|
396
526
|
}
|
|
397
527
|
}
|
|
398
|
-
)
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ jsx2(
|
|
530
|
+
InlineTip,
|
|
531
|
+
{
|
|
532
|
+
label: t("general.tip"),
|
|
533
|
+
"data-testid": "promotion-create-form-cost-bearer-tip",
|
|
534
|
+
children: t("promotions.form.costBearer.tip")
|
|
535
|
+
}
|
|
536
|
+
)
|
|
399
537
|
] }),
|
|
400
538
|
!currentTemplate?.hiddenFields?.includes("type") && /* @__PURE__ */ jsx2(
|
|
401
539
|
Form.Field,
|
|
@@ -448,7 +586,9 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
448
586
|
),
|
|
449
587
|
/* @__PURE__ */ jsx2(Divider, {}),
|
|
450
588
|
/* @__PURE__ */ jsx2(RulesFormField, { form, ruleType: "rules" }),
|
|
451
|
-
!currentTemplate?.hiddenFields?.includes(
|
|
589
|
+
!currentTemplate?.hiddenFields?.includes(
|
|
590
|
+
"application_method.type"
|
|
591
|
+
) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
452
592
|
/* @__PURE__ */ jsx2(Divider, {}),
|
|
453
593
|
/* @__PURE__ */ jsx2(
|
|
454
594
|
Form.Field,
|
|
@@ -471,9 +611,7 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
471
611
|
RadioGroup.ChoiceBox,
|
|
472
612
|
{
|
|
473
613
|
value: "fixed",
|
|
474
|
-
label: t(
|
|
475
|
-
"promotions.form.value_type.fixed.title"
|
|
476
|
-
),
|
|
614
|
+
label: t("promotions.form.value_type.fixed.title"),
|
|
477
615
|
description: t(
|
|
478
616
|
"promotions.form.value_type.fixed.description"
|
|
479
617
|
),
|
|
@@ -504,140 +642,6 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
504
642
|
}
|
|
505
643
|
)
|
|
506
644
|
] }),
|
|
507
|
-
!currentTemplate?.hiddenFields?.includes(
|
|
508
|
-
"application_method.value"
|
|
509
|
-
) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
510
|
-
/* @__PURE__ */ jsx2(Divider, {}),
|
|
511
|
-
/* @__PURE__ */ jsx2(
|
|
512
|
-
Form.Field,
|
|
513
|
-
{
|
|
514
|
-
control: form.control,
|
|
515
|
-
name: "application_method.value",
|
|
516
|
-
render: ({ field: { onChange, value, ...field } }) => {
|
|
517
|
-
const currencyCode = form.getValues().application_method.currency_code;
|
|
518
|
-
const currencyInfo = currencies[currencyCode?.toUpperCase() || "USD"];
|
|
519
|
-
return /* @__PURE__ */ jsxs(
|
|
520
|
-
Form.Item,
|
|
521
|
-
{
|
|
522
|
-
className: "basis-1/2",
|
|
523
|
-
"data-testid": "promotion-create-form-value-item",
|
|
524
|
-
children: [
|
|
525
|
-
/* @__PURE__ */ jsx2(
|
|
526
|
-
Form.Label,
|
|
527
|
-
{
|
|
528
|
-
tooltip: currencyCode || !isFixedValueType ? void 0 : t("promotions.fields.amount.tooltip"),
|
|
529
|
-
"data-testid": "promotion-create-form-value-label",
|
|
530
|
-
children: t("promotions.form.value.title")
|
|
531
|
-
}
|
|
532
|
-
),
|
|
533
|
-
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-value-control", children: isFixedValueType ? /* @__PURE__ */ jsx2(
|
|
534
|
-
CurrencyInput,
|
|
535
|
-
{
|
|
536
|
-
...field,
|
|
537
|
-
min: 0,
|
|
538
|
-
code: currencyCode || "USD",
|
|
539
|
-
onValueChange: (_value, _name, values) => onChange(values?.value),
|
|
540
|
-
decimalScale: currencyInfo?.decimal_digits ?? 2,
|
|
541
|
-
decimalsLimit: currencyInfo?.decimal_digits ?? 2,
|
|
542
|
-
symbol: currencyCode ? getCurrencySymbol(currencyCode) : "$",
|
|
543
|
-
value,
|
|
544
|
-
disabled: !currencyCode,
|
|
545
|
-
"data-testid": "promotion-create-form-value-currency-input"
|
|
546
|
-
}
|
|
547
|
-
) : /* @__PURE__ */ jsx2(
|
|
548
|
-
DeprecatedPercentageInput,
|
|
549
|
-
{
|
|
550
|
-
className: "text-right",
|
|
551
|
-
min: 0,
|
|
552
|
-
max: 100,
|
|
553
|
-
...field,
|
|
554
|
-
value,
|
|
555
|
-
onChange: (e) => {
|
|
556
|
-
onChange(
|
|
557
|
-
e.target.value === "" ? null : parseFloat(e.target.value)
|
|
558
|
-
);
|
|
559
|
-
},
|
|
560
|
-
"data-testid": "promotion-create-form-value-percentage-input"
|
|
561
|
-
},
|
|
562
|
-
"amount"
|
|
563
|
-
) }),
|
|
564
|
-
/* @__PURE__ */ jsx2(
|
|
565
|
-
Text,
|
|
566
|
-
{
|
|
567
|
-
size: "small",
|
|
568
|
-
leading: "compact",
|
|
569
|
-
className: "text-ui-fg-subtle",
|
|
570
|
-
"data-testid": "promotion-create-form-value-description",
|
|
571
|
-
children: /* @__PURE__ */ jsx2(
|
|
572
|
-
Trans,
|
|
573
|
-
{
|
|
574
|
-
t,
|
|
575
|
-
i18nKey: isFixedValueType ? "promotions.form.value_type.fixed.description" : "promotions.form.value_type.percentage.description",
|
|
576
|
-
components: [/* @__PURE__ */ jsx2("br", {}, "break")]
|
|
577
|
-
}
|
|
578
|
-
)
|
|
579
|
-
}
|
|
580
|
-
),
|
|
581
|
-
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-value-error" })
|
|
582
|
-
]
|
|
583
|
-
}
|
|
584
|
-
);
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
)
|
|
588
|
-
] }),
|
|
589
|
-
(isTypeStandard || isTypeBuyGet) && allocationMode !== "across" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
590
|
-
isTypeBuyGet && /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(Divider, {}) }),
|
|
591
|
-
/* @__PURE__ */ jsx2(
|
|
592
|
-
Form.Field,
|
|
593
|
-
{
|
|
594
|
-
control: form.control,
|
|
595
|
-
name: "application_method.max_quantity",
|
|
596
|
-
render: () => {
|
|
597
|
-
return /* @__PURE__ */ jsxs(
|
|
598
|
-
Form.Item,
|
|
599
|
-
{
|
|
600
|
-
className: "basis-1/2",
|
|
601
|
-
"data-testid": "promotion-create-form-max-quantity-item",
|
|
602
|
-
children: [
|
|
603
|
-
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "promotion-create-form-max-quantity-label", children: t("promotions.form.max_quantity.title") }),
|
|
604
|
-
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-max-quantity-control", children: /* @__PURE__ */ jsx2(
|
|
605
|
-
Input,
|
|
606
|
-
{
|
|
607
|
-
...form.register("application_method.max_quantity", {
|
|
608
|
-
valueAsNumber: true
|
|
609
|
-
}),
|
|
610
|
-
type: "number",
|
|
611
|
-
min: 1,
|
|
612
|
-
placeholder: "3",
|
|
613
|
-
"data-testid": "promotion-create-form-max-quantity-input"
|
|
614
|
-
}
|
|
615
|
-
) }),
|
|
616
|
-
/* @__PURE__ */ jsx2(
|
|
617
|
-
Text,
|
|
618
|
-
{
|
|
619
|
-
size: "small",
|
|
620
|
-
leading: "compact",
|
|
621
|
-
className: "text-ui-fg-subtle",
|
|
622
|
-
"data-testid": "promotion-create-form-max-quantity-description",
|
|
623
|
-
children: /* @__PURE__ */ jsx2(
|
|
624
|
-
Trans,
|
|
625
|
-
{
|
|
626
|
-
t,
|
|
627
|
-
i18nKey: "promotions.form.max_quantity.description",
|
|
628
|
-
components: [/* @__PURE__ */ jsx2("br", {}, "break")]
|
|
629
|
-
}
|
|
630
|
-
)
|
|
631
|
-
}
|
|
632
|
-
),
|
|
633
|
-
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-max-quantity-error" })
|
|
634
|
-
]
|
|
635
|
-
}
|
|
636
|
-
);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
)
|
|
640
|
-
] }),
|
|
641
645
|
!currentTemplate?.hiddenFields?.includes(
|
|
642
646
|
"application_method.allocation"
|
|
643
647
|
) && /* @__PURE__ */ jsx2(
|
|
@@ -685,7 +689,9 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
685
689
|
{
|
|
686
690
|
value: "once",
|
|
687
691
|
label: t("promotions.form.allocation.once.title"),
|
|
688
|
-
description: t(
|
|
692
|
+
description: t(
|
|
693
|
+
"promotions.form.allocation.once.description"
|
|
694
|
+
),
|
|
689
695
|
className: clx("basis-1/2"),
|
|
690
696
|
"data-testid": "promotion-create-form-allocation-option-once"
|
|
691
697
|
}
|
|
@@ -698,6 +704,181 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
698
704
|
}
|
|
699
705
|
}
|
|
700
706
|
),
|
|
707
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
708
|
+
!currentTemplate?.hiddenFields?.includes(
|
|
709
|
+
"application_method.value"
|
|
710
|
+
) && /* @__PURE__ */ jsx2(
|
|
711
|
+
Form.Field,
|
|
712
|
+
{
|
|
713
|
+
control: form.control,
|
|
714
|
+
name: "application_method.value",
|
|
715
|
+
render: ({ field: { onChange, value, ...field } }) => {
|
|
716
|
+
const currencyCode = form.getValues().application_method.currency_code;
|
|
717
|
+
const currencyInfo = currencies[currencyCode?.toUpperCase() || "USD"];
|
|
718
|
+
return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-create-form-value-item", children: [
|
|
719
|
+
/* @__PURE__ */ jsx2(
|
|
720
|
+
Form.Label,
|
|
721
|
+
{
|
|
722
|
+
tooltip: currencyCode || !isFixedValueType ? void 0 : t("promotions.fields.amount.tooltip"),
|
|
723
|
+
"data-testid": "promotion-create-form-value-label",
|
|
724
|
+
children: t("promotions.form.value.title")
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-value-control", children: isFixedValueType ? /* @__PURE__ */ jsx2(
|
|
728
|
+
CurrencyInput,
|
|
729
|
+
{
|
|
730
|
+
...field,
|
|
731
|
+
min: 0,
|
|
732
|
+
code: currencyCode || "USD",
|
|
733
|
+
onValueChange: (_value, _name, values) => onChange(values?.value),
|
|
734
|
+
decimalScale: currencyInfo?.decimal_digits ?? 2,
|
|
735
|
+
decimalsLimit: currencyInfo?.decimal_digits ?? 2,
|
|
736
|
+
symbol: currencyCode ? getCurrencySymbol(currencyCode) : "$",
|
|
737
|
+
value,
|
|
738
|
+
disabled: !currencyCode,
|
|
739
|
+
"data-testid": "promotion-create-form-value-currency-input"
|
|
740
|
+
}
|
|
741
|
+
) : /* @__PURE__ */ jsx2(
|
|
742
|
+
DeprecatedPercentageInput,
|
|
743
|
+
{
|
|
744
|
+
className: "text-right",
|
|
745
|
+
min: 0,
|
|
746
|
+
max: 100,
|
|
747
|
+
...field,
|
|
748
|
+
value,
|
|
749
|
+
onChange: (e) => {
|
|
750
|
+
onChange(
|
|
751
|
+
e.target.value === "" ? null : parseFloat(e.target.value)
|
|
752
|
+
);
|
|
753
|
+
},
|
|
754
|
+
"data-testid": "promotion-create-form-value-percentage-input"
|
|
755
|
+
},
|
|
756
|
+
"amount"
|
|
757
|
+
) }),
|
|
758
|
+
/* @__PURE__ */ jsx2(
|
|
759
|
+
Text,
|
|
760
|
+
{
|
|
761
|
+
size: "small",
|
|
762
|
+
leading: "compact",
|
|
763
|
+
className: "text-ui-fg-subtle",
|
|
764
|
+
"data-testid": "promotion-create-form-value-description",
|
|
765
|
+
children: /* @__PURE__ */ jsx2(
|
|
766
|
+
Trans,
|
|
767
|
+
{
|
|
768
|
+
t,
|
|
769
|
+
i18nKey: isFixedValueType ? "promotions.form.value_type.fixed.description" : "promotions.form.value_type.percentage.description",
|
|
770
|
+
components: [/* @__PURE__ */ jsx2("br", {}, "break")]
|
|
771
|
+
}
|
|
772
|
+
)
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-value-error" })
|
|
776
|
+
] });
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
(isTypeStandard || isTypeBuyGet) && allocationMode !== "across" && /* @__PURE__ */ jsx2(
|
|
781
|
+
Form.Field,
|
|
782
|
+
{
|
|
783
|
+
control: form.control,
|
|
784
|
+
name: "application_method.max_quantity",
|
|
785
|
+
render: () => {
|
|
786
|
+
return /* @__PURE__ */ jsxs(Form.Item, { "data-testid": "promotion-create-form-max-quantity-item", children: [
|
|
787
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "promotion-create-form-max-quantity-label", children: t("promotions.form.max_quantity.title") }),
|
|
788
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-max-quantity-control", children: /* @__PURE__ */ jsx2(
|
|
789
|
+
Input,
|
|
790
|
+
{
|
|
791
|
+
...form.register("application_method.max_quantity", {
|
|
792
|
+
valueAsNumber: true
|
|
793
|
+
}),
|
|
794
|
+
type: "number",
|
|
795
|
+
min: 1,
|
|
796
|
+
placeholder: "3",
|
|
797
|
+
"data-testid": "promotion-create-form-max-quantity-input"
|
|
798
|
+
}
|
|
799
|
+
) }),
|
|
800
|
+
/* @__PURE__ */ jsx2(
|
|
801
|
+
Text,
|
|
802
|
+
{
|
|
803
|
+
size: "small",
|
|
804
|
+
leading: "compact",
|
|
805
|
+
className: "text-ui-fg-subtle",
|
|
806
|
+
"data-testid": "promotion-create-form-max-quantity-description",
|
|
807
|
+
children: /* @__PURE__ */ jsx2(
|
|
808
|
+
Trans,
|
|
809
|
+
{
|
|
810
|
+
t,
|
|
811
|
+
i18nKey: "promotions.form.max_quantity.description",
|
|
812
|
+
components: [/* @__PURE__ */ jsx2("br", {}, "break")]
|
|
813
|
+
}
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
),
|
|
817
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-max-quantity-error" })
|
|
818
|
+
] });
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
] }),
|
|
823
|
+
isTypeBuyGet && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
824
|
+
/* @__PURE__ */ jsx2(Divider, {}),
|
|
825
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
826
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
827
|
+
/* @__PURE__ */ jsx2(
|
|
828
|
+
Heading,
|
|
829
|
+
{
|
|
830
|
+
level: "h2",
|
|
831
|
+
className: "mb-2",
|
|
832
|
+
"data-testid": "promotion-create-form-store-offers-heading",
|
|
833
|
+
children: t("promotions.form.storeOffers.title")
|
|
834
|
+
}
|
|
835
|
+
),
|
|
836
|
+
/* @__PURE__ */ jsx2(
|
|
837
|
+
Text,
|
|
838
|
+
{
|
|
839
|
+
className: "txt-small text-ui-fg-subtle",
|
|
840
|
+
"data-testid": "promotion-create-form-store-offers-description",
|
|
841
|
+
children: t("promotions.form.storeOffers.description")
|
|
842
|
+
}
|
|
843
|
+
)
|
|
844
|
+
] }),
|
|
845
|
+
/* @__PURE__ */ jsx2(
|
|
846
|
+
Form.Field,
|
|
847
|
+
{
|
|
848
|
+
control: form.control,
|
|
849
|
+
name: "seller_id",
|
|
850
|
+
render: ({ field }) => {
|
|
851
|
+
return /* @__PURE__ */ jsxs(
|
|
852
|
+
Form.Item,
|
|
853
|
+
{
|
|
854
|
+
className: "basis-1/2",
|
|
855
|
+
"data-testid": "promotion-create-form-store-item",
|
|
856
|
+
children: [
|
|
857
|
+
/* @__PURE__ */ jsx2(Form.Label, { "data-testid": "promotion-create-form-store-label", children: t("promotions.form.storeOffers.label") }),
|
|
858
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-store-control", children: /* @__PURE__ */ jsx2(
|
|
859
|
+
Combobox,
|
|
860
|
+
{
|
|
861
|
+
...field,
|
|
862
|
+
value: field.value ?? "",
|
|
863
|
+
options: stores.options,
|
|
864
|
+
searchValue: stores.searchValue,
|
|
865
|
+
onSearchValueChange: stores.onSearchValueChange,
|
|
866
|
+
fetchNextPage: stores.fetchNextPage,
|
|
867
|
+
placeholder: t(
|
|
868
|
+
"promotions.form.storeOffers.placeholder"
|
|
869
|
+
),
|
|
870
|
+
"data-testid": "promotion-create-form-store-select"
|
|
871
|
+
}
|
|
872
|
+
) }),
|
|
873
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-store-error" })
|
|
874
|
+
]
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
)
|
|
880
|
+
] })
|
|
881
|
+
] }),
|
|
701
882
|
!isTypeStandard && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
702
883
|
/* @__PURE__ */ jsx2(Divider, {}),
|
|
703
884
|
/* @__PURE__ */ jsx2(
|
|
@@ -719,7 +900,60 @@ var Root2 = ({ currentTemplate }) => {
|
|
|
719
900
|
scope: "application_method.target_rules"
|
|
720
901
|
}
|
|
721
902
|
)
|
|
722
|
-
] })
|
|
903
|
+
] }),
|
|
904
|
+
/* @__PURE__ */ jsx2(Divider, {}),
|
|
905
|
+
/* @__PURE__ */ jsx2(
|
|
906
|
+
Form.Field,
|
|
907
|
+
{
|
|
908
|
+
control: form.control,
|
|
909
|
+
name: "limit",
|
|
910
|
+
render: ({ field: { onChange, value, ...field } }) => {
|
|
911
|
+
return /* @__PURE__ */ jsxs(
|
|
912
|
+
Form.Item,
|
|
913
|
+
{
|
|
914
|
+
className: "basis-1/2",
|
|
915
|
+
"data-testid": "promotion-create-form-limit-item",
|
|
916
|
+
children: [
|
|
917
|
+
/* @__PURE__ */ jsx2(
|
|
918
|
+
Form.Label,
|
|
919
|
+
{
|
|
920
|
+
optional: true,
|
|
921
|
+
"data-testid": "promotion-create-form-limit-label",
|
|
922
|
+
children: t("promotions.form.limit.title")
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
/* @__PURE__ */ jsx2(Form.Control, { "data-testid": "promotion-create-form-limit-control", children: /* @__PURE__ */ jsx2(
|
|
926
|
+
Input,
|
|
927
|
+
{
|
|
928
|
+
...field,
|
|
929
|
+
type: "number",
|
|
930
|
+
min: 1,
|
|
931
|
+
value: value ?? "",
|
|
932
|
+
onChange: (e) => {
|
|
933
|
+
const val = e.target.value;
|
|
934
|
+
onChange(val === "" ? null : parseInt(val, 10));
|
|
935
|
+
},
|
|
936
|
+
placeholder: "100",
|
|
937
|
+
"data-testid": "promotion-create-form-limit-input"
|
|
938
|
+
}
|
|
939
|
+
) }),
|
|
940
|
+
/* @__PURE__ */ jsx2(
|
|
941
|
+
Text,
|
|
942
|
+
{
|
|
943
|
+
size: "small",
|
|
944
|
+
leading: "compact",
|
|
945
|
+
className: "text-ui-fg-subtle",
|
|
946
|
+
"data-testid": "promotion-create-form-limit-description",
|
|
947
|
+
children: t("promotions.form.limit.description")
|
|
948
|
+
}
|
|
949
|
+
),
|
|
950
|
+
/* @__PURE__ */ jsx2(Form.ErrorMessage, { "data-testid": "promotion-create-form-limit-error" })
|
|
951
|
+
]
|
|
952
|
+
}
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
)
|
|
723
957
|
] }) });
|
|
724
958
|
};
|
|
725
959
|
Root2._tabMeta = defineTabMeta({
|
|
@@ -732,6 +966,9 @@ Root2._tabMeta = defineTabMeta({
|
|
|
732
966
|
"status",
|
|
733
967
|
"rules",
|
|
734
968
|
"is_tax_inclusive",
|
|
969
|
+
"cost_bearer",
|
|
970
|
+
"shared_marketplace_percentage",
|
|
971
|
+
"limit",
|
|
735
972
|
"application_method"
|
|
736
973
|
]
|
|
737
974
|
});
|
|
@@ -746,11 +983,15 @@ var commonHiddenFields = [
|
|
|
746
983
|
"type",
|
|
747
984
|
"application_method.type"
|
|
748
985
|
];
|
|
749
|
-
var amountOfOrderHiddenFields = [
|
|
986
|
+
var amountOfOrderHiddenFields = [
|
|
987
|
+
...commonHiddenFields,
|
|
988
|
+
"application_method.allocation"
|
|
989
|
+
];
|
|
750
990
|
var amountOfProductHiddenFields = [...commonHiddenFields];
|
|
751
991
|
var percentageOfOrderHiddenFields = [
|
|
752
992
|
...commonHiddenFields,
|
|
753
|
-
"is_tax_inclusive"
|
|
993
|
+
"is_tax_inclusive",
|
|
994
|
+
"application_method.allocation"
|
|
754
995
|
];
|
|
755
996
|
var percentageOfProductHiddenFields = [
|
|
756
997
|
...commonHiddenFields,
|
|
@@ -761,12 +1002,6 @@ var buyGetHiddenFields = [
|
|
|
761
1002
|
"application_method.value",
|
|
762
1003
|
"is_tax_inclusive"
|
|
763
1004
|
];
|
|
764
|
-
var freeShippingHiddenFields = [
|
|
765
|
-
...commonHiddenFields,
|
|
766
|
-
"application_method.value",
|
|
767
|
-
"application_method.allocation",
|
|
768
|
-
"is_tax_inclusive"
|
|
769
|
-
];
|
|
770
1005
|
var templates = [
|
|
771
1006
|
{
|
|
772
1007
|
id: "amount_off_products",
|
|
@@ -848,23 +1083,6 @@ var templates = [
|
|
|
848
1083
|
max_quantity: 1
|
|
849
1084
|
}
|
|
850
1085
|
}
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
id: "shipping_discount",
|
|
854
|
-
type: "standard",
|
|
855
|
-
titleKey: "promotions.templates.freeShipping.title",
|
|
856
|
-
descriptionKey: "promotions.templates.freeShipping.description",
|
|
857
|
-
hiddenFields: freeShippingHiddenFields,
|
|
858
|
-
defaults: {
|
|
859
|
-
is_automatic: "false",
|
|
860
|
-
type: "standard",
|
|
861
|
-
application_method: {
|
|
862
|
-
allocation: "across",
|
|
863
|
-
target_type: "shipping_methods",
|
|
864
|
-
type: "percentage",
|
|
865
|
-
value: 100
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
1086
|
}
|
|
869
1087
|
];
|
|
870
1088
|
|
|
@@ -930,6 +1148,9 @@ var PROMOTION_CREATE_DEFAULTS = {
|
|
|
930
1148
|
status: "draft",
|
|
931
1149
|
rules: [],
|
|
932
1150
|
is_tax_inclusive: false,
|
|
1151
|
+
limit: void 0,
|
|
1152
|
+
cost_bearer: "store",
|
|
1153
|
+
shared_marketplace_percentage: null,
|
|
933
1154
|
application_method: {
|
|
934
1155
|
allocation: "each",
|
|
935
1156
|
type: "fixed",
|
|
@@ -956,6 +1177,7 @@ function CreatePromotionForm({
|
|
|
956
1177
|
});
|
|
957
1178
|
const { setValue, reset, getValues } = form;
|
|
958
1179
|
const { mutateAsync: createPromotion, isPending: isLoading } = useCreatePromotion();
|
|
1180
|
+
const { mutateAsync: upsertPromotionCost } = useUpsertPromotionCost();
|
|
959
1181
|
const handleSubmit = form.handleSubmit(
|
|
960
1182
|
async (data) => {
|
|
961
1183
|
if (data.campaign_choice === "existing" && !data.campaign_id) {
|
|
@@ -968,7 +1190,10 @@ function CreatePromotionForm({
|
|
|
968
1190
|
campaign_choice: _campaignChoice,
|
|
969
1191
|
is_automatic,
|
|
970
1192
|
is_tax_inclusive,
|
|
1193
|
+
cost_bearer,
|
|
1194
|
+
shared_marketplace_percentage,
|
|
971
1195
|
template_id: _templateId,
|
|
1196
|
+
seller_id: _sellerId,
|
|
972
1197
|
application_method,
|
|
973
1198
|
rules,
|
|
974
1199
|
...promotionData
|
|
@@ -1016,7 +1241,16 @@ function CreatePromotionForm({
|
|
|
1016
1241
|
is_automatic: is_automatic === "true"
|
|
1017
1242
|
},
|
|
1018
1243
|
{
|
|
1019
|
-
onSuccess: ({ promotion }) => {
|
|
1244
|
+
onSuccess: async ({ promotion }) => {
|
|
1245
|
+
try {
|
|
1246
|
+
await upsertPromotionCost({
|
|
1247
|
+
id: promotion.id,
|
|
1248
|
+
cost_bearer,
|
|
1249
|
+
shared_marketplace_percentage: cost_bearer === "shared" ? shared_marketplace_percentage : null
|
|
1250
|
+
});
|
|
1251
|
+
} catch (e) {
|
|
1252
|
+
toast.error(e.message);
|
|
1253
|
+
}
|
|
1020
1254
|
toast.success(
|
|
1021
1255
|
t("promotions.toasts.promotionCreateSuccess", {
|
|
1022
1256
|
code: promotion.code
|