@medusajs/dashboard 2.6.0-snapshot-20250221153919 → 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
package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ReactNode, useMemo, useState } from "react"
|
2
2
|
import { useTranslation } from "react-i18next"
|
3
|
-
import {
|
3
|
+
import { useNavigate } from "react-router-dom"
|
4
4
|
|
5
5
|
import {
|
6
6
|
ArrowDownRightMini,
|
@@ -18,9 +18,9 @@ import {
|
|
18
18
|
AdminOrder,
|
19
19
|
AdminOrderLineItem,
|
20
20
|
AdminOrderPreview,
|
21
|
-
AdminPaymentCollection,
|
22
21
|
AdminRegion,
|
23
22
|
AdminReturn,
|
23
|
+
AdminPaymentCollection,
|
24
24
|
} from "@medusajs/types"
|
25
25
|
import {
|
26
26
|
Badge,
|
@@ -188,12 +188,16 @@ export const OrderSummarySection = ({ order }: OrderSummarySectionProps) => {
|
|
188
188
|
<div className="bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4">
|
189
189
|
{showReturns &&
|
190
190
|
(receivableReturns.length === 1 ? (
|
191
|
-
<Button
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
191
|
+
<Button
|
192
|
+
onClick={() =>
|
193
|
+
navigate(
|
194
|
+
`/orders/${order.id}/returns/${receivableReturns[0].id}/receive`
|
195
|
+
)
|
196
|
+
}
|
197
|
+
variant="secondary"
|
198
|
+
size="small"
|
199
|
+
>
|
200
|
+
{t("orders.returns.receive.action")}
|
197
201
|
</Button>
|
198
202
|
) : (
|
199
203
|
<ActionMenu
|
@@ -232,10 +236,11 @@ export const OrderSummarySection = ({ order }: OrderSummarySectionProps) => {
|
|
232
236
|
))}
|
233
237
|
|
234
238
|
{showAllocateButton && (
|
235
|
-
<Button
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
+
<Button
|
240
|
+
onClick={() => navigate(`./allocate-items`)}
|
241
|
+
variant="secondary"
|
242
|
+
>
|
243
|
+
{t("orders.allocateItems.action")}
|
239
244
|
</Button>
|
240
245
|
)}
|
241
246
|
|
@@ -257,15 +262,17 @@ export const OrderSummarySection = ({ order }: OrderSummarySectionProps) => {
|
|
257
262
|
)}
|
258
263
|
|
259
264
|
{showRefund && (
|
260
|
-
<Button
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
265
|
+
<Button
|
266
|
+
size="small"
|
267
|
+
variant="secondary"
|
268
|
+
onClick={() => navigate(`/orders/${order.id}/refund`)}
|
269
|
+
>
|
270
|
+
{t("orders.payment.refundAmount", {
|
271
|
+
amount: getStylizedAmount(
|
272
|
+
pendingDifference * -1,
|
273
|
+
order?.currency_code
|
274
|
+
),
|
275
|
+
})}
|
269
276
|
</Button>
|
270
277
|
)}
|
271
278
|
</div>
|
@@ -6,7 +6,6 @@ import {
|
|
6
6
|
Heading,
|
7
7
|
Hint,
|
8
8
|
IconButton,
|
9
|
-
InlineTip,
|
10
9
|
Input,
|
11
10
|
Label,
|
12
11
|
Text,
|
@@ -22,6 +21,7 @@ import {
|
|
22
21
|
import { useTranslation } from "react-i18next"
|
23
22
|
|
24
23
|
import { Form } from "../../../../../../../components/common/form"
|
24
|
+
import { InlineTip } from "../../../../../../../components/common/inline-tip"
|
25
25
|
import { SortableList } from "../../../../../../../components/common/sortable-list"
|
26
26
|
import { SwitchBox } from "../../../../../../../components/common/switch-box"
|
27
27
|
import { ChipInput } from "../../../../../../../components/inputs/chip-input"
|
@@ -522,7 +522,7 @@ export const ProductCreateVariantsSection = ({
|
|
522
522
|
</Alert>
|
523
523
|
)}
|
524
524
|
{variants.fields.length > 0 && (
|
525
|
-
<InlineTip
|
525
|
+
<InlineTip variant="tip">
|
526
526
|
{t("products.create.variants.productVariants.tip")}
|
527
527
|
</InlineTip>
|
528
528
|
)}
|
package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx
CHANGED
@@ -181,6 +181,15 @@ export const ProductCreateForm = ({
|
|
181
181
|
}
|
182
182
|
|
183
183
|
if (currentTab === Tab.ORGANIZE) {
|
184
|
+
// TODO: this is temp until we add partial validation per tab
|
185
|
+
if (!form.getValues("shipping_profile_id")) {
|
186
|
+
form.setError("shipping_profile_id", {
|
187
|
+
type: "required",
|
188
|
+
message: t("products.shippingProfile.create.errors.required"),
|
189
|
+
})
|
190
|
+
return
|
191
|
+
}
|
192
|
+
|
184
193
|
setTab(Tab.VARIANTS)
|
185
194
|
}
|
186
195
|
|
@@ -220,13 +229,6 @@ export const ProductCreateForm = ({
|
|
220
229
|
onKeyDown={(e) => {
|
221
230
|
// We want to continue to the next tab on enter instead of saving as draft immediately
|
222
231
|
if (e.key === "Enter") {
|
223
|
-
if (
|
224
|
-
e.target instanceof HTMLTextAreaElement &&
|
225
|
-
!(e.metaKey || e.ctrlKey)
|
226
|
-
) {
|
227
|
-
return
|
228
|
-
}
|
229
|
-
|
230
232
|
e.preventDefault()
|
231
233
|
|
232
234
|
if (e.metaKey || e.ctrlKey) {
|
@@ -173,9 +173,7 @@ export const ProductCreateOrganizationSection = ({
|
|
173
173
|
</div>
|
174
174
|
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
|
175
175
|
<div>
|
176
|
-
<Form.Label
|
177
|
-
{t("products.fields.shipping_profile.label")}
|
178
|
-
</Form.Label>
|
176
|
+
<Form.Label>{t("products.fields.shipping_profile.label")}</Form.Label>
|
179
177
|
<Form.Hint>
|
180
178
|
<Trans i18nKey={"products.fields.shipping_profile.hint"} />
|
181
179
|
</Form.Hint>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { z } from "zod"
|
2
|
-
import { i18n } from "../../../components/utilities/i18n/i18n"
|
3
|
-
import { optionalFloat, optionalInt } from "../../../lib/validation"
|
4
|
-
import { decorateVariantsWithDefaultValues } from "./utils"
|
2
|
+
import { i18n } from "../../../components/utilities/i18n/i18n.tsx"
|
3
|
+
import { optionalFloat, optionalInt } from "../../../lib/validation.ts"
|
4
|
+
import { decorateVariantsWithDefaultValues } from "./utils.ts"
|
5
5
|
|
6
6
|
export const MediaSchema = z.object({
|
7
7
|
id: z.string().optional(),
|
@@ -64,7 +64,7 @@ export const ProductCreateSchema = z
|
|
64
64
|
discountable: z.boolean(),
|
65
65
|
type_id: z.string().optional(),
|
66
66
|
collection_id: z.string().optional(),
|
67
|
-
shipping_profile_id: z.string()
|
67
|
+
shipping_profile_id: z.string(), // TODO: require min(1) when partial validation per tab is added
|
68
68
|
categories: z.array(z.string()),
|
69
69
|
tags: z.array(z.string()).optional(),
|
70
70
|
sales_channels: z
|
@@ -24,7 +24,7 @@ export const normalizeProductFormValues = (
|
|
24
24
|
: undefined,
|
25
25
|
images,
|
26
26
|
collection_id: values.collection_id || undefined,
|
27
|
-
shipping_profile_id: values.shipping_profile_id
|
27
|
+
shipping_profile_id: values.shipping_profile_id,
|
28
28
|
categories: values.categories.map((id) => ({ id })),
|
29
29
|
type_id: values.type_id || undefined,
|
30
30
|
handle: values.handle || undefined,
|
@@ -75,8 +75,7 @@ export const ProductVariantSection = ({
|
|
75
75
|
: undefined,
|
76
76
|
created_at: created_at ? JSON.parse(created_at) : undefined,
|
77
77
|
updated_at: updated_at ? JSON.parse(updated_at) : undefined,
|
78
|
-
fields:
|
79
|
-
"title,sku,*options,created_at,updated_at,*inventory_items.inventory.location_levels,inventory_quantity",
|
78
|
+
fields: "*inventory_items.inventory.location_levels,+inventory_quantity",
|
80
79
|
},
|
81
80
|
{
|
82
81
|
placeholderData: keepPreviousData,
|
@@ -7,7 +7,9 @@ import { PricingEdit } from "./pricing-edit"
|
|
7
7
|
export const ProductPrices = () => {
|
8
8
|
const { id, variant_id } = useParams()
|
9
9
|
|
10
|
-
const { product, isLoading, isError, error } = useProduct(id
|
10
|
+
const { product, isLoading, isError, error } = useProduct(id!, {
|
11
|
+
fields: "+variants,+variants.prices",
|
12
|
+
})
|
11
13
|
|
12
14
|
if (isError) {
|
13
15
|
throw error
|
@@ -7,13 +7,12 @@ import { Form } from "../../../../../components/common/form"
|
|
7
7
|
import { Combobox } from "../../../../../components/inputs/combobox"
|
8
8
|
import { RouteDrawer, useRouteModal } from "../../../../../components/modals"
|
9
9
|
import { KeyboundForm } from "../../../../../components/utilities/keybound-form"
|
10
|
+
import { useExtendableForm } from "../../../../../extensions"
|
10
11
|
import { useUpdateProduct } from "../../../../../hooks/api/products"
|
11
12
|
import { useComboboxData } from "../../../../../hooks/use-combobox-data"
|
12
13
|
import { sdk } from "../../../../../lib/client"
|
13
14
|
import { useForm } from "react-hook-form"
|
14
15
|
import { zodResolver } from "@hookform/resolvers/zod"
|
15
|
-
import { se } from "date-fns/locale"
|
16
|
-
import { useEffect } from "react"
|
17
16
|
|
18
17
|
type ProductShippingProfileFormProps = {
|
19
18
|
product: HttpTypes.AdminProduct & {
|
@@ -48,15 +47,12 @@ export const ProductShippingProfileForm = ({
|
|
48
47
|
resolver: zodResolver(ProductShippingProfileSchema),
|
49
48
|
})
|
50
49
|
|
51
|
-
const selectedShippingProfile = form.watch("shipping_profile_id")
|
52
|
-
|
53
50
|
const { mutateAsync, isPending } = useUpdateProduct(product.id)
|
54
51
|
|
55
52
|
const handleSubmit = form.handleSubmit(async (data) => {
|
56
53
|
await mutateAsync(
|
57
54
|
{
|
58
|
-
shipping_profile_id:
|
59
|
-
data.shipping_profile_id === "" ? null : data.shipping_profile_id,
|
55
|
+
shipping_profile_id: data.shipping_profile_id,
|
60
56
|
},
|
61
57
|
{
|
62
58
|
onSuccess: ({ product }) => {
|
@@ -74,12 +70,6 @@ export const ProductShippingProfileForm = ({
|
|
74
70
|
)
|
75
71
|
})
|
76
72
|
|
77
|
-
useEffect(() => {
|
78
|
-
if (typeof selectedShippingProfile === "undefined") {
|
79
|
-
form.setValue("shipping_profile_id", "")
|
80
|
-
}
|
81
|
-
}, [selectedShippingProfile])
|
82
|
-
|
83
73
|
return (
|
84
74
|
<RouteDrawer.Form form={form}>
|
85
75
|
<KeyboundForm onSubmit={handleSubmit} className="flex h-full flex-col">
|
@@ -97,7 +87,6 @@ export const ProductShippingProfileForm = ({
|
|
97
87
|
<Form.Control>
|
98
88
|
<Combobox
|
99
89
|
{...field}
|
100
|
-
allowClear
|
101
90
|
options={shippingProfiles.options}
|
102
91
|
searchValue={shippingProfiles.searchValue}
|
103
92
|
onSearchValueChange={
|
@@ -1,11 +1,11 @@
|
|
1
|
+
import {
|
2
|
+
GEO_ZONE_STACKED_MODAL_ID
|
3
|
+
} from "./chunk-PYIO3TDQ.mjs";
|
1
4
|
import {
|
2
5
|
useCountries,
|
3
6
|
useCountryTableColumns,
|
4
7
|
useCountryTableQuery
|
5
8
|
} from "./chunk-NOAFLTPV.mjs";
|
6
|
-
import {
|
7
|
-
GEO_ZONE_STACKED_MODAL_ID
|
8
|
-
} from "./chunk-PYIO3TDQ.mjs";
|
9
9
|
import {
|
10
10
|
_DataTable,
|
11
11
|
useDataTable
|