@medusajs/dashboard 2.6.0-snapshot-20250221164338 → 3.0.0-preview-20250211091350
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-UZ54EPHR.mjs → add-campaign-promotions-YQ6JJK6I.mjs} +3 -3
- package/dist/{api-key-management-detail-4SSWQW4Y.mjs → api-key-management-detail-V6UELD25.mjs} +3 -2
- package/dist/{api-key-management-list-KS65RZEW.mjs → api-key-management-list-MKVE46ZE.mjs} +2 -1
- package/dist/app.css +0 -7
- package/dist/app.js +11038 -11102
- package/dist/app.mjs +113 -113
- package/dist/{campaign-detail-BSGQQVOO.mjs → campaign-detail-PGM2SOEA.mjs} +5 -4
- package/dist/{campaign-list-I5JP6MBH.mjs → campaign-list-6TW2SO7C.mjs} +2 -1
- package/dist/{categories-metadata-DCW4MWLW.mjs → categories-metadata-D3EM5VK2.mjs} +2 -1
- package/dist/{category-detail-Q5B3MS3Q.mjs → category-detail-Z6GWCJUW.mjs} +3 -2
- package/dist/{category-list-RCAUXT4U.mjs → category-list-6WTV4T7D.mjs} +2 -1
- package/dist/{category-products-TAKPXANA.mjs → category-products-ND7PSI4Q.mjs} +1 -1
- package/dist/{chunk-Y2ZAIM5S.mjs → chunk-4M3ZY7KA.mjs} +1 -3
- package/dist/chunk-53IEL2PE.mjs +46 -0
- package/dist/{chunk-7I5DQGWY.mjs → chunk-77TK23EH.mjs} +0 -1
- package/dist/{chunk-L5UZLG5F.mjs → chunk-HP4JZCP4.mjs} +4 -3
- package/dist/{chunk-BBQEC2BG.mjs → chunk-IQ2LC4FN.mjs} +1 -1
- package/dist/{chunk-NVPP33RF.mjs → chunk-MAWEQJDF.mjs} +1 -1
- package/dist/{chunk-DJD7KVMY.mjs → chunk-ODVOHYAS.mjs} +1 -1
- package/dist/{chunk-QXEWLJCG.mjs → chunk-QX7ANQDG.mjs} +10 -16
- package/dist/{chunk-OHX7ZPSQ.mjs → chunk-TKREK46F.mjs} +1 -1
- package/dist/{chunk-6AYVHNRZ.mjs → chunk-UT3IS7J3.mjs} +1 -16
- package/dist/{chunk-5MEZIE5U.mjs → chunk-VIJAVLIU.mjs} +32 -79
- package/dist/{chunk-3LLQ6F7F.mjs → chunk-W6N53UNG.mjs} +0 -13
- package/dist/{chunk-B3XEMIUY.mjs → chunk-ZVVQK46Y.mjs} +1 -1
- package/dist/{collection-add-products-2Z7QFHNL.mjs → collection-add-products-KGBBZFCE.mjs} +1 -1
- package/dist/{collection-detail-SUFD5QJS.mjs → collection-detail-AZZ2NT4L.mjs} +3 -2
- package/dist/{collection-list-KYQAHGDT.mjs → collection-list-2AFD2BXW.mjs} +3 -2
- package/dist/{collection-metadata-CPRJIHOK.mjs → collection-metadata-XSJPOGIP.mjs} +2 -1
- package/dist/{customer-detail-X2FBNDNC.mjs → customer-detail-MWT2NNQK.mjs} +2 -1
- package/dist/{customer-group-detail-JHFLLKLX.mjs → customer-group-detail-ULS2F7OQ.mjs} +2 -1
- package/dist/{customer-group-list-AXLT3R34.mjs → customer-group-list-LZSSOYBR.mjs} +2 -1
- package/dist/{customer-group-metadata-ZH3O4GSV.mjs → customer-group-metadata-MTAZJYBH.mjs} +2 -1
- package/dist/{customer-list-34WHJZX2.mjs → customer-list-JAKCVGFG.mjs} +2 -1
- package/dist/{customer-metadata-CFAZB6JT.mjs → customer-metadata-RO5DVFXZ.mjs} +2 -1
- package/dist/{edit-rules-7V6RS4IB.mjs → edit-rules-6XNJL6AE.mjs} +2 -2
- package/dist/{inventory-detail-B6URMXNE.mjs → inventory-detail-S56TNEU5.mjs} +2 -1
- package/dist/{inventory-list-SV4JJIXG.mjs → inventory-list-P2ZZH6EN.mjs} +2 -1
- package/dist/{inventory-metadata-3Z32WNP6.mjs → inventory-metadata-IDMV4XVV.mjs} +2 -1
- package/dist/{location-detail-B32EQ2K7.mjs → location-detail-IEGCZTAI.mjs} +7 -14
- package/dist/{location-list-CYLKB6HD.mjs → location-list-ITU5AOC7.mjs} +3 -2
- package/dist/{location-service-zone-create-DZYFXRJF.mjs → location-service-zone-create-2JT4IKFH.mjs} +7 -4
- package/dist/{location-service-zone-edit-NGJZWWTI.mjs → location-service-zone-edit-LKYVVXDR.mjs} +5 -2
- package/dist/{location-service-zone-manage-areas-FVUWYMND.mjs → location-service-zone-manage-areas-PT4R2I3K.mjs} +2 -2
- package/dist/{location-service-zone-shipping-option-create-7PGX2ROX.mjs → location-service-zone-shipping-option-create-KXZIUIZQ.mjs} +11 -41
- package/dist/{location-service-zone-shipping-option-edit-C7DKT3UB.mjs → location-service-zone-shipping-option-edit-SC4HD6LU.mjs} +6 -13
- package/dist/{login-NA32GY3B.mjs → login-TN5VDDLW.mjs} +2 -1
- package/dist/{order-create-claim-I63DJFYK.mjs → order-create-claim-FFWV762A.mjs} +2 -2
- package/dist/{order-create-edit-XM4R5G7H.mjs → order-create-edit-LS3ARJDM.mjs} +1 -1
- package/dist/{order-create-exchange-6EANY5IO.mjs → order-create-exchange-3OVNNNW3.mjs} +2 -2
- package/dist/{order-create-refund-2CADVJ27.mjs → order-create-refund-2D46DG3T.mjs} +1 -1
- package/dist/{order-create-return-JCVPCOKI.mjs → order-create-return-PJ3LFXDG.mjs} +2 -2
- package/dist/{order-detail-DLR4YI44.mjs → order-detail-YYP4INKH.mjs} +38 -26
- package/dist/{order-edit-billing-address-MXL5XNP2.mjs → order-edit-billing-address-3PYGDUWT.mjs} +1 -1
- package/dist/{order-edit-email-T6NWLCLB.mjs → order-edit-email-C5AMYZDN.mjs} +1 -1
- package/dist/{order-edit-shipping-address-VWRK7BYT.mjs → order-edit-shipping-address-T6I4D234.mjs} +1 -1
- package/dist/{order-list-CKBGBIQM.mjs → order-list-IMVPWMTQ.mjs} +2 -1
- package/dist/{order-metadata-GGAOWANV.mjs → order-metadata-DRR355QQ.mjs} +2 -1
- package/dist/{order-request-transfer-B3BQ3HMQ.mjs → order-request-transfer-U5OYJEI6.mjs} +2 -2
- package/dist/{price-list-create-EA66HJIE.mjs → price-list-create-QKTF4G3M.mjs} +1 -1
- package/dist/{price-list-detail-IAHWYG7T.mjs → price-list-detail-G5Y3VVRK.mjs} +3 -2
- package/dist/{price-list-list-FDPYDTKZ.mjs → price-list-list-XPNVK6IC.mjs} +2 -1
- package/dist/{price-list-prices-add-HM4BA5GZ.mjs → price-list-prices-add-NIFFLI7Y.mjs} +1 -1
- package/dist/{product-attributes-RLUJ3TMF.mjs → product-attributes-WLWSFTCO.mjs} +3 -2
- package/dist/{product-create-DI2OY2SB.mjs → product-create-P7U26TXX.mjs} +16 -10
- package/dist/{product-create-variant-YDVQX3WZ.mjs → product-create-variant-ZQKPGLQQ.mjs} +1 -1
- package/dist/{product-detail-5NIH3SMD.mjs → product-detail-6LXT2IIU.mjs} +4 -3
- package/dist/{product-edit-PIVZPPPB.mjs → product-edit-IDL5IGVQ.mjs} +3 -2
- package/dist/{product-export-WYNJBBNR.mjs → product-export-JGH4CULP.mjs} +1 -1
- package/dist/{product-list-QAJBAJCQ.mjs → product-list-XOFUYF5S.mjs} +3 -2
- package/dist/{product-media-PBKLEGU3.mjs → product-media-RSCMACQU.mjs} +2 -2
- package/dist/{product-metadata-FBTDH2FF.mjs → product-metadata-EW6JGOKL.mjs} +2 -1
- package/dist/{product-organization-DSLOXW5A.mjs → product-organization-6N7JBWH5.mjs} +4 -3
- package/dist/{product-prices-V2GFT2G7.mjs → product-prices-NPJIYAIK.mjs} +3 -1
- package/dist/{product-shipping-profile-NLRGC7KV.mjs → product-shipping-profile-EK6G3NTZ.mjs} +5 -12
- package/dist/{product-tag-detail-7XVM7Y5E.mjs → product-tag-detail-NDZJLI2Q.mjs} +3 -2
- package/dist/{product-tag-list-4RN3TID2.mjs → product-tag-list-A73PYQRI.mjs} +3 -2
- package/dist/{product-type-detail-QXOXDTQH.mjs → product-type-detail-AQ5SUXFF.mjs} +3 -2
- package/dist/{product-type-list-NI6QQVX4.mjs → product-type-list-TUHBNIIB.mjs} +2 -1
- package/dist/{product-variant-detail-WFDTTF4Y.mjs → product-variant-detail-3XZBP2QJ.mjs} +2 -1
- package/dist/{product-variant-edit-ZCOZ2OHG.mjs → product-variant-edit-7FZ7PQ6U.mjs} +1 -1
- package/dist/{product-variant-manage-inventory-items-2JUO2FGP.mjs → product-variant-manage-inventory-items-PRFQHHZD.mjs} +1 -1
- package/dist/{product-variant-metadata-TUYVF4C5.mjs → product-variant-metadata-PY76KWCU.mjs} +2 -1
- package/dist/{profile-detail-VCI642G7.mjs → profile-detail-EYSOSXIU.mjs} +2 -1
- package/dist/{promotion-create-UI7NBO2K.mjs → promotion-create-DUY3VRR7.mjs} +2 -2
- package/dist/{promotion-detail-LRLVERBI.mjs → promotion-detail-KUVY3KBM.mjs} +4 -3
- package/dist/{promotion-list-5FMJO53N.mjs → promotion-list-6PKG7DBB.mjs} +5 -4
- package/dist/{region-create-QE2IO46D.mjs → region-create-3UVS7VHZ.mjs} +1 -1
- package/dist/{region-detail-D7XDE57X.mjs → region-detail-SGGN2NPK.mjs} +2 -1
- package/dist/{region-edit-UTIINDKG.mjs → region-edit-GPMEIHUM.mjs} +1 -1
- package/dist/{region-list-I2G6N2SP.mjs → region-list-ETVUX5R3.mjs} +2 -1
- package/dist/{region-metadata-YFRRLV5I.mjs → region-metadata-J4QDEISD.mjs} +2 -1
- package/dist/{reservation-create-CENQKDIW.mjs → reservation-create-O3ALBX5F.mjs} +1 -1
- package/dist/{reservation-detail-4JHMO7WY.mjs → reservation-detail-X46PRDBS.mjs} +2 -1
- package/dist/{reservation-list-5D5YHF2E.mjs → reservation-list-HF5TGB2X.mjs} +2 -1
- package/dist/{reservation-metadata-XIHGYPGA.mjs → reservation-metadata-GBTOI33G.mjs} +2 -1
- package/dist/{reset-password-V7XNNW3U.mjs → reset-password-CXIAZ6KT.mjs} +1 -1
- package/dist/{return-reason-list-UHUURCNJ.mjs → return-reason-list-R2B2M5F3.mjs} +3 -2
- package/dist/{sales-channel-add-products-WO6ZGXV5.mjs → sales-channel-add-products-XX6XXL67.mjs} +1 -1
- package/dist/{sales-channel-detail-PAOUTJJB.mjs → sales-channel-detail-A5LWMTIW.mjs} +3 -2
- package/dist/{sales-channel-list-VH2MIY3C.mjs → sales-channel-list-WIDZSTDW.mjs} +2 -1
- package/dist/{sales-channel-metadata-B2OYQIVZ.mjs → sales-channel-metadata-EU2OLGZU.mjs} +2 -1
- package/dist/{shipping-profile-detail-7E5Y3TE7.mjs → shipping-profile-detail-E2ZVCQB5.mjs} +2 -1
- package/dist/{shipping-profile-metadata-5XEC3GKU.mjs → shipping-profile-metadata-B3XD5644.mjs} +2 -1
- package/dist/{shipping-profiles-list-Q5KNKB3G.mjs → shipping-profiles-list-QF6YVBB6.mjs} +2 -1
- package/dist/{store-detail-4MCDPZIL.mjs → store-detail-RK42OQIJ.mjs} +2 -1
- package/dist/{store-edit-FFZQFGNN.mjs → store-edit-VP2ZK6DB.mjs} +1 -1
- package/dist/{store-metadata-PMRHY3QN.mjs → store-metadata-Z2PO4TKS.mjs} +2 -1
- package/dist/{tax-region-detail-BQJHDRQT.mjs → tax-region-detail-MUS2Q44R.mjs} +2 -1
- package/dist/{tax-region-list-AYS4JBDG.mjs → tax-region-list-OAH2FFY2.mjs} +2 -1
- package/dist/{tax-region-province-detail-YLFL2QHN.mjs → tax-region-province-detail-WENPM2PD.mjs} +2 -1
- package/dist/{tax-region-tax-override-create-TCWZQYJ4.mjs → tax-region-tax-override-create-VANMBRAP.mjs} +2 -2
- package/dist/{tax-region-tax-override-edit-U6UWIVZX.mjs → tax-region-tax-override-edit-IY5SXK2S.mjs} +2 -2
- package/dist/{user-detail-MLWL3L57.mjs → user-detail-I53MPAAS.mjs} +2 -1
- package/dist/{user-list-6YBGEIUH.mjs → user-list-6DWTXQUP.mjs} +2 -1
- package/dist/{user-metadata-AKNNB4TJ.mjs → user-metadata-ISZ5VACI.mjs} +2 -1
- package/dist/{workflow-execution-detail-FDHQQNLK.mjs → workflow-execution-detail-ERZLGDON.mjs} +2 -1
- package/dist/{workflow-execution-list-GM7JUXXT.mjs → workflow-execution-list-VEHTWIZD.mjs} +2 -1
- package/package.json +11 -11
- package/src/components/common/inline-tip/index.ts +1 -0
- package/src/components/common/inline-tip/inline-tip.tsx +60 -0
- package/src/components/forms/metadata-form/metadata-form.tsx +8 -19
- package/src/components/inputs/combobox/combobox.tsx +0 -14
- package/src/extensions/forms/form-extension-zone/form-extension-zone.tsx +3 -5
- package/src/extensions/routes/utils.ts +32 -158
- package/src/extensions/types.ts +0 -2
- package/src/hooks/table/query/use-product-table-query.tsx +0 -4
- package/src/i18n/translations/$schema.json +2 -55
- package/src/i18n/translations/en.json +1 -16
- package/src/providers/router-provider/route-extensions.tsx +0 -1
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/api-key-general-section.tsx +1 -3
- package/src/routes/locations/location-detail/components/location-general-section/location-general-section.tsx +3 -13
- package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/create-service-zone-form.tsx +3 -2
- package/src/routes/locations/location-service-zone-edit/components/edit-region-form/edit-service-zone-form.tsx +3 -4
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-option-details-form.tsx +46 -54
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-form.tsx +2 -8
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-prices-form.tsx +2 -27
- package/src/routes/locations/location-service-zone-shipping-option-create/location-service-zone-shipping-option-create.tsx +3 -14
- package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/edit-shipping-option-form.tsx +42 -50
- package/src/routes/locations/location-service-zone-shipping-option-edit/location-service-zone-shipping-option-edit.tsx +1 -15
- package/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx +4 -23
- package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +28 -21
- package/src/routes/orders/order-detail/constants.ts +0 -1
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +2 -2
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +9 -7
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx +1 -3
- package/src/routes/products/product-create/constants.ts +4 -4
- package/src/routes/products/product-create/utils.ts +1 -1
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +1 -2
- package/src/routes/products/product-prices/product-prices.tsx +3 -1
- package/src/routes/products/product-shipping-profile/components/product-organization-form/product-shipping-profile-form.tsx +2 -13
- package/dist/{chunk-EGUG76J6.mjs → chunk-N6PBCMOV.mjs} +3 -3
@@ -195,14 +195,12 @@ type ServiceZoneOptionsProps = {
|
|
195
195
|
zone: HttpTypes.AdminServiceZone
|
196
196
|
locationId: string
|
197
197
|
fulfillmentSetId: string
|
198
|
-
type: FulfillmentSetType
|
199
198
|
}
|
200
199
|
|
201
200
|
function ServiceZoneOptions({
|
202
201
|
zone,
|
203
202
|
locationId,
|
204
203
|
fulfillmentSetId,
|
205
|
-
type,
|
206
204
|
}: ServiceZoneOptionsProps) {
|
207
205
|
const { t } = useTranslation()
|
208
206
|
|
@@ -218,7 +216,7 @@ function ServiceZoneOptions({
|
|
218
216
|
<div className="flex flex-col gap-y-4 px-6 py-4">
|
219
217
|
<div className="item-center flex justify-between">
|
220
218
|
<span className="text-ui-fg-subtle txt-small self-center font-medium">
|
221
|
-
{t(
|
219
|
+
{t("stockLocations.shippingOptions.create.shipping.label")}
|
222
220
|
</span>
|
223
221
|
<LinkButton
|
224
222
|
to={`/settings/locations/${locationId}/fulfillment-set/${fulfillmentSetId}/service-zone/${zone.id}/shipping-option/create`}
|
@@ -276,15 +274,9 @@ type ServiceZoneProps = {
|
|
276
274
|
zone: HttpTypes.AdminServiceZone
|
277
275
|
locationId: string
|
278
276
|
fulfillmentSetId: string
|
279
|
-
type: FulfillmentSetType
|
280
277
|
}
|
281
278
|
|
282
|
-
function ServiceZone({
|
283
|
-
zone,
|
284
|
-
locationId,
|
285
|
-
fulfillmentSetId,
|
286
|
-
type,
|
287
|
-
}: ServiceZoneProps) {
|
279
|
+
function ServiceZone({ zone, locationId, fulfillmentSetId }: ServiceZoneProps) {
|
288
280
|
const { t } = useTranslation()
|
289
281
|
const prompt = usePrompt()
|
290
282
|
const [open, setOpen] = useState(true)
|
@@ -376,7 +368,7 @@ function ServiceZone({
|
|
376
368
|
/>
|
377
369
|
<span>·</span>
|
378
370
|
<Text className="text-ui-fg-subtle txt-small">
|
379
|
-
{t(
|
371
|
+
{t("stockLocations.shippingOptions.fields.count.shipping", {
|
380
372
|
count: shippingOptionsCount,
|
381
373
|
})}
|
382
374
|
</Text>
|
@@ -435,7 +427,6 @@ function ServiceZone({
|
|
435
427
|
<ServiceZoneOptions
|
436
428
|
fulfillmentSetId={fulfillmentSetId}
|
437
429
|
locationId={locationId}
|
438
|
-
type={type}
|
439
430
|
zone={zone}
|
440
431
|
/>
|
441
432
|
)}
|
@@ -579,7 +570,6 @@ function FulfillmentSet(props: FulfillmentSetProps) {
|
|
579
570
|
{fulfillmentSet?.service_zones.map((zone) => (
|
580
571
|
<ServiceZone
|
581
572
|
zone={zone}
|
582
|
-
type={type}
|
583
573
|
key={zone.id}
|
584
574
|
locationId={locationId}
|
585
575
|
fulfillmentSetId={fulfillmentSet.id}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { zodResolver } from "@hookform/resolvers/zod"
|
2
2
|
import { HttpTypes } from "@medusajs/types"
|
3
|
-
import { Button, Heading,
|
3
|
+
import { Button, Heading, Input, toast } from "@medusajs/ui"
|
4
4
|
import { useForm } from "react-hook-form"
|
5
5
|
import { useTranslation } from "react-i18next"
|
6
6
|
import { z } from "zod"
|
7
7
|
|
8
8
|
import { Form } from "../../../../../components/common/form"
|
9
|
+
import { InlineTip } from "../../../../../components/common/inline-tip"
|
9
10
|
import {
|
10
11
|
RouteFocusModal,
|
11
12
|
StackedFocusModal,
|
@@ -117,7 +118,7 @@ export function CreateServiceZoneForm({
|
|
117
118
|
/>
|
118
119
|
</div>
|
119
120
|
|
120
|
-
<InlineTip
|
121
|
+
<InlineTip>
|
121
122
|
{t("stockLocations.serviceZones.fields.tip")}
|
122
123
|
</InlineTip>
|
123
124
|
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { HttpTypes } from "@medusajs/types"
|
2
|
-
import { Button,
|
2
|
+
import { Button, Input, toast } from "@medusajs/ui"
|
3
3
|
import { useForm } from "react-hook-form"
|
4
4
|
import { useTranslation } from "react-i18next"
|
5
5
|
import * as zod from "zod"
|
6
6
|
|
7
7
|
import { Form } from "../../../../../components/common/form"
|
8
|
+
import { InlineTip } from "../../../../../components/common/inline-tip"
|
8
9
|
import { RouteDrawer, useRouteModal } from "../../../../../components/modals"
|
9
10
|
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
10
11
|
import { useUpdateFulfillmentSetServiceZone } from "../../../../../hooks/api/fulfillment-sets"
|
@@ -82,9 +83,7 @@ export const EditServiceZoneForm = ({
|
|
82
83
|
}}
|
83
84
|
/>
|
84
85
|
</div>
|
85
|
-
<InlineTip
|
86
|
-
{t("stockLocations.serviceZones.fields.tip")}
|
87
|
-
</InlineTip>
|
86
|
+
<InlineTip>{t("stockLocations.serviceZones.fields.tip")}</InlineTip>
|
88
87
|
</div>
|
89
88
|
</RouteDrawer.Body>
|
90
89
|
<RouteDrawer.Footer>
|
@@ -10,10 +10,7 @@ import { Combobox } from "../../../../../components/inputs/combobox"
|
|
10
10
|
import { useComboboxData } from "../../../../../hooks/use-combobox-data"
|
11
11
|
import { sdk } from "../../../../../lib/client"
|
12
12
|
import { formatProvider } from "../../../../../lib/format-provider"
|
13
|
-
import {
|
14
|
-
FulfillmentSetType,
|
15
|
-
ShippingOptionPriceType,
|
16
|
-
} from "../../../common/constants"
|
13
|
+
import { ShippingOptionPriceType } from "../../../common/constants"
|
17
14
|
import { CreateShippingOptionSchema } from "./schema"
|
18
15
|
|
19
16
|
type CreateShippingOptionDetailsFormProps = {
|
@@ -23,7 +20,6 @@ type CreateShippingOptionDetailsFormProps = {
|
|
23
20
|
locationId: string
|
24
21
|
fulfillmentProviderOptions: HttpTypes.AdminFulfillmentProviderOption[]
|
25
22
|
selectedProviderId?: string
|
26
|
-
type: FulfillmentSetType
|
27
23
|
}
|
28
24
|
|
29
25
|
export const CreateShippingOptionDetailsForm = ({
|
@@ -33,12 +29,9 @@ export const CreateShippingOptionDetailsForm = ({
|
|
33
29
|
locationId,
|
34
30
|
fulfillmentProviderOptions,
|
35
31
|
selectedProviderId,
|
36
|
-
type,
|
37
32
|
}: CreateShippingOptionDetailsFormProps) => {
|
38
33
|
const { t } = useTranslation()
|
39
34
|
|
40
|
-
const isPickup = type === FulfillmentSetType.Pickup
|
41
|
-
|
42
35
|
const shippingProfiles = useComboboxData({
|
43
36
|
queryFn: (params) => sdk.admin.shippingProfile.list(params),
|
44
37
|
queryKey: ["shipping_profiles"],
|
@@ -70,7 +63,7 @@ export const CreateShippingOptionDetailsForm = ({
|
|
70
63
|
<Heading>
|
71
64
|
{t(
|
72
65
|
`stockLocations.shippingOptions.create.${
|
73
|
-
|
66
|
+
isReturn ? "returns" : "shipping"
|
74
67
|
}.header`,
|
75
68
|
{
|
76
69
|
zone: zone.name,
|
@@ -80,56 +73,54 @@ export const CreateShippingOptionDetailsForm = ({
|
|
80
73
|
<Text size="small" className="text-ui-fg-subtle">
|
81
74
|
{t(
|
82
75
|
`stockLocations.shippingOptions.create.${
|
83
|
-
isReturn ? "returns" :
|
76
|
+
isReturn ? "returns" : "shipping"
|
84
77
|
}.hint`
|
85
78
|
)}
|
86
79
|
</Text>
|
87
80
|
</div>
|
88
81
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<Form.
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
label
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
label
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
/>
|
132
|
-
)}
|
82
|
+
<Form.Field
|
83
|
+
control={form.control}
|
84
|
+
name="price_type"
|
85
|
+
render={({ field }) => {
|
86
|
+
return (
|
87
|
+
<Form.Item>
|
88
|
+
<Form.Label>
|
89
|
+
{t("stockLocations.shippingOptions.fields.priceType.label")}
|
90
|
+
</Form.Label>
|
91
|
+
<Form.Control>
|
92
|
+
<RadioGroup
|
93
|
+
className="grid grid-cols-1 gap-4 md:grid-cols-2"
|
94
|
+
{...field}
|
95
|
+
onValueChange={field.onChange}
|
96
|
+
>
|
97
|
+
<RadioGroup.ChoiceBox
|
98
|
+
className="flex-1"
|
99
|
+
value={ShippingOptionPriceType.FlatRate}
|
100
|
+
label={t(
|
101
|
+
"stockLocations.shippingOptions.fields.priceType.options.fixed.label"
|
102
|
+
)}
|
103
|
+
description={t(
|
104
|
+
"stockLocations.shippingOptions.fields.priceType.options.fixed.hint"
|
105
|
+
)}
|
106
|
+
/>
|
107
|
+
<RadioGroup.ChoiceBox
|
108
|
+
className="flex-1"
|
109
|
+
value={ShippingOptionPriceType.Calculated}
|
110
|
+
label={t(
|
111
|
+
"stockLocations.shippingOptions.fields.priceType.options.calculated.label"
|
112
|
+
)}
|
113
|
+
description={t(
|
114
|
+
"stockLocations.shippingOptions.fields.priceType.options.calculated.hint"
|
115
|
+
)}
|
116
|
+
/>
|
117
|
+
</RadioGroup>
|
118
|
+
</Form.Control>
|
119
|
+
<Form.ErrorMessage />
|
120
|
+
</Form.Item>
|
121
|
+
)
|
122
|
+
}}
|
123
|
+
/>
|
133
124
|
|
134
125
|
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
|
135
126
|
<Form.Field
|
@@ -248,6 +239,7 @@ export const CreateShippingOptionDetailsForm = ({
|
|
248
239
|
</div>
|
249
240
|
|
250
241
|
<Divider />
|
242
|
+
|
251
243
|
<SwitchBox
|
252
244
|
control={form.control}
|
253
245
|
name="enabled_in_store"
|
@@ -12,10 +12,7 @@ import {
|
|
12
12
|
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
13
13
|
import { useCreateShippingOptions } from "../../../../../hooks/api/shipping-options"
|
14
14
|
import { castNumber } from "../../../../../lib/cast-number"
|
15
|
-
import {
|
16
|
-
FulfillmentSetType,
|
17
|
-
ShippingOptionPriceType,
|
18
|
-
} from "../../../common/constants"
|
15
|
+
import { ShippingOptionPriceType } from "../../../common/constants"
|
19
16
|
import { buildShippingOptionPriceRules } from "../../../common/utils/price-rule-helpers"
|
20
17
|
import { CreateShippingOptionDetailsForm } from "./create-shipping-option-details-form"
|
21
18
|
import { CreateShippingOptionsPricesForm } from "./create-shipping-options-prices-form"
|
@@ -34,14 +31,12 @@ type CreateShippingOptionFormProps = {
|
|
34
31
|
zone: HttpTypes.AdminServiceZone
|
35
32
|
locationId: string
|
36
33
|
isReturn?: boolean
|
37
|
-
type: FulfillmentSetType
|
38
34
|
}
|
39
35
|
|
40
36
|
export function CreateShippingOptionsForm({
|
41
37
|
zone,
|
42
38
|
isReturn,
|
43
39
|
locationId,
|
44
|
-
type,
|
45
40
|
}: CreateShippingOptionFormProps) {
|
46
41
|
const [activeTab, setActiveTab] = useState<Tab>(Tab.DETAILS)
|
47
42
|
const [validDetails, setValidDetails] = useState(false)
|
@@ -314,14 +309,13 @@ export function CreateShippingOptionsForm({
|
|
314
309
|
form={form}
|
315
310
|
zone={zone}
|
316
311
|
isReturn={isReturn}
|
317
|
-
type={type}
|
318
312
|
locationId={locationId}
|
319
313
|
fulfillmentProviderOptions={fulfillmentProviderOptions || []}
|
320
314
|
selectedProviderId={selectedProviderId}
|
321
315
|
/>
|
322
316
|
</ProgressTabs.Content>
|
323
317
|
<ProgressTabs.Content value={Tab.PRICING} className="size-full">
|
324
|
-
<CreateShippingOptionsPricesForm form={form}
|
318
|
+
<CreateShippingOptionsPricesForm form={form} />
|
325
319
|
</ProgressTabs.Content>
|
326
320
|
</RouteFocusModal.Body>
|
327
321
|
<RouteFocusModal.Footer>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { useMemo, useState } from "react"
|
2
2
|
import { UseFormReturn, useWatch } from "react-hook-form"
|
3
3
|
|
4
4
|
import { DataGrid } from "../../../../../components/data-grid"
|
@@ -12,24 +12,18 @@ import { useRegions } from "../../../../../hooks/api/regions"
|
|
12
12
|
import { useStore } from "../../../../../hooks/api/store"
|
13
13
|
import { ConditionalPriceForm } from "../../../common/components/conditional-price-form"
|
14
14
|
import { ShippingOptionPriceProvider } from "../../../common/components/shipping-option-price-provider"
|
15
|
-
import {
|
16
|
-
FulfillmentSetType,
|
17
|
-
CONDITIONAL_PRICES_STACKED_MODAL_ID,
|
18
|
-
} from "../../../common/constants"
|
15
|
+
import { CONDITIONAL_PRICES_STACKED_MODAL_ID } from "../../../common/constants"
|
19
16
|
import { useShippingOptionPriceColumns } from "../../../common/hooks/use-shipping-option-price-columns"
|
20
17
|
import { ConditionalPriceInfo } from "../../../common/types"
|
21
18
|
import { CreateShippingOptionSchema } from "./schema"
|
22
19
|
|
23
20
|
type PricingPricesFormProps = {
|
24
21
|
form: UseFormReturn<CreateShippingOptionSchema>
|
25
|
-
type: FulfillmentSetType
|
26
22
|
}
|
27
23
|
|
28
24
|
export const CreateShippingOptionsPricesForm = ({
|
29
25
|
form,
|
30
|
-
type,
|
31
26
|
}: PricingPricesFormProps) => {
|
32
|
-
const isPickup = type === FulfillmentSetType.Pickup
|
33
27
|
const { getIsOpen, setIsOpen } = useStackedModal()
|
34
28
|
const [selectedPrice, setSelectedPrice] =
|
35
29
|
useState<ConditionalPriceInfo | null>(null)
|
@@ -86,25 +80,6 @@ export const CreateShippingOptionsPricesForm = ({
|
|
86
80
|
[currencies, regions]
|
87
81
|
)
|
88
82
|
|
89
|
-
/**
|
90
|
-
* Prefill prices with 0 if createing a pickup (shipping) option
|
91
|
-
*/
|
92
|
-
useEffect(() => {
|
93
|
-
if (!isLoading && isPickup) {
|
94
|
-
if (currencies.length > 0) {
|
95
|
-
currencies.forEach((currency) => {
|
96
|
-
form.setValue(`currency_prices.${currency}`, "0")
|
97
|
-
})
|
98
|
-
}
|
99
|
-
|
100
|
-
if (regions.length > 0) {
|
101
|
-
regions.forEach((region) => {
|
102
|
-
form.setValue(`region_prices.${region.id}`, "0")
|
103
|
-
})
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}, [isLoading, isPickup])
|
107
|
-
|
108
83
|
if (isStoreError) {
|
109
84
|
throw storeError
|
110
85
|
}
|
@@ -4,7 +4,6 @@ import { RouteFocusModal } from "../../../components/modals"
|
|
4
4
|
import { useStockLocation } from "../../../hooks/api/stock-locations"
|
5
5
|
import { CreateShippingOptionsForm } from "./components/create-shipping-options-form"
|
6
6
|
import { LOC_CREATE_SHIPPING_OPTION_FIELDS } from "./constants"
|
7
|
-
import { FulfillmentSetType } from "../common/constants"
|
8
7
|
|
9
8
|
export function LocationServiceZoneShippingOptionCreate() {
|
10
9
|
const { location_id, fset_id, zone_id } = useParams()
|
@@ -16,18 +15,9 @@ export function LocationServiceZoneShippingOptionCreate() {
|
|
16
15
|
fields: LOC_CREATE_SHIPPING_OPTION_FIELDS,
|
17
16
|
})
|
18
17
|
|
19
|
-
const
|
20
|
-
(f) => f.id === fset_id
|
21
|
-
|
22
|
-
|
23
|
-
if (!isPending && !isFetching && !fulfillmentSet) {
|
24
|
-
throw json(
|
25
|
-
{ message: `Fulfillment set with ID ${fset_id} was not found` },
|
26
|
-
404
|
27
|
-
)
|
28
|
-
}
|
29
|
-
|
30
|
-
const zone = fulfillmentSet?.service_zones?.find((z) => z.id === zone_id)
|
18
|
+
const zone = stock_location?.fulfillment_sets
|
19
|
+
?.find((f) => f.id === fset_id)
|
20
|
+
?.service_zones?.find((z) => z.id === zone_id)
|
31
21
|
|
32
22
|
if (!isPending && !isFetching && !zone) {
|
33
23
|
throw json(
|
@@ -47,7 +37,6 @@ export function LocationServiceZoneShippingOptionCreate() {
|
|
47
37
|
zone={zone}
|
48
38
|
isReturn={isReturn}
|
49
39
|
locationId={location_id!}
|
50
|
-
type={fulfillmentSet!.type as FulfillmentSetType}
|
51
40
|
/>
|
52
41
|
)}
|
53
42
|
</RouteFocusModal>
|
@@ -15,15 +15,11 @@ import { useComboboxData } from "../../../../../hooks/use-combobox-data"
|
|
15
15
|
import { sdk } from "../../../../../lib/client"
|
16
16
|
import { pick } from "../../../../../lib/common"
|
17
17
|
import { isOptionEnabledInStore } from "../../../../../lib/shipping-options"
|
18
|
-
import {
|
19
|
-
FulfillmentSetType,
|
20
|
-
ShippingOptionPriceType,
|
21
|
-
} from "../../../common/constants"
|
18
|
+
import { ShippingOptionPriceType } from "../../../common/constants"
|
22
19
|
|
23
20
|
type EditShippingOptionFormProps = {
|
24
21
|
locationId: string
|
25
22
|
shippingOption: HttpTypes.AdminShippingOption
|
26
|
-
type: FulfillmentSetType
|
27
23
|
}
|
28
24
|
|
29
25
|
const EditShippingOptionSchema = zod.object({
|
@@ -36,13 +32,10 @@ const EditShippingOptionSchema = zod.object({
|
|
36
32
|
export const EditShippingOptionForm = ({
|
37
33
|
locationId,
|
38
34
|
shippingOption,
|
39
|
-
type,
|
40
35
|
}: EditShippingOptionFormProps) => {
|
41
36
|
const { t } = useTranslation()
|
42
37
|
const { handleSuccess } = useRouteModal()
|
43
38
|
|
44
|
-
const isPickup = type === FulfillmentSetType.Pickup
|
45
|
-
|
46
39
|
const shippingProfiles = useComboboxData({
|
47
40
|
queryFn: (params) => sdk.admin.shippingProfile.list(params),
|
48
41
|
queryKey: ["shipping_profiles"],
|
@@ -115,48 +108,46 @@ export const EditShippingOptionForm = ({
|
|
115
108
|
<RouteDrawer.Body>
|
116
109
|
<div className="flex flex-col gap-y-8">
|
117
110
|
<div className="flex flex-col gap-y-8">
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
<Form.
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
<
|
131
|
-
<RadioGroup
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
label
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
label
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
/>
|
159
|
-
)}
|
111
|
+
<Form.Field
|
112
|
+
control={form.control}
|
113
|
+
name="price_type"
|
114
|
+
render={({ field }) => {
|
115
|
+
return (
|
116
|
+
<Form.Item>
|
117
|
+
<Form.Label>
|
118
|
+
{t(
|
119
|
+
"stockLocations.shippingOptions.fields.priceType.label"
|
120
|
+
)}
|
121
|
+
</Form.Label>
|
122
|
+
<Form.Control>
|
123
|
+
<RadioGroup {...field} onValueChange={field.onChange}>
|
124
|
+
<RadioGroup.ChoiceBox
|
125
|
+
className="flex-1"
|
126
|
+
value={ShippingOptionPriceType.FlatRate}
|
127
|
+
label={t(
|
128
|
+
"stockLocations.shippingOptions.fields.priceType.options.fixed.label"
|
129
|
+
)}
|
130
|
+
description={t(
|
131
|
+
"stockLocations.shippingOptions.fields.priceType.options.fixed.hint"
|
132
|
+
)}
|
133
|
+
/>
|
134
|
+
<RadioGroup.ChoiceBox
|
135
|
+
className="flex-1"
|
136
|
+
value={ShippingOptionPriceType.Calculated}
|
137
|
+
label={t(
|
138
|
+
"stockLocations.shippingOptions.fields.priceType.options.calculated.label"
|
139
|
+
)}
|
140
|
+
description={t(
|
141
|
+
"stockLocations.shippingOptions.fields.priceType.options.calculated.hint"
|
142
|
+
)}
|
143
|
+
/>
|
144
|
+
</RadioGroup>
|
145
|
+
</Form.Control>
|
146
|
+
<Form.ErrorMessage />
|
147
|
+
</Form.Item>
|
148
|
+
)
|
149
|
+
}}
|
150
|
+
/>
|
160
151
|
|
161
152
|
<div className="grid gap-y-4">
|
162
153
|
<Form.Field
|
@@ -203,6 +194,7 @@ export const EditShippingOptionForm = ({
|
|
203
194
|
</div>
|
204
195
|
|
205
196
|
<Divider />
|
197
|
+
|
206
198
|
<SwitchBox
|
207
199
|
control={form.control}
|
208
200
|
name="enabled_in_store"
|
@@ -5,7 +5,6 @@ import { json, useParams } from "react-router-dom"
|
|
5
5
|
import { RouteDrawer } from "../../../components/modals"
|
6
6
|
import { useShippingOptions } from "../../../hooks/api/shipping-options"
|
7
7
|
import { EditShippingOptionForm } from "./components/edit-region-form"
|
8
|
-
import { FulfillmentSetType } from "../common/constants"
|
9
8
|
|
10
9
|
export const LocationServiceZoneShippingOptionEdit = () => {
|
11
10
|
const { t } = useTranslation()
|
@@ -15,7 +14,6 @@ export const LocationServiceZoneShippingOptionEdit = () => {
|
|
15
14
|
const { shipping_options, isPending, isFetching, isError, error } =
|
16
15
|
useShippingOptions({
|
17
16
|
id: so_id,
|
18
|
-
fields: "+service_zone.fulfillment_set.type",
|
19
17
|
})
|
20
18
|
|
21
19
|
const shippingOption = shipping_options?.find((so) => so.id === so_id)
|
@@ -31,27 +29,15 @@ export const LocationServiceZoneShippingOptionEdit = () => {
|
|
31
29
|
throw error
|
32
30
|
}
|
33
31
|
|
34
|
-
const isPickup =
|
35
|
-
shippingOption?.service_zone.fulfillment_set.type ===
|
36
|
-
FulfillmentSetType.Pickup
|
37
|
-
|
38
32
|
return (
|
39
33
|
<RouteDrawer>
|
40
34
|
<RouteDrawer.Header>
|
41
|
-
<Heading>
|
42
|
-
{t(
|
43
|
-
`stockLocations.${isPickup ? "pickupOptions" : "shippingOptions"}.edit.header`
|
44
|
-
)}
|
45
|
-
</Heading>
|
35
|
+
<Heading>{t("stockLocations.shippingOptions.edit.header")}</Heading>
|
46
36
|
</RouteDrawer.Header>
|
47
37
|
{shippingOption && (
|
48
38
|
<EditShippingOptionForm
|
49
39
|
shippingOption={shippingOption}
|
50
40
|
locationId={location_id!}
|
51
|
-
type={
|
52
|
-
shippingOption.service_zone.fulfillment_set
|
53
|
-
.type as FulfillmentSetType
|
54
|
-
}
|
55
41
|
/>
|
56
42
|
)}
|
57
43
|
</RouteDrawer>
|
@@ -30,7 +30,6 @@ import {
|
|
30
30
|
import { useStockLocation } from "../../../../../hooks/api/stock-locations"
|
31
31
|
import { formatProvider } from "../../../../../lib/format-provider"
|
32
32
|
import { getLocaleAmount } from "../../../../../lib/money-amount-helpers"
|
33
|
-
import { FulfillmentSetType } from "../../../../locations/common/constants"
|
34
33
|
|
35
34
|
type OrderFulfillmentSectionProps = {
|
36
35
|
order: AdminOrder
|
@@ -214,10 +213,6 @@ const Fulfillment = ({
|
|
214
213
|
|
215
214
|
const showLocation = !!fulfillment.location_id
|
216
215
|
|
217
|
-
const isPickUpFulfillment =
|
218
|
-
fulfillment.shipping_option?.service_zone.fulfillment_set.type ===
|
219
|
-
FulfillmentSetType.Pickup
|
220
|
-
|
221
216
|
const { stock_location, isError, error } = useStockLocation(
|
222
217
|
fulfillment.location_id!,
|
223
218
|
undefined,
|
@@ -227,9 +222,7 @@ const Fulfillment = ({
|
|
227
222
|
)
|
228
223
|
|
229
224
|
let statusText = fulfillment.requires_shipping
|
230
|
-
?
|
231
|
-
? "Awaiting pickup"
|
232
|
-
: "Awaiting shipping"
|
225
|
+
? "Awaiting shipping"
|
233
226
|
: "Awaiting delivery"
|
234
227
|
let statusColor: "blue" | "green" | "red" = "blue"
|
235
228
|
let statusTimestamp = fulfillment.created_at
|
@@ -258,9 +251,7 @@ const Fulfillment = ({
|
|
258
251
|
!fulfillment.canceled_at &&
|
259
252
|
!fulfillment.shipped_at &&
|
260
253
|
!fulfillment.delivered_at &&
|
261
|
-
fulfillment.requires_shipping
|
262
|
-
!isPickUpFulfillment
|
263
|
-
|
254
|
+
fulfillment.requires_shipping
|
264
255
|
const showDeliveryButton =
|
265
256
|
!fulfillment.canceled_at && !fulfillment.delivered_at
|
266
257
|
|
@@ -276,13 +267,7 @@ const Fulfillment = ({
|
|
276
267
|
if (res) {
|
277
268
|
await markAsDelivered(undefined, {
|
278
269
|
onSuccess: () => {
|
279
|
-
toast.success(
|
280
|
-
t(
|
281
|
-
isPickUpFulfillment
|
282
|
-
? "orders.fulfillment.toast.fulfillmentPickedUp"
|
283
|
-
: "orders.fulfillment.toast.fulfillmentDelivered"
|
284
|
-
)
|
285
|
-
)
|
270
|
+
toast.success(t("orders.fulfillment.toast.fulfillmentDelivered"))
|
286
271
|
},
|
287
272
|
onError: (e) => {
|
288
273
|
toast.error(e.message)
|
@@ -446,11 +431,7 @@ const Fulfillment = ({
|
|
446
431
|
<div className="bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4">
|
447
432
|
{showDeliveryButton && (
|
448
433
|
<Button onClick={handleMarkAsDelivered} variant="secondary">
|
449
|
-
{t(
|
450
|
-
isPickUpFulfillment
|
451
|
-
? "orders.fulfillment.markAsPickedUp"
|
452
|
-
: "orders.fulfillment.markAsDelivered"
|
453
|
-
)}
|
434
|
+
{t("orders.fulfillment.markAsDelivered")}
|
454
435
|
</Button>
|
455
436
|
)}
|
456
437
|
|