@medusajs/dashboard 3.0.0-snapshot-20251212142124 → 3.0.0-snapshot-20251214110905
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-JQKPED4U.mjs → add-campaign-promotions-PHAHMGXP.mjs} +2 -2
- package/dist/{adjust-inventory-2MFA656V.mjs → adjust-inventory-I5VYMAI4.mjs} +2 -2
- package/dist/{api-key-management-create-ZUVF3SLR.mjs → api-key-management-create-CVRFY4PL.mjs} +2 -2
- package/dist/{api-key-management-detail-F7ZRCFPA.mjs → api-key-management-detail-HRVP6HRC.mjs} +3 -3
- package/dist/{api-key-management-edit-42HNUSXL.mjs → api-key-management-edit-JMU3WEPX.mjs} +2 -2
- package/dist/{api-key-management-sales-channels-7FVABESO.mjs → api-key-management-sales-channels-4OU5VGIG.mjs} +2 -2
- package/dist/app.css +45 -0
- package/dist/app.js +13473 -12039
- package/dist/app.mjs +4 -4
- package/dist/{campaign-budget-edit-6DMZGUCI.mjs → campaign-budget-edit-B5MSE26J.mjs} +2 -2
- package/dist/{campaign-configuration-UNFRB5HR.mjs → campaign-configuration-QOE3D2BE.mjs} +2 -2
- package/dist/{campaign-create-QXG7PD3S.mjs → campaign-create-FJOECKGT.mjs} +3 -3
- package/dist/{campaign-detail-6VNSVZHQ.mjs → campaign-detail-BDI3P2SF.mjs} +3 -3
- package/dist/{campaign-edit-HN4US7DV.mjs → campaign-edit-K2POQH7M.mjs} +2 -2
- package/dist/{categories-metadata-ORPB2LIW.mjs → categories-metadata-BARTITD5.mjs} +6 -6
- package/dist/{category-create-FFIBWXAH.mjs → category-create-L2KJCHPO.mjs} +2 -2
- package/dist/{category-detail-RICXPIVS.mjs → category-detail-CUMEBNXU.mjs} +22 -7
- package/dist/{category-edit-74MZ6TXN.mjs → category-edit-U6SLZSAX.mjs} +2 -2
- package/dist/{category-list-AH2EGTI7.mjs → category-list-W7JW4PWA.mjs} +16 -1
- package/dist/{category-organize-B6EFBFKB.mjs → category-organize-LLSVAO3U.mjs} +2 -2
- package/dist/{category-products-L4XIX3IQ.mjs → category-products-GYXTDDBQ.mjs} +8 -8
- package/dist/{chunk-XTQ7UFA3.mjs → chunk-2HDKZN4Q.mjs} +1 -1
- package/dist/chunk-35LSPN2U.mjs +66 -0
- package/dist/{chunk-PNPT4W2F.mjs → chunk-3BJLNORD.mjs} +1 -1
- package/dist/{chunk-4G2UHUXX.mjs → chunk-67KHYLIQ.mjs} +9 -9
- package/dist/{chunk-AMOGGDOW.mjs → chunk-AIZ6W4QI.mjs} +1 -1
- package/dist/{chunk-EQBVGH3N.mjs → chunk-B3AOQW2B.mjs} +1 -1
- package/dist/{chunk-UKECZ5PA.mjs → chunk-BBTE6VKD.mjs} +3 -3
- package/dist/{chunk-3YPRDSZ6.mjs → chunk-BZKI5J2M.mjs} +1 -1
- package/dist/{chunk-25UWYEJX.mjs → chunk-CQOOXWPZ.mjs} +1 -1
- package/dist/{chunk-42OOM4DJ.mjs → chunk-D6UW7URG.mjs} +23 -6
- package/dist/{chunk-LHNU4DYZ.mjs → chunk-DS5IRNJY.mjs} +2 -2
- package/dist/{chunk-4VNR7DND.mjs → chunk-F5NZDW7L.mjs} +2 -2
- package/dist/{chunk-JJGE3EV6.mjs → chunk-F63F3FIT.mjs} +2 -2
- package/dist/{chunk-W7SLPIO2.mjs → chunk-FEB3ZGTL.mjs} +214 -17
- package/dist/{chunk-4YAPXPLM.mjs → chunk-FPBKWWSI.mjs} +1 -1
- package/dist/{chunk-EXDBX4YX.mjs → chunk-GC3QXC6D.mjs} +3 -3
- package/dist/{chunk-JUVGXLY5.mjs → chunk-HKKZJTRO.mjs} +188 -13
- package/dist/{chunk-EQTBJSBZ.mjs → chunk-KIIT4BNH.mjs} +3 -0
- package/dist/{chunk-KF7ZWW4K.mjs → chunk-LCEKY54O.mjs} +2 -2
- package/dist/{chunk-D4J3CEWH.mjs → chunk-N3SAXQVR.mjs} +2 -2
- package/dist/{chunk-Q6MSICBU.mjs → chunk-O333RR6K.mjs} +1 -1
- package/dist/{chunk-YV4ANEZF.mjs → chunk-PXZEQZ6Q.mjs} +1 -1
- package/dist/{chunk-Q4E6LV6K.mjs → chunk-Q4AXBDFH.mjs} +269 -182
- package/dist/{chunk-CZFLKMYE.mjs → chunk-RMDYKRWW.mjs} +4 -4
- package/dist/{chunk-GN6OCHP4.mjs → chunk-RU4ZS47V.mjs} +11 -1
- package/dist/{chunk-UM4OIJZ3.mjs → chunk-S22SJRPO.mjs} +1 -1
- package/dist/{chunk-HWKLNKOY.mjs → chunk-U726TGCM.mjs} +1 -1
- package/dist/{chunk-XXBP2Z5M.mjs → chunk-WVA4O7QS.mjs} +1 -1
- package/dist/{chunk-L4NOVTH5.mjs → chunk-YIOBBZUB.mjs} +2 -2
- package/dist/{chunk-FIFVOKTK.mjs → chunk-Z6NHG5LQ.mjs} +1 -1
- package/dist/{collection-add-products-MO4FGYD5.mjs → collection-add-products-4WBPS6PY.mjs} +8 -8
- package/dist/{collection-create-DCRW344Z.mjs → collection-create-4JX4YE47.mjs} +2 -2
- package/dist/{collection-detail-ZCHVPXW5.mjs → collection-detail-HT4SSV32.mjs} +22 -7
- package/dist/{collection-edit-UNFEW6HT.mjs → collection-edit-MXL35GQQ.mjs} +2 -2
- package/dist/{collection-list-3UUFO7AP.mjs → collection-list-FYONEBDN.mjs} +29 -14
- package/dist/{collection-metadata-ZOYQDOOT.mjs → collection-metadata-YEZ2TBRX.mjs} +6 -6
- package/dist/{customer-create-XCLZENJS.mjs → customer-create-IA56MXE6.mjs} +2 -2
- package/dist/{customer-create-address-4HZUIAM7.mjs → customer-create-address-27M25HTO.mjs} +2 -2
- package/dist/{customer-detail-RMZTHQIQ.mjs → customer-detail-MB7CS7OG.mjs} +6 -6
- package/dist/{customer-edit-BW5GVTQI.mjs → customer-edit-XQ5NWIVX.mjs} +2 -2
- package/dist/{customer-group-add-customers-HUGHHMU6.mjs → customer-group-add-customers-DM4VLTNB.mjs} +5 -5
- package/dist/{customer-group-create-6YV7W6TI.mjs → customer-group-create-RY4FVEIW.mjs} +2 -2
- package/dist/{customer-group-detail-4S7WB3WV.mjs → customer-group-detail-U5UAP7QS.mjs} +6 -6
- package/dist/{customer-group-edit-7NXU34BQ.mjs → customer-group-edit-MQWARIQZ.mjs} +2 -2
- package/dist/{customer-group-list-JQX6PW6E.mjs → customer-group-list-KAS6JSCQ.mjs} +3 -3
- package/dist/{customer-group-metadata-WK2BGEGO.mjs → customer-group-metadata-JQJRLLXG.mjs} +3 -3
- package/dist/{customer-metadata-ZUWCUTM7.mjs → customer-metadata-HN2DYD5I.mjs} +3 -3
- package/dist/{customers-add-customer-group-JKTM33OU.mjs → customers-add-customer-group-UKLSPYEU.mjs} +8 -8
- package/dist/{edit-inventory-item-Y5W6VTHJ.mjs → edit-inventory-item-RATTNP2Y.mjs} +2 -2
- package/dist/{edit-inventory-item-attributes-NAAZDFEJ.mjs → edit-inventory-item-attributes-JHH5GSNL.mjs} +2 -2
- package/dist/{edit-reservation-2UD4RZJX.mjs → edit-reservation-UZCSNLHY.mjs} +2 -2
- package/dist/{edit-rules-AXG2NQNS.mjs → edit-rules-VMEHCXYQ.mjs} +5 -5
- package/dist/en.json +34 -0
- package/dist/{inventory-create-6SKU4TZL.mjs → inventory-create-KN72V2KK.mjs} +6 -6
- package/dist/{inventory-detail-LAYYI2QT.mjs → inventory-detail-7OHCFAJO.mjs} +3 -3
- package/dist/{inventory-metadata-Q6E6SZF3.mjs → inventory-metadata-I3IRRMLH.mjs} +6 -6
- package/dist/{inventory-stock-SNAWXRBE.mjs → inventory-stock-5IUICNEH.mjs} +7 -7
- package/dist/{invite-VKHAAF4Z.mjs → invite-FVE4ZBKB.mjs} +2 -2
- package/dist/{location-create-RPLEXUZR.mjs → location-create-WZ43K3W7.mjs} +2 -2
- package/dist/{location-detail-XXH22FLG.mjs → location-detail-3MSUGB4W.mjs} +8 -8
- package/dist/{location-edit-L4ISEQHX.mjs → location-edit-VCS7GVWQ.mjs} +2 -2
- package/dist/{location-fulfillment-providers-FSC27EK7.mjs → location-fulfillment-providers-ZVZMLCIC.mjs} +6 -6
- package/dist/{location-list-Z42ZYHUF.mjs → location-list-KVBA6J47.mjs} +2 -2
- package/dist/{location-sales-channels-YMABMECM.mjs → location-sales-channels-NKNM5TQK.mjs} +2 -2
- package/dist/{location-service-zone-create-NSMZCD5N.mjs → location-service-zone-create-3FWF3DG5.mjs} +3 -3
- package/dist/{location-service-zone-edit-6OUAFEZD.mjs → location-service-zone-edit-KHHMSPXD.mjs} +2 -2
- package/dist/{location-service-zone-manage-areas-SEC6LKCZ.mjs → location-service-zone-manage-areas-YFEAZUUN.mjs} +3 -3
- package/dist/{location-service-zone-shipping-option-create-GWNLLSM5.mjs → location-service-zone-shipping-option-create-CZWEHKVJ.mjs} +7 -7
- package/dist/{location-service-zone-shipping-option-edit-QS6HTWST.mjs → location-service-zone-shipping-option-edit-4CGPQ3VT.mjs} +5 -5
- package/dist/{location-service-zone-shipping-option-pricing-23QLNSBT.mjs → location-service-zone-shipping-option-pricing-Z5IFOLFJ.mjs} +4 -4
- package/dist/{login-MFUCIAT6.mjs → login-OCYZM7SI.mjs} +5 -5
- package/dist/{manage-locations-JD6FSBOT.mjs → manage-locations-MLNMPQ5I.mjs} +2 -2
- package/dist/{order-allocate-items-3DDI4V3W.mjs → order-allocate-items-VRPPVPP3.mjs} +3 -3
- package/dist/{order-create-claim-G7BDA7WR.mjs → order-create-claim-O3ZYTAIC.mjs} +7 -7
- package/dist/{order-create-edit-BXYPZRZV.mjs → order-create-edit-HUS7IRS3.mjs} +6 -6
- package/dist/{order-create-exchange-AGEXEKOF.mjs → order-create-exchange-TUP4NHHX.mjs} +13 -13
- package/dist/{order-create-fulfillment-GMLSBCEK.mjs → order-create-fulfillment-4BGDYHBB.mjs} +5 -5
- package/dist/{order-create-refund-BT33POIN.mjs → order-create-refund-FA5ERI7M.mjs} +5 -5
- package/dist/{order-create-return-QGXWSPMP.mjs → order-create-return-7GPHJ2WU.mjs} +4 -4
- package/dist/{order-create-shipment-ZVTOKNC4.mjs → order-create-shipment-27UBYPKT.mjs} +5 -5
- package/dist/{order-detail-MORQRSHL.mjs → order-detail-2J7KDTKG.mjs} +11 -11
- package/dist/{order-edit-billing-address-IUVC4GSZ.mjs → order-edit-billing-address-E7CD5FBQ.mjs} +5 -5
- package/dist/{order-edit-email-MKLJPREH.mjs → order-edit-email-ELRIQYVN.mjs} +5 -5
- package/dist/{order-edit-shipping-address-GFSRTDFG.mjs → order-edit-shipping-address-HVNAJUZI.mjs} +5 -5
- package/dist/order-export-TRMFVBFO.mjs +121 -0
- package/dist/{order-list-QOYJFYD5.mjs → order-list-Y4FET3XV.mjs} +38 -82
- package/dist/{order-metadata-BRSYOGKE.mjs → order-metadata-THARHEJC.mjs} +6 -6
- package/dist/{order-receive-return-NI345L43.mjs → order-receive-return-X5ASB7DL.mjs} +6 -6
- package/dist/{order-request-transfer-ZGGIUFRV.mjs → order-request-transfer-PKF4ULJY.mjs} +5 -5
- package/dist/{price-list-configuration-CWTP3Y5X.mjs → price-list-configuration-SZRY7CXO.mjs} +4 -4
- package/dist/{price-list-create-HDYM5ZGW.mjs → price-list-create-TYNSJDDM.mjs} +15 -15
- package/dist/{price-list-detail-GVGNB5AY.mjs → price-list-detail-ORYFRNB6.mjs} +6 -6
- package/dist/{price-list-edit-SW7YIR3Z.mjs → price-list-edit-I5QNCWJP.mjs} +2 -2
- package/dist/{price-list-prices-add-P4XHE3F4.mjs → price-list-prices-add-MWAUNUBF.mjs} +10 -10
- package/dist/{price-list-prices-edit-C6SX2TLJ.mjs → price-list-prices-edit-Z4YJ4YBY.mjs} +4 -4
- package/dist/{product-attributes-AXSXHPI5.mjs → product-attributes-5QW6ZEYB.mjs} +6 -6
- package/dist/{product-create-CAGTWFTS.mjs → product-create-YQ76CEF3.mjs} +7 -7
- package/dist/{product-create-option-GEGQNSMQ.mjs → product-create-option-UMZKRNTC.mjs} +2 -2
- package/dist/{product-create-variant-5DLZZQPL.mjs → product-create-variant-IASRY2JX.mjs} +6 -6
- package/dist/{product-detail-FSORFVRL.mjs → product-detail-NVLJQGGK.mjs} +51 -10
- package/dist/{product-edit-EYQIREZ6.mjs → product-edit-DP42G3EU.mjs} +6 -6
- package/dist/{product-edit-option-HBIOBQTS.mjs → product-edit-option-ZMTSLRG5.mjs} +2 -2
- package/dist/{product-export-4XRDDWZQ.mjs → product-export-OK5FCD42.mjs} +15 -15
- package/dist/{product-image-variants-edit-KCFCTXE2.mjs → product-image-variants-edit-VEWNL52X.mjs} +5 -5
- package/dist/{product-import-JTEXWYY7.mjs → product-import-LX625CIX.mjs} +5 -5
- package/dist/{product-list-T4OZG4OC.mjs → product-list-TXEPE6NL.mjs} +19 -7
- package/dist/{product-media-EGK66SRX.mjs → product-media-ULNJ7JJY.mjs} +2 -2
- package/dist/{product-metadata-5BLG4EIR.mjs → product-metadata-ZKKBE6GG.mjs} +6 -6
- package/dist/{product-organization-BEXN2KXC.mjs → product-organization-NMA2WJNT.mjs} +6 -6
- package/dist/{product-prices-WQDE4XYT.mjs → product-prices-5WCCQDS6.mjs} +3 -3
- package/dist/{product-sales-channels-ZICOOOKY.mjs → product-sales-channels-2PN4L7II.mjs} +2 -2
- package/dist/{product-shipping-profile-KIDRTPWA.mjs → product-shipping-profile-45XXB7FM.mjs} +2 -2
- package/dist/{product-stock-SSJVQPBZ.mjs → product-stock-KUHH6MFA.mjs} +7 -7
- package/dist/{product-tag-create-ZPYRJTC4.mjs → product-tag-create-7EVRE5BL.mjs} +5 -5
- package/dist/{product-tag-detail-VRGVJNDT.mjs → product-tag-detail-WULO55NT.mjs} +31 -16
- package/dist/{product-tag-edit-2KFYOID4.mjs → product-tag-edit-J4ODRLXN.mjs} +5 -5
- package/dist/{product-tag-list-WTX6GV7O.mjs → product-tag-list-V4CCQTL6.mjs} +31 -16
- package/dist/{product-tag-metadata-Y7YHTUKM.mjs → product-tag-metadata-KHDYQMSG.mjs} +6 -6
- package/dist/{product-type-create-HBDROTGB.mjs → product-type-create-KHSNCQCV.mjs} +2 -2
- package/dist/{product-type-detail-3ZLSMENL.mjs → product-type-detail-F35MUSLD.mjs} +22 -7
- package/dist/{product-type-edit-H3JCMVRV.mjs → product-type-edit-3LRBWZ3S.mjs} +2 -2
- package/dist/{product-type-list-QX7QC6RI.mjs → product-type-list-K2GULUPF.mjs} +19 -4
- package/dist/{product-type-metadata-GJACA4N6.mjs → product-type-metadata-CGXFFEJO.mjs} +6 -6
- package/dist/{product-variant-detail-L5G4CPVH.mjs → product-variant-detail-NT2MB3Z4.mjs} +19 -4
- package/dist/{product-variant-edit-YXALQPQT.mjs → product-variant-edit-KZ6D5CSA.mjs} +5 -5
- package/dist/{product-variant-manage-inventory-items-BLHCH6QD.mjs → product-variant-manage-inventory-items-OGM64KYP.mjs} +2 -2
- package/dist/{product-variant-media-KLSUISGH.mjs → product-variant-media-C3KCFODU.mjs} +2 -2
- package/dist/{product-variant-metadata-OQOE34VY.mjs → product-variant-metadata-I2PN64TH.mjs} +6 -6
- package/dist/{profile-edit-5EEKOEO5.mjs → profile-edit-YZCUGEXF.mjs} +2 -2
- package/dist/{promotion-add-campaign-JRTM7WBR.mjs → promotion-add-campaign-DO67QK6M.mjs} +3 -3
- package/dist/{promotion-create-OXNLKBL7.mjs → promotion-create-4KVSXYAI.mjs} +12 -12
- package/dist/{promotion-detail-N6VHHN3X.mjs → promotion-detail-NGNVELME.mjs} +3 -3
- package/dist/{promotion-edit-details-AREFQ6O5.mjs → promotion-edit-details-6BSOOWQN.mjs} +2 -2
- package/dist/{refund-reason-create-L36EUXXM.mjs → refund-reason-create-CTAPBK3X.mjs} +5 -5
- package/dist/{refund-reason-edit-364ALB4G.mjs → refund-reason-edit-B6HRNXGE.mjs} +5 -5
- package/dist/{refund-reason-list-ICO2GYRP.mjs → refund-reason-list-7OUHUORB.mjs} +4 -4
- package/dist/{region-add-countries-AFWXMQ6W.mjs → region-add-countries-7U4J5RW6.mjs} +2 -2
- package/dist/{region-create-YC4VZ4AS.mjs → region-create-IUGX33M5.mjs} +2 -2
- package/dist/{region-edit-5GO25GDF.mjs → region-edit-WAU347DP.mjs} +2 -2
- package/dist/{region-metadata-VNLW6NYZ.mjs → region-metadata-GRG3QSJY.mjs} +6 -6
- package/dist/{reservation-create-Z2SUMBGT.mjs → reservation-create-C6HTEF3R.mjs} +2 -2
- package/dist/{reservation-detail-YXIUIN5I.mjs → reservation-detail-KAI7N5UP.mjs} +3 -3
- package/dist/{reservation-metadata-7H7TYWZW.mjs → reservation-metadata-TWV7KLOB.mjs} +6 -6
- package/dist/{reset-password-5TAYQEUV.mjs → reset-password-Y5WVXV4Q.mjs} +2 -2
- package/dist/{return-reason-create-NXWDC6AC.mjs → return-reason-create-HM54WRJY.mjs} +2 -2
- package/dist/{return-reason-edit-M6IKNNKB.mjs → return-reason-edit-VSIRHVQ6.mjs} +2 -2
- package/dist/return-reason-list-IFFIDA5O.mjs +1 -1
- package/dist/{sales-channel-add-products-N7EPWF2N.mjs → sales-channel-add-products-CBECZU46.mjs} +8 -8
- package/dist/{sales-channel-create-E7BDTPWD.mjs → sales-channel-create-4XLJDVJO.mjs} +2 -2
- package/dist/{sales-channel-detail-DV6BKC5B.mjs → sales-channel-detail-NQSBPPIE.mjs} +6 -6
- package/dist/{sales-channel-edit-HMPA3Y3L.mjs → sales-channel-edit-UZGSXD5X.mjs} +2 -2
- package/dist/{sales-channel-list-33QC2ZXP.mjs → sales-channel-list-UYN2OCBR.mjs} +3 -3
- package/dist/{sales-channel-metadata-HYYQEVRZ.mjs → sales-channel-metadata-4XWXYN2E.mjs} +6 -6
- package/dist/{shipping-option-type-create-IXYDKBKG.mjs → shipping-option-type-create-U7PIKVMV.mjs} +5 -5
- package/dist/{shipping-option-type-detail-WMZ3DEY6.mjs → shipping-option-type-detail-QNZLQGI6.mjs} +4 -4
- package/dist/{shipping-option-type-edit-YYO3Q2QV.mjs → shipping-option-type-edit-BP6HLZ7B.mjs} +5 -5
- package/dist/{shipping-option-type-list-YAL6IQF2.mjs → shipping-option-type-list-L274RM6A.mjs} +4 -4
- package/dist/{shipping-profile-create-752TMBBE.mjs → shipping-profile-create-26R64I3Z.mjs} +2 -2
- package/dist/{shipping-profile-metadata-YBXPOVZF.mjs → shipping-profile-metadata-BZKPLXHO.mjs} +6 -6
- package/dist/{store-add-currencies-3VMLZ6KB.mjs → store-add-currencies-ZFS3WZHG.mjs} +2 -2
- package/dist/{store-add-locales-AYY44DB3.mjs → store-add-locales-EXR3NLOM.mjs} +4 -4
- package/dist/{store-detail-4YVABC3P.mjs → store-detail-T4YY5NHG.mjs} +3 -3
- package/dist/{store-edit-EPAHLLKP.mjs → store-edit-AB5CDUTK.mjs} +2 -2
- package/dist/{store-metadata-QQD2NP5U.mjs → store-metadata-FN3WZLXA.mjs} +6 -6
- package/dist/{tax-region-create-AFGAIC3C.mjs → tax-region-create-PWXTFE3Q.mjs} +5 -5
- package/dist/{tax-region-detail-LM7VIA2N.mjs → tax-region-detail-GJW63AMV.mjs} +22 -22
- package/dist/{tax-region-edit-ZLSY22NQ.mjs → tax-region-edit-WOUO7TPQ.mjs} +5 -5
- package/dist/{tax-region-list-BXZBUXRJ.mjs → tax-region-list-P4LDOPZD.mjs} +3 -3
- package/dist/{tax-region-province-create-5JP3PVID.mjs → tax-region-province-create-GKJ7WMRS.mjs} +2 -2
- package/dist/{tax-region-province-detail-ZF75A3Z2.mjs → tax-region-province-detail-FCHPIRXW.mjs} +21 -21
- package/dist/{tax-region-tax-override-create-JVMTMMWB.mjs → tax-region-tax-override-create-ZLWXRNLN.mjs} +16 -16
- package/dist/{tax-region-tax-override-edit-HS4BCVC7.mjs → tax-region-tax-override-edit-ZM2JUFNJ.mjs} +17 -17
- package/dist/{tax-region-tax-rate-create-O2SDSXCH.mjs → tax-region-tax-rate-create-MECFGVPL.mjs} +2 -2
- package/dist/{tax-region-tax-rate-edit-W62VEVKT.mjs → tax-region-tax-rate-edit-7DYSPYOD.mjs} +2 -2
- package/dist/translation-list-Y2GWTRGW.mjs +302 -0
- package/dist/translations-edit-PM4PSMRF.mjs +390 -0
- package/dist/{user-edit-LXQCTDGA.mjs → user-edit-ZBB4RMTP.mjs} +2 -2
- package/dist/{user-invite-2OKB7SCF.mjs → user-invite-XB635N26.mjs} +2 -2
- package/dist/{user-metadata-U3WGLABX.mjs → user-metadata-LNADHFTW.mjs} +6 -6
- package/dist/{workflow-execution-detail-L4IESFKA.mjs → workflow-execution-detail-POTSURJX.mjs} +4 -4
- package/package.json +9 -9
- package/src/components/common/icon-avatar/icon-avatar.tsx +4 -0
- package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
- package/src/components/data-grid/components/index.ts +1 -0
- package/src/components/data-grid/data-grid.tsx +2 -0
- package/src/components/layout/settings-layout/settings-layout.tsx +11 -1
- package/src/components/modals/route-focus-modal/route-focus-modal.tsx +8 -3
- package/src/components/modals/route-modal-form/route-modal-form.tsx +6 -1
- package/src/components/modals/route-modal-provider/route-provider.tsx +16 -4
- package/src/dashboard-app/routes/get-route.map.tsx +25 -0
- package/src/hooks/api/index.ts +1 -0
- package/src/hooks/api/orders.tsx +18 -1
- package/src/hooks/api/product-variants.tsx +7 -1
- package/src/hooks/api/translations.tsx +254 -0
- package/src/i18n/translations/$schema.json +104 -0
- package/src/i18n/translations/en.json +34 -0
- package/src/i18n/translations/es.json +22 -0
- package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +16 -1
- package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +16 -1
- package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +16 -1
- package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +16 -1
- package/src/routes/orders/order-export/components/export-filters.tsx +22 -0
- package/src/routes/orders/order-export/index.ts +1 -0
- package/src/routes/orders/order-export/order-export.tsx +66 -0
- package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +14 -6
- package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +8 -2
- package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +16 -1
- package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +16 -1
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +16 -1
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +16 -1
- package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +16 -1
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +32 -1
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +15 -1
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +68 -0
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +46 -0
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +67 -0
- package/src/routes/translations/translation-list/index.tsx +1 -0
- package/src/routes/translations/translation-list/translation-list.tsx +128 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +423 -0
- package/src/routes/translations/translations-edit/index.ts +1 -0
- package/src/routes/translations/translations-edit/translations-edit.tsx +67 -0
- package/src/routes/translations/translations-edit/utils/index.ts +1 -0
- package/src/routes/translations/translations-edit/utils/reference-label-map.ts +10 -0
- package/dist/{customer-list-ZXCGIXJC.mjs → customer-list-TG4D4QOT.mjs} +3 -3
- package/dist/{region-list-XQRIBDMF.mjs → region-list-JAQXIBYD.mjs} +3 -3
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Container, Heading, Text } from "@medusajs/ui"
|
|
2
|
+
import { TwoColumnPage } from "../../../components/layout/pages"
|
|
3
|
+
import { useTranslation } from "react-i18next"
|
|
4
|
+
import { Buildings } from "@medusajs/icons"
|
|
5
|
+
import { useStore } from "../../../hooks/api"
|
|
6
|
+
import { ActiveLocalesSection } from "./components/active-locales-section/active-locales-section"
|
|
7
|
+
import { TranslationListSection } from "./components/translation-list-section/translation-list-section"
|
|
8
|
+
import { TranslationsCompletionSection } from "./components/translations-completion-section/translations-completion-section"
|
|
9
|
+
import { TwoColumnPageSkeleton } from "../../../components/common/skeleton"
|
|
10
|
+
|
|
11
|
+
export type TranslatableEntity = {
|
|
12
|
+
icon: React.ReactNode
|
|
13
|
+
label: string
|
|
14
|
+
reference: string
|
|
15
|
+
translatedCount?: number
|
|
16
|
+
totalCount?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const TRANSLATABLE_ENTITIES: TranslatableEntity[] = [
|
|
20
|
+
{
|
|
21
|
+
icon: <Buildings />,
|
|
22
|
+
label: "Product",
|
|
23
|
+
reference: "product",
|
|
24
|
+
translatedCount: 4,
|
|
25
|
+
totalCount: 96,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
icon: <Buildings />,
|
|
29
|
+
label: "Product Variants",
|
|
30
|
+
reference: "product_variant",
|
|
31
|
+
translatedCount: 4,
|
|
32
|
+
totalCount: 200000,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
icon: <Buildings />,
|
|
36
|
+
label: "Product Categories",
|
|
37
|
+
reference: "product_category",
|
|
38
|
+
translatedCount: 96,
|
|
39
|
+
totalCount: 96,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
icon: <Buildings />,
|
|
43
|
+
label: "Product Collections",
|
|
44
|
+
reference: "product_collection",
|
|
45
|
+
translatedCount: 4,
|
|
46
|
+
totalCount: 96,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
icon: <Buildings />,
|
|
50
|
+
label: "Product Types",
|
|
51
|
+
reference: "product_type",
|
|
52
|
+
translatedCount: 4,
|
|
53
|
+
totalCount: 96,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
icon: <Buildings />,
|
|
57
|
+
label: "Product Tags",
|
|
58
|
+
reference: "product_tag",
|
|
59
|
+
translatedCount: 96,
|
|
60
|
+
totalCount: 96,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
icon: <Buildings />,
|
|
64
|
+
label: "Product Options",
|
|
65
|
+
reference: "product_option",
|
|
66
|
+
translatedCount: 96,
|
|
67
|
+
totalCount: 96,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
icon: <Buildings />,
|
|
71
|
+
label: "Product Option Values",
|
|
72
|
+
reference: "product_option_value",
|
|
73
|
+
translatedCount: 96,
|
|
74
|
+
totalCount: 96,
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
export const TranslationList = () => {
|
|
79
|
+
const { t } = useTranslation()
|
|
80
|
+
|
|
81
|
+
const { store, isPending, isError, error } = useStore()
|
|
82
|
+
|
|
83
|
+
if (isError) {
|
|
84
|
+
throw error
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const isReady = !!store && !isPending
|
|
88
|
+
|
|
89
|
+
if (!isReady) {
|
|
90
|
+
return <TwoColumnPageSkeleton sidebarSections={2} />
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const hasLocales = (store?.supported_locales ?? []).length > 0
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<TwoColumnPage
|
|
97
|
+
widgets={{
|
|
98
|
+
before: [],
|
|
99
|
+
after: [],
|
|
100
|
+
sideBefore: [],
|
|
101
|
+
sideAfter: [],
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<TwoColumnPage.Main>
|
|
105
|
+
<Container className="flex flex-col px-6 py-4">
|
|
106
|
+
<Heading>Manage {t("translations.domain")}</Heading>
|
|
107
|
+
<Text className="text-ui-fg-subtle" size="small">
|
|
108
|
+
{t("translations.subtitle")}
|
|
109
|
+
</Text>
|
|
110
|
+
</Container>
|
|
111
|
+
<TranslationListSection
|
|
112
|
+
entities={TRANSLATABLE_ENTITIES}
|
|
113
|
+
hasLocales={hasLocales}
|
|
114
|
+
/>
|
|
115
|
+
</TwoColumnPage.Main>
|
|
116
|
+
<TwoColumnPage.Sidebar>
|
|
117
|
+
<ActiveLocalesSection
|
|
118
|
+
locales={
|
|
119
|
+
store?.supported_locales?.map(
|
|
120
|
+
(suportedLocale) => suportedLocale.locale
|
|
121
|
+
) ?? []
|
|
122
|
+
}
|
|
123
|
+
></ActiveLocalesSection>
|
|
124
|
+
<TranslationsCompletionSection />
|
|
125
|
+
</TwoColumnPage.Sidebar>
|
|
126
|
+
</TwoColumnPage>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./translations-edit-form"
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { zodResolver } from "@hookform/resolvers/zod"
|
|
2
|
+
import { AdminStoreLocale, HttpTypes } from "@medusajs/types"
|
|
3
|
+
import { Button, ProgressTabs, toast } from "@medusajs/ui"
|
|
4
|
+
import { ColumnDef } from "@tanstack/react-table"
|
|
5
|
+
import { useMemo, useRef } from "react"
|
|
6
|
+
import { useForm } from "react-hook-form"
|
|
7
|
+
import { useTranslation } from "react-i18next"
|
|
8
|
+
import { z } from "zod"
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
createDataGridHelper,
|
|
12
|
+
DataGrid,
|
|
13
|
+
} from "../../../../../components/data-grid"
|
|
14
|
+
import {
|
|
15
|
+
RouteFocusModal,
|
|
16
|
+
useRouteModal,
|
|
17
|
+
} from "../../../../../components/modals"
|
|
18
|
+
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
|
19
|
+
import { useBatchTranslations } from "../../../../../hooks/api/translations"
|
|
20
|
+
import { useDocumentDirection } from "../../../../../hooks/use-document-direction"
|
|
21
|
+
import { REFERENCE_LABEL_MAP } from "../../utils"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Schema for a single locale translation (subrow in DataGrid).
|
|
25
|
+
*/
|
|
26
|
+
const LocaleTranslationSchema = z.object({
|
|
27
|
+
id: z.string().nullish(),
|
|
28
|
+
locale_code: z.string(),
|
|
29
|
+
fields: z.record(z.string().optional()),
|
|
30
|
+
})
|
|
31
|
+
export type LocaleTranslationSchema = z.infer<typeof LocaleTranslationSchema>
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Schema for an entity's translations (parent row in DataGrid).
|
|
35
|
+
* Contains all locale translations for that entity.
|
|
36
|
+
*/
|
|
37
|
+
const EntityTranslationsSchema = z.object({
|
|
38
|
+
locales: z.record(LocaleTranslationSchema),
|
|
39
|
+
})
|
|
40
|
+
export type EntityTranslationsSchema = z.infer<typeof EntityTranslationsSchema>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Form schema
|
|
44
|
+
* Maps each reference_id to their corresponding translations for each locale
|
|
45
|
+
*/
|
|
46
|
+
export const TranslationsFormSchema = z.object({
|
|
47
|
+
entities: z.record(EntityTranslationsSchema),
|
|
48
|
+
})
|
|
49
|
+
export type TranslationsFormSchema = z.infer<typeof TranslationsFormSchema>
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Row types for the DataGrid.
|
|
53
|
+
* Parent rows are entities, subrows are locale translations.
|
|
54
|
+
*/
|
|
55
|
+
export type TranslationRow = EntityRow | LocaleRow
|
|
56
|
+
|
|
57
|
+
export type EntityRow = {
|
|
58
|
+
_type: "entity"
|
|
59
|
+
reference_id: string
|
|
60
|
+
subRows: LocaleRow[]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type LocaleRow = {
|
|
64
|
+
_type: "locale"
|
|
65
|
+
reference_id: string
|
|
66
|
+
locale_code: string
|
|
67
|
+
locale_name: string
|
|
68
|
+
id?: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isEntityRow(row: TranslationRow): row is EntityRow {
|
|
72
|
+
return row._type === "entity"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function isLocaleRow(row: TranslationRow): row is LocaleRow {
|
|
76
|
+
return row._type === "locale"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function initTranslationsFormState(
|
|
80
|
+
translations: HttpTypes.AdminTranslation[],
|
|
81
|
+
references: { id: string; [key: string]: string }[],
|
|
82
|
+
availableLocales: AdminStoreLocale[],
|
|
83
|
+
translatableFields: string[]
|
|
84
|
+
): TranslationsFormSchema {
|
|
85
|
+
const existingMap = new Map<string, HttpTypes.AdminTranslation>()
|
|
86
|
+
for (const t of translations) {
|
|
87
|
+
existingMap.set(`${t.reference_id}:${t.locale_code}`, t)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const entitiesTranslationState: Record<string, EntityTranslationsSchema> = {}
|
|
91
|
+
|
|
92
|
+
for (const reference of references) {
|
|
93
|
+
const locales: Record<string, LocaleTranslationSchema> = {}
|
|
94
|
+
|
|
95
|
+
for (const locale of availableLocales) {
|
|
96
|
+
const key = `${reference.id}:${locale.locale_code}`
|
|
97
|
+
const existing = existingMap.get(key)
|
|
98
|
+
const isDefaultLocale = locale.is_default
|
|
99
|
+
|
|
100
|
+
const fields: Record<string, string> = {}
|
|
101
|
+
for (const fieldName of translatableFields) {
|
|
102
|
+
const fieldValue = isDefaultLocale
|
|
103
|
+
? (existing?.translations?.[fieldName] as string) ??
|
|
104
|
+
reference[fieldName]
|
|
105
|
+
: (existing?.translations?.[fieldName] as string) ?? ""
|
|
106
|
+
fields[fieldName] = fieldValue
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
locales[locale.locale_code] = {
|
|
110
|
+
id: existing?.id ?? null,
|
|
111
|
+
locale_code: locale.locale_code,
|
|
112
|
+
fields,
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
entitiesTranslationState[reference.id] = { locales }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
entities: entitiesTranslationState,
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function buildTranslationRows(
|
|
125
|
+
references: { id: string; [key: string]: string }[],
|
|
126
|
+
availableLocales: AdminStoreLocale[],
|
|
127
|
+
translations: HttpTypes.AdminTranslation[]
|
|
128
|
+
): TranslationRow[] {
|
|
129
|
+
// Index existing translations by reference_id:locale_code
|
|
130
|
+
const existingMap = new Map<string, HttpTypes.AdminTranslation>()
|
|
131
|
+
for (const t of translations) {
|
|
132
|
+
existingMap.set(`${t.reference_id}:${t.locale_code}`, t)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return references.map((reference) => ({
|
|
136
|
+
_type: "entity" as const,
|
|
137
|
+
reference_id: reference.id,
|
|
138
|
+
subRows: availableLocales.map((locale) => {
|
|
139
|
+
const key = `${reference.id}:${locale.locale_code}`
|
|
140
|
+
const existing = existingMap.get(key)
|
|
141
|
+
return {
|
|
142
|
+
_type: "locale" as const,
|
|
143
|
+
reference_id: reference.id,
|
|
144
|
+
locale_code: locale.locale_code,
|
|
145
|
+
locale_name: locale.locale.name,
|
|
146
|
+
id: existing?.id,
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
}))
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function transformToBatchPayload(
|
|
153
|
+
currentState: TranslationsFormSchema,
|
|
154
|
+
initialState: TranslationsFormSchema,
|
|
155
|
+
entityType: string
|
|
156
|
+
): Required<HttpTypes.AdminBatchTranslations> {
|
|
157
|
+
const payload: Required<HttpTypes.AdminBatchTranslations> = {
|
|
158
|
+
create: [],
|
|
159
|
+
update: [],
|
|
160
|
+
delete: [],
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
for (const [entityId, entityData] of Object.entries(currentState.entities)) {
|
|
164
|
+
for (const [localeCode, localeTranslations] of Object.entries(
|
|
165
|
+
entityData.locales
|
|
166
|
+
)) {
|
|
167
|
+
const initial = initialState.entities[entityId]?.locales[localeCode]
|
|
168
|
+
const hasContent = Object.values(localeTranslations.fields).some(
|
|
169
|
+
(v) => v !== undefined && v.trim() !== ""
|
|
170
|
+
)
|
|
171
|
+
const hadContent =
|
|
172
|
+
initial &&
|
|
173
|
+
Object.values(initial.fields).some(
|
|
174
|
+
(v) => v !== undefined && v.trim() !== ""
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
if (!localeTranslations.id && hasContent) {
|
|
178
|
+
payload.create.push({
|
|
179
|
+
reference_id: entityId,
|
|
180
|
+
reference: entityType,
|
|
181
|
+
locale_code: localeTranslations.locale_code,
|
|
182
|
+
translations: localeTranslations.fields,
|
|
183
|
+
})
|
|
184
|
+
} else if (localeTranslations.id && hasContent) {
|
|
185
|
+
// UPDATE: Has ID and has content - check if changed
|
|
186
|
+
const hasChanged =
|
|
187
|
+
!initial ||
|
|
188
|
+
JSON.stringify(localeTranslations.fields) !==
|
|
189
|
+
JSON.stringify(initial.fields)
|
|
190
|
+
|
|
191
|
+
if (hasChanged) {
|
|
192
|
+
payload.update.push({
|
|
193
|
+
id: localeTranslations.id,
|
|
194
|
+
translations: localeTranslations.fields,
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
} else if (localeTranslations.id && !hasContent && hadContent) {
|
|
198
|
+
payload.delete.push(localeTranslations.id)
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return payload
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const columnHelper = createDataGridHelper<
|
|
207
|
+
TranslationRow,
|
|
208
|
+
TranslationsFormSchema
|
|
209
|
+
>()
|
|
210
|
+
|
|
211
|
+
function useTranslationsGridColumns({
|
|
212
|
+
translatableFields,
|
|
213
|
+
modalFields = [],
|
|
214
|
+
}: {
|
|
215
|
+
translatableFields: string[]
|
|
216
|
+
modalFields?: string[]
|
|
217
|
+
}) {
|
|
218
|
+
const { t } = useTranslation()
|
|
219
|
+
|
|
220
|
+
const columns: ColumnDef<TranslationRow>[] = useMemo(() => {
|
|
221
|
+
return [
|
|
222
|
+
columnHelper.column({
|
|
223
|
+
id: "locale",
|
|
224
|
+
header: t("translations.bulk.mainColumn"),
|
|
225
|
+
cell: (context) => {
|
|
226
|
+
const row = context.row.original
|
|
227
|
+
|
|
228
|
+
if (isEntityRow(row)) {
|
|
229
|
+
return (
|
|
230
|
+
<DataGrid.ReadonlyCell context={context}></DataGrid.ReadonlyCell>
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
<DataGrid.ReadonlyCell context={context} color="normal">
|
|
236
|
+
<div className="flex h-full w-full items-center gap-x-2 overflow-hidden">
|
|
237
|
+
<span className="truncate">{row.locale_name}</span>
|
|
238
|
+
</div>
|
|
239
|
+
</DataGrid.ReadonlyCell>
|
|
240
|
+
)
|
|
241
|
+
},
|
|
242
|
+
disableHiding: true,
|
|
243
|
+
}),
|
|
244
|
+
...translatableFields.map((fieldName) => {
|
|
245
|
+
const useModal = modalFields.includes(fieldName)
|
|
246
|
+
|
|
247
|
+
return columnHelper.column({
|
|
248
|
+
id: fieldName,
|
|
249
|
+
header: t(`fields.${fieldName}`, { defaultValue: fieldName }),
|
|
250
|
+
cell: (context) => {
|
|
251
|
+
const row = context.row.original
|
|
252
|
+
|
|
253
|
+
if (isEntityRow(row)) {
|
|
254
|
+
return (
|
|
255
|
+
<DataGrid.ReadonlyCell context={context}>
|
|
256
|
+
<span className="text-ui-fg-muted">—</span>
|
|
257
|
+
</DataGrid.ReadonlyCell>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (useModal) {
|
|
262
|
+
return (
|
|
263
|
+
<DataGrid.ExpandableTextCell
|
|
264
|
+
context={context}
|
|
265
|
+
fieldLabel={fieldName}
|
|
266
|
+
/>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return <DataGrid.TextCell context={context} />
|
|
271
|
+
},
|
|
272
|
+
field: (context) => {
|
|
273
|
+
const row = context.row.original
|
|
274
|
+
|
|
275
|
+
if (isEntityRow(row)) {
|
|
276
|
+
return null
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return `entities.${row.reference_id}.locales.${row.locale_code}.fields.${fieldName}`
|
|
280
|
+
},
|
|
281
|
+
type: "text",
|
|
282
|
+
})
|
|
283
|
+
}),
|
|
284
|
+
]
|
|
285
|
+
}, [t, translatableFields, modalFields])
|
|
286
|
+
|
|
287
|
+
return columns
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type TranslationsEditFormProps = {
|
|
291
|
+
translations: HttpTypes.AdminTranslation[]
|
|
292
|
+
references: { id: string; [key: string]: string }[]
|
|
293
|
+
entityType: string
|
|
294
|
+
availableLocales: AdminStoreLocale[]
|
|
295
|
+
translatableFields: string[]
|
|
296
|
+
modalFields?: string[]
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export const TranslationsEditForm = ({
|
|
300
|
+
translations,
|
|
301
|
+
references,
|
|
302
|
+
entityType,
|
|
303
|
+
availableLocales,
|
|
304
|
+
translatableFields,
|
|
305
|
+
modalFields = [],
|
|
306
|
+
}: TranslationsEditFormProps) => {
|
|
307
|
+
const { t } = useTranslation()
|
|
308
|
+
const { handleSuccess, setCloseOnEscape } = useRouteModal()
|
|
309
|
+
const direction = useDocumentDirection()
|
|
310
|
+
|
|
311
|
+
const entities = useMemo(() => references, [references])
|
|
312
|
+
|
|
313
|
+
const initialState = useRef(
|
|
314
|
+
initTranslationsFormState(
|
|
315
|
+
translations,
|
|
316
|
+
entities,
|
|
317
|
+
availableLocales,
|
|
318
|
+
translatableFields
|
|
319
|
+
)
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
const form = useForm<TranslationsFormSchema>({
|
|
323
|
+
resolver: zodResolver(TranslationsFormSchema),
|
|
324
|
+
defaultValues: initialState.current,
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
const rows = useMemo(
|
|
328
|
+
() => buildTranslationRows(entities, availableLocales, translations),
|
|
329
|
+
[entities, availableLocales, translations]
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
const { mutateAsync, isPending } = useBatchTranslations(entityType)
|
|
333
|
+
|
|
334
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
335
|
+
const payload = transformToBatchPayload(
|
|
336
|
+
values,
|
|
337
|
+
initialState.current,
|
|
338
|
+
entityType
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
if (
|
|
342
|
+
payload.create.length === 0 &&
|
|
343
|
+
payload.update.length === 0 &&
|
|
344
|
+
payload.delete.length === 0
|
|
345
|
+
) {
|
|
346
|
+
toast.info(
|
|
347
|
+
t("translations.noChanges", { defaultValue: "No changes to save" })
|
|
348
|
+
)
|
|
349
|
+
return
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
await mutateAsync(payload, {
|
|
353
|
+
onSuccess: () => {
|
|
354
|
+
toast.success(
|
|
355
|
+
t("translations.edit.successToast", {
|
|
356
|
+
defaultValue: "Translations updated successfully",
|
|
357
|
+
})
|
|
358
|
+
)
|
|
359
|
+
handleSuccess()
|
|
360
|
+
},
|
|
361
|
+
onError: (error) => {
|
|
362
|
+
toast.error(error.message)
|
|
363
|
+
},
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
const columns = useTranslationsGridColumns({
|
|
368
|
+
translatableFields,
|
|
369
|
+
modalFields,
|
|
370
|
+
})
|
|
371
|
+
|
|
372
|
+
return (
|
|
373
|
+
<RouteFocusModal.Form form={form}>
|
|
374
|
+
<KeyboundForm onSubmit={handleSubmit} className="flex h-full flex-col">
|
|
375
|
+
<ProgressTabs
|
|
376
|
+
dir={direction}
|
|
377
|
+
defaultValue={entityType}
|
|
378
|
+
className="flex h-full flex-col overflow-hidden"
|
|
379
|
+
>
|
|
380
|
+
<RouteFocusModal.Header>
|
|
381
|
+
<div className="-my-2 w-full border-l">
|
|
382
|
+
<ProgressTabs.List className="justify-start-start flex w-full items-center">
|
|
383
|
+
<ProgressTabs.Trigger value={entityType}>
|
|
384
|
+
{REFERENCE_LABEL_MAP[entityType]}
|
|
385
|
+
</ProgressTabs.Trigger>
|
|
386
|
+
</ProgressTabs.List>
|
|
387
|
+
</div>
|
|
388
|
+
</RouteFocusModal.Header>
|
|
389
|
+
<RouteFocusModal.Body className="size-full overflow-hidden">
|
|
390
|
+
<ProgressTabs.Content
|
|
391
|
+
value={entityType}
|
|
392
|
+
className="size-full overflow-y-auto"
|
|
393
|
+
>
|
|
394
|
+
<DataGrid
|
|
395
|
+
columns={columns}
|
|
396
|
+
data={rows}
|
|
397
|
+
getSubRows={(row) => {
|
|
398
|
+
if (isEntityRow(row)) {
|
|
399
|
+
return row.subRows
|
|
400
|
+
}
|
|
401
|
+
}}
|
|
402
|
+
state={form}
|
|
403
|
+
onEditingChange={(editing) => setCloseOnEscape(!editing)}
|
|
404
|
+
/>
|
|
405
|
+
</ProgressTabs.Content>
|
|
406
|
+
</RouteFocusModal.Body>
|
|
407
|
+
<RouteFocusModal.Footer>
|
|
408
|
+
<div className="flex items-center justify-end gap-x-2">
|
|
409
|
+
<RouteFocusModal.Close asChild>
|
|
410
|
+
<Button size="small" variant="secondary">
|
|
411
|
+
{t("actions.cancel")}
|
|
412
|
+
</Button>
|
|
413
|
+
</RouteFocusModal.Close>
|
|
414
|
+
<Button size="small" type="submit" isLoading={isPending}>
|
|
415
|
+
{t("actions.save")}
|
|
416
|
+
</Button>
|
|
417
|
+
</div>
|
|
418
|
+
</RouteFocusModal.Footer>
|
|
419
|
+
</ProgressTabs>
|
|
420
|
+
</KeyboundForm>
|
|
421
|
+
</RouteFocusModal.Form>
|
|
422
|
+
)
|
|
423
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TranslationsEdit as Component } from "./translations-edit"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useNavigate, useSearchParams } from "react-router-dom"
|
|
2
|
+
import { useReferenceTranslations, useStore } from "../../../hooks/api"
|
|
3
|
+
import { TranslationsEditForm } from "./components/translations-edit-form"
|
|
4
|
+
import { useEffect } from "react"
|
|
5
|
+
import { RouteFocusModal } from "../../../components/modals"
|
|
6
|
+
import { useFeatureFlag } from "../../../providers/feature-flag-provider"
|
|
7
|
+
|
|
8
|
+
export const TranslationsEdit = () => {
|
|
9
|
+
const isTranslationsEnabled = useFeatureFlag("translation")
|
|
10
|
+
const navigate = useNavigate()
|
|
11
|
+
const [searchParams] = useSearchParams()
|
|
12
|
+
const reference = searchParams.get("reference")
|
|
13
|
+
const referenceIdParam = searchParams.getAll("reference_id")
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!reference || !isTranslationsEnabled) {
|
|
17
|
+
navigate(-1)
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
}, [reference, navigate, isTranslationsEnabled])
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
translations,
|
|
24
|
+
references,
|
|
25
|
+
translatableFields,
|
|
26
|
+
isPending,
|
|
27
|
+
isError,
|
|
28
|
+
error,
|
|
29
|
+
} = useReferenceTranslations(reference!, referenceIdParam, {
|
|
30
|
+
enabled: !!reference,
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
store,
|
|
35
|
+
isPending: isStorePending,
|
|
36
|
+
isError: isStoreError,
|
|
37
|
+
error: storeError,
|
|
38
|
+
} = useStore()
|
|
39
|
+
|
|
40
|
+
const ready =
|
|
41
|
+
!isPending &&
|
|
42
|
+
!!translations &&
|
|
43
|
+
!!translatableFields &&
|
|
44
|
+
!!references &&
|
|
45
|
+
!isStorePending &&
|
|
46
|
+
!!store
|
|
47
|
+
|
|
48
|
+
if (isError || isStoreError) {
|
|
49
|
+
throw error || storeError
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<RouteFocusModal prev={referenceIdParam.length ? -1 : ".."}>
|
|
54
|
+
{ready && (
|
|
55
|
+
<TranslationsEditForm
|
|
56
|
+
translations={translations}
|
|
57
|
+
references={references}
|
|
58
|
+
entityType={reference!}
|
|
59
|
+
availableLocales={store?.supported_locales ?? []}
|
|
60
|
+
// TODO: change this to get it from the entity translation config when we have it
|
|
61
|
+
translatableFields={translatableFields}
|
|
62
|
+
modalFields={translatableFields}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</RouteFocusModal>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./reference-label-map"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const REFERENCE_LABEL_MAP: Record<string, string> = {
|
|
2
|
+
product: "Products",
|
|
3
|
+
product_variant: "Product Variants",
|
|
4
|
+
product_category: "Product Categories",
|
|
5
|
+
product_collection: "Product Collections",
|
|
6
|
+
product_type: "Product Types",
|
|
7
|
+
product_tag: "Product Tags",
|
|
8
|
+
product_option: "Product Options",
|
|
9
|
+
product_option_value: "Product Option Values",
|
|
10
|
+
}
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
} from "./chunk-YTN73JYH.mjs";
|
|
12
12
|
import "./chunk-HQKGZADC.mjs";
|
|
13
13
|
import "./chunk-EMIHDNB7.mjs";
|
|
14
|
-
import {
|
|
15
|
-
useCustomerTableQuery
|
|
16
|
-
} from "./chunk-WRSGHGAT.mjs";
|
|
17
14
|
import {
|
|
18
15
|
useCustomerTableFilters
|
|
19
16
|
} from "./chunk-6OU4CHZI.mjs";
|
|
17
|
+
import {
|
|
18
|
+
useCustomerTableQuery
|
|
19
|
+
} from "./chunk-WRSGHGAT.mjs";
|
|
20
20
|
import "./chunk-GU5PJRPM.mjs";
|
|
21
21
|
import {
|
|
22
22
|
SingleColumnPage
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
} from "./chunk-YTN73JYH.mjs";
|
|
12
12
|
import "./chunk-HQKGZADC.mjs";
|
|
13
13
|
import "./chunk-EMIHDNB7.mjs";
|
|
14
|
-
import {
|
|
15
|
-
useRegionTableQuery
|
|
16
|
-
} from "./chunk-XR4GEMGR.mjs";
|
|
17
14
|
import {
|
|
18
15
|
useRegionTableFilters
|
|
19
16
|
} from "./chunk-LT4MVCA7.mjs";
|
|
17
|
+
import {
|
|
18
|
+
useRegionTableQuery
|
|
19
|
+
} from "./chunk-XR4GEMGR.mjs";
|
|
20
20
|
import "./chunk-GU5PJRPM.mjs";
|
|
21
21
|
import {
|
|
22
22
|
SingleColumnPage
|