@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
@@ -0,0 +1,60 @@
|
|
1
|
+
import { clx } from "@medusajs/ui"
|
2
|
+
import { ComponentPropsWithoutRef, forwardRef } from "react"
|
3
|
+
import { useTranslation } from "react-i18next"
|
4
|
+
|
5
|
+
interface InlineTipProps extends ComponentPropsWithoutRef<"div"> {
|
6
|
+
/**
|
7
|
+
* The label to display in the tip.
|
8
|
+
*/
|
9
|
+
label?: string
|
10
|
+
/**
|
11
|
+
* The variant of the tip.
|
12
|
+
*/
|
13
|
+
variant?: "tip" | "warning"
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* A component for rendering inline tips. Useful for providing additional information or context.
|
18
|
+
*
|
19
|
+
* @example
|
20
|
+
* ```tsx
|
21
|
+
* <InlineTip label="Info">
|
22
|
+
* This is an info tip.
|
23
|
+
* </InlineTip>
|
24
|
+
* ```
|
25
|
+
*
|
26
|
+
* TODO: Move to `@medusajs/ui` package.
|
27
|
+
*/
|
28
|
+
export const InlineTip = forwardRef<HTMLDivElement, InlineTipProps>(
|
29
|
+
({ variant = "tip", label, className, children, ...props }, ref) => {
|
30
|
+
const { t } = useTranslation()
|
31
|
+
const labelValue =
|
32
|
+
label || (variant === "warning" ? t("general.warning") : t("general.tip"))
|
33
|
+
|
34
|
+
return (
|
35
|
+
<div
|
36
|
+
ref={ref}
|
37
|
+
className={clx(
|
38
|
+
"bg-ui-bg-component txt-small text-ui-fg-subtle grid grid-cols-[4px_1fr] items-start gap-3 rounded-lg border p-3",
|
39
|
+
className
|
40
|
+
)}
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<div
|
44
|
+
role="presentation"
|
45
|
+
className={clx("w-4px bg-ui-tag-neutral-icon h-full rounded-full", {
|
46
|
+
"bg-ui-tag-orange-icon": variant === "warning",
|
47
|
+
})}
|
48
|
+
/>
|
49
|
+
<div className="text-pretty">
|
50
|
+
<strong className="txt-small-plus text-ui-fg-base">
|
51
|
+
{labelValue}:
|
52
|
+
</strong>{" "}
|
53
|
+
{children}
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
)
|
59
|
+
|
60
|
+
InlineTip.displayName = "InlineTip"
|
@@ -4,7 +4,6 @@ import {
|
|
4
4
|
DropdownMenu,
|
5
5
|
Heading,
|
6
6
|
IconButton,
|
7
|
-
InlineTip,
|
8
7
|
clx,
|
9
8
|
toast,
|
10
9
|
} from "@medusajs/ui"
|
@@ -22,6 +21,7 @@ import { FetchError } from "@medusajs/js-sdk"
|
|
22
21
|
import { ComponentPropsWithoutRef, forwardRef } from "react"
|
23
22
|
import { ConditionalTooltip } from "../../common/conditional-tooltip"
|
24
23
|
import { Form } from "../../common/form"
|
24
|
+
import { InlineTip } from "../../common/inline-tip"
|
25
25
|
import { Skeleton } from "../../common/skeleton"
|
26
26
|
import { RouteDrawer, useRouteModal } from "../../modals"
|
27
27
|
import { KeyboundForm } from "../../utilities/keybound-form"
|
@@ -88,7 +88,7 @@ const InnerForm = <TRes,>({
|
|
88
88
|
})
|
89
89
|
|
90
90
|
const handleSubmit = form.handleSubmit(async (data) => {
|
91
|
-
const parsedData = parseValues(data
|
91
|
+
const parsedData = parseValues(data)
|
92
92
|
|
93
93
|
await hook(
|
94
94
|
{
|
@@ -364,8 +364,7 @@ function getDefaultValues(
|
|
364
364
|
}
|
365
365
|
|
366
366
|
function parseValues(
|
367
|
-
values: z.infer<typeof MetadataSchema
|
368
|
-
original?: Record<string, any> | null
|
367
|
+
values: z.infer<typeof MetadataSchema>
|
369
368
|
): Record<string, any> | null {
|
370
369
|
const metadata = values.metadata
|
371
370
|
|
@@ -379,22 +378,12 @@ function parseValues(
|
|
379
378
|
|
380
379
|
const update: Record<string, any> = {}
|
381
380
|
|
382
|
-
// First, handle removed keys from original
|
383
|
-
if (original) {
|
384
|
-
Object.keys(original).forEach((originalKey) => {
|
385
|
-
const exists = metadata.some((field) => field.key === originalKey)
|
386
|
-
if (!exists) {
|
387
|
-
update[originalKey] = ""
|
388
|
-
}
|
389
|
-
})
|
390
|
-
}
|
391
|
-
|
392
381
|
metadata.forEach((field) => {
|
393
382
|
let key = field.key
|
394
383
|
let value = field.value
|
395
384
|
const disabled = field.disabled
|
396
385
|
|
397
|
-
if (!key) {
|
386
|
+
if (!key || !value) {
|
398
387
|
return
|
399
388
|
}
|
400
389
|
|
@@ -404,7 +393,7 @@ function parseValues(
|
|
404
393
|
}
|
405
394
|
|
406
395
|
key = key.trim()
|
407
|
-
value = value
|
396
|
+
value = value.trim()
|
408
397
|
|
409
398
|
// We try to cast the value to a boolean or number if possible
|
410
399
|
if (value === "true") {
|
@@ -412,9 +401,9 @@ function parseValues(
|
|
412
401
|
} else if (value === "false") {
|
413
402
|
update[key] = false
|
414
403
|
} else {
|
415
|
-
const
|
416
|
-
if (
|
417
|
-
update[key] =
|
404
|
+
const parsedNumber = parseFloat(value)
|
405
|
+
if (!isNaN(parsedNumber)) {
|
406
|
+
update[key] = parsedNumber
|
418
407
|
} else {
|
419
408
|
update[key] = value
|
420
409
|
}
|
@@ -57,7 +57,6 @@ interface ComboboxProps<T extends Value = Value>
|
|
57
57
|
isFetchingNextPage?: boolean
|
58
58
|
onCreateOption?: (value: string) => void
|
59
59
|
noResultsPlaceholder?: ReactNode
|
60
|
-
allowClear?: boolean
|
61
60
|
}
|
62
61
|
|
63
62
|
const ComboboxImpl = <T extends Value = string>(
|
@@ -73,7 +72,6 @@ const ComboboxImpl = <T extends Value = string>(
|
|
73
72
|
isFetchingNextPage,
|
74
73
|
onCreateOption,
|
75
74
|
noResultsPlaceholder,
|
76
|
-
allowClear,
|
77
75
|
...inputProps
|
78
76
|
}: ComboboxProps<T>,
|
79
77
|
ref: ForwardedRef<HTMLInputElement>
|
@@ -305,18 +303,6 @@ const ComboboxImpl = <T extends Value = string>(
|
|
305
303
|
{...inputProps}
|
306
304
|
/>
|
307
305
|
</div>
|
308
|
-
{allowClear && controlledValue && (
|
309
|
-
<button
|
310
|
-
type="button"
|
311
|
-
onClick={(e) => {
|
312
|
-
e.preventDefault()
|
313
|
-
handleValueChange(undefined)
|
314
|
-
}}
|
315
|
-
className="bg-ui-bg-base hover:bg-ui-bg-base-hover txt-compact-small-plus text-ui-fg-subtle focus-within:border-ui-fg-interactive transition-fg absolute right-[28px] top-0.5 z-[1] flex h-[28px] items-center rounded-[4px] border px-1.5 py-[2px] outline-none"
|
316
|
-
>
|
317
|
-
<XMarkMini className="text-ui-fg-muted" />
|
318
|
-
</button>
|
319
|
-
)}
|
320
306
|
<PrimitiveComboboxDisclosure
|
321
307
|
render={(props) => {
|
322
308
|
return (
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { Input, Switch } from "@medusajs/ui"
|
2
2
|
import { ComponentType } from "react"
|
3
3
|
import { ControllerRenderProps, UseFormReturn } from "react-hook-form"
|
4
|
-
import { useTranslation } from "react-i18next"
|
5
4
|
import { Form } from "../../../components/common/form"
|
5
|
+
import { InlineTip } from "../../../components/common/inline-tip"
|
6
6
|
import { FormField } from "../../types"
|
7
7
|
import { FormFieldType } from "./types"
|
8
8
|
import { getFieldType } from "./utils"
|
@@ -86,8 +86,6 @@ const FormExtensionFieldComponent = ({
|
|
86
86
|
component,
|
87
87
|
placeholder,
|
88
88
|
}: FormExtensionFieldComponentProps) => {
|
89
|
-
const { t } = useTranslation()
|
90
|
-
|
91
89
|
if (component) {
|
92
90
|
const Component = component
|
93
91
|
|
@@ -106,7 +104,7 @@ const FormExtensionFieldComponent = ({
|
|
106
104
|
}
|
107
105
|
default: {
|
108
106
|
return (
|
109
|
-
<InlineTip variant="warning"
|
107
|
+
<InlineTip variant="warning">
|
110
108
|
The field type does not support rendering a fallback component. Please
|
111
109
|
provide a component prop.
|
112
110
|
</InlineTip>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ComponentType } from "react"
|
2
|
-
import {
|
2
|
+
import { RouteObject } from "react-router-dom"
|
3
3
|
import { ErrorBoundary } from "../../components/utilities/error-boundary"
|
4
4
|
import { RouteExtension, RouteModule } from "../types"
|
5
5
|
|
@@ -21,176 +21,50 @@ export const getRouteExtensions = (
|
|
21
21
|
})
|
22
22
|
}
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
const
|
29
|
-
path: segment,
|
30
|
-
children: [],
|
31
|
-
})
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Creates a route object for a leaf node with its component
|
35
|
-
* @param Component - The React component to render at this route
|
36
|
-
*/
|
37
|
-
const createLeafRoute = (
|
38
|
-
Component: ComponentType,
|
39
|
-
loader?: LoaderFunction,
|
40
|
-
handle?: object
|
41
|
-
): RouteObject => ({
|
42
|
-
path: "",
|
43
|
-
ErrorBoundary: ErrorBoundary,
|
44
|
-
async lazy() {
|
45
|
-
const result: {
|
46
|
-
Component: ComponentType
|
47
|
-
loader?: LoaderFunction
|
48
|
-
handle?: object
|
49
|
-
} = { Component }
|
50
|
-
|
51
|
-
if (loader) {
|
52
|
-
result.loader = loader
|
53
|
-
}
|
24
|
+
export const createRouteMap = (
|
25
|
+
routes: RouteExtension[],
|
26
|
+
ignore?: string
|
27
|
+
): RouteObject[] => {
|
28
|
+
const root: RouteObject[] = []
|
54
29
|
|
55
|
-
|
56
|
-
|
30
|
+
const addRoute = (
|
31
|
+
pathSegments: string[],
|
32
|
+
Component: ComponentType,
|
33
|
+
currentLevel: RouteObject[]
|
34
|
+
) => {
|
35
|
+
if (!pathSegments.length) {
|
36
|
+
return
|
57
37
|
}
|
58
38
|
|
59
|
-
|
60
|
-
|
61
|
-
})
|
62
|
-
|
63
|
-
/**
|
64
|
-
* Creates a parallel route configuration
|
65
|
-
* @param path - The route path
|
66
|
-
* @param Component - The React component to render
|
67
|
-
*/
|
68
|
-
const createParallelRoute = (
|
69
|
-
path: string,
|
70
|
-
Component: ComponentType,
|
71
|
-
loader?: LoaderFunction,
|
72
|
-
handle?: object
|
73
|
-
) => ({
|
74
|
-
path,
|
75
|
-
async lazy() {
|
76
|
-
const result: {
|
77
|
-
Component: ComponentType
|
78
|
-
loader?: LoaderFunction
|
79
|
-
handle?: object
|
80
|
-
} = { Component }
|
81
|
-
|
82
|
-
if (loader) {
|
83
|
-
result.loader = loader
|
84
|
-
}
|
39
|
+
const [currentSegment, ...remainingSegments] = pathSegments
|
40
|
+
let route = currentLevel.find((r) => r.path === currentSegment)
|
85
41
|
|
86
|
-
if (
|
87
|
-
|
42
|
+
if (!route) {
|
43
|
+
route = { path: currentSegment, children: [] }
|
44
|
+
currentLevel.push(route)
|
88
45
|
}
|
89
46
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
): RouteObject[] | undefined => {
|
103
|
-
return parallelRoutes
|
104
|
-
?.map(({ path, Component, loader, handle }) => {
|
105
|
-
const childPath = path?.replace(currentFullPath, "").replace(/^\/+/, "")
|
106
|
-
if (!childPath) {
|
107
|
-
return null
|
108
|
-
}
|
109
|
-
return createParallelRoute(childPath, Component, loader, handle)
|
110
|
-
})
|
111
|
-
.filter(Boolean) as RouteObject[]
|
112
|
-
}
|
113
|
-
|
114
|
-
/**
|
115
|
-
* Recursively builds the route tree by adding routes at the correct level
|
116
|
-
* @param pathSegments - Array of remaining path segments to process
|
117
|
-
* @param Component - The React component for the route
|
118
|
-
* @param currentLevel - Current level in the route tree
|
119
|
-
* @param parallelRoutes - Optional parallel routes to add
|
120
|
-
* @param fullPath - The full path up to the current level
|
121
|
-
*/
|
122
|
-
const addRoute = (
|
123
|
-
pathSegments: string[],
|
124
|
-
Component: ComponentType,
|
125
|
-
currentLevel: RouteObject[],
|
126
|
-
loader?: LoaderFunction,
|
127
|
-
handle?: object,
|
128
|
-
parallelRoutes?: RouteExtension[],
|
129
|
-
fullPath?: string
|
130
|
-
) => {
|
131
|
-
if (!pathSegments.length) {
|
132
|
-
return
|
133
|
-
}
|
134
|
-
|
135
|
-
const [currentSegment, ...remainingSegments] = pathSegments
|
136
|
-
let route = currentLevel.find((r) => r.path === currentSegment)
|
137
|
-
|
138
|
-
if (!route) {
|
139
|
-
route = createBranchRoute(currentSegment)
|
140
|
-
currentLevel.push(route)
|
141
|
-
}
|
142
|
-
|
143
|
-
const currentFullPath = fullPath
|
144
|
-
? `${fullPath}/${currentSegment}`
|
145
|
-
: currentSegment
|
146
|
-
|
147
|
-
if (remainingSegments.length === 0) {
|
148
|
-
route.children ||= []
|
149
|
-
const leaf = createLeafRoute(Component, loader)
|
150
|
-
|
151
|
-
/**
|
152
|
-
* The handle needs to be set on the wrapper route object,
|
153
|
-
* in order for it to be resolved correctly thoughout
|
154
|
-
* the branch.
|
155
|
-
*/
|
156
|
-
if (handle) {
|
157
|
-
route.handle = handle
|
47
|
+
if (remainingSegments.length === 0) {
|
48
|
+
route.children ||= []
|
49
|
+
route.children.push({
|
50
|
+
path: "",
|
51
|
+
ErrorBoundary: ErrorBoundary,
|
52
|
+
async lazy() {
|
53
|
+
return { Component }
|
54
|
+
},
|
55
|
+
})
|
56
|
+
} else {
|
57
|
+
route.children ||= []
|
58
|
+
addRoute(remainingSegments, Component, route.children)
|
158
59
|
}
|
159
|
-
|
160
|
-
leaf.children = processParallelRoutes(parallelRoutes, currentFullPath)
|
161
|
-
route.children.push(leaf)
|
162
|
-
} else {
|
163
|
-
route.children ||= []
|
164
|
-
addRoute(
|
165
|
-
remainingSegments,
|
166
|
-
Component,
|
167
|
-
route.children,
|
168
|
-
loader,
|
169
|
-
handle,
|
170
|
-
parallelRoutes,
|
171
|
-
currentFullPath
|
172
|
-
)
|
173
60
|
}
|
174
|
-
}
|
175
|
-
|
176
|
-
/**
|
177
|
-
* Creates a complete route map from route extensions
|
178
|
-
* @param routes - Array of route extensions to process
|
179
|
-
* @param ignore - Optional path prefix to ignore when processing routes
|
180
|
-
* @returns An array of route objects forming a route tree
|
181
|
-
*/
|
182
|
-
export const createRouteMap = (
|
183
|
-
routes: RouteExtension[],
|
184
|
-
ignore?: string
|
185
|
-
): RouteObject[] => {
|
186
|
-
const root: RouteObject[] = []
|
187
61
|
|
188
|
-
routes.forEach(({ path, Component
|
62
|
+
routes.forEach(({ path, Component }) => {
|
189
63
|
const cleanedPath = ignore
|
190
64
|
? path.replace(ignore, "").replace(/^\/+/, "")
|
191
65
|
: path.replace(/^\/+/, "")
|
192
66
|
const pathSegments = cleanedPath.split("/").filter(Boolean)
|
193
|
-
addRoute(pathSegments, Component, root
|
67
|
+
addRoute(pathSegments, Component, root)
|
194
68
|
})
|
195
69
|
|
196
70
|
return root
|
package/src/extensions/types.ts
CHANGED
@@ -6,9 +6,6 @@ type UseProductTableQueryProps = {
|
|
6
6
|
pageSize?: number
|
7
7
|
}
|
8
8
|
|
9
|
-
const DEFAULT_FIELDS =
|
10
|
-
"id,title,handle,status,*collection,*sales_channels,variants.id"
|
11
|
-
|
12
9
|
export const useProductTableQuery = ({
|
13
10
|
prefix,
|
14
11
|
pageSize = 20,
|
@@ -61,7 +58,6 @@ export const useProductTableQuery = ({
|
|
61
58
|
type_id: type_id?.split(","),
|
62
59
|
status: status?.split(",") as HttpTypes.AdminProductStatus[],
|
63
60
|
q,
|
64
|
-
fields: DEFAULT_FIELDS,
|
65
61
|
}
|
66
62
|
|
67
63
|
return {
|
@@ -4806,9 +4806,6 @@
|
|
4806
4806
|
"markAsShipped": {
|
4807
4807
|
"type": "string"
|
4808
4808
|
},
|
4809
|
-
"markAsPickedUp": {
|
4810
|
-
"type": "string"
|
4811
|
-
},
|
4812
4809
|
"markAsDelivered": {
|
4813
4810
|
"type": "string"
|
4814
4811
|
},
|
@@ -4918,17 +4915,13 @@
|
|
4918
4915
|
},
|
4919
4916
|
"fulfillmentDelivered": {
|
4920
4917
|
"type": "string"
|
4921
|
-
},
|
4922
|
-
"fulfillmentPickedUp": {
|
4923
|
-
"type": "string"
|
4924
4918
|
}
|
4925
4919
|
},
|
4926
4920
|
"required": [
|
4927
4921
|
"created",
|
4928
4922
|
"canceled",
|
4929
4923
|
"fulfillmentShipped",
|
4930
|
-
"fulfillmentDelivered"
|
4931
|
-
"fulfillmentPickedUp"
|
4924
|
+
"fulfillmentDelivered"
|
4932
4925
|
],
|
4933
4926
|
"additionalProperties": false
|
4934
4927
|
},
|
@@ -4959,7 +4952,6 @@
|
|
4959
4952
|
"available",
|
4960
4953
|
"inStock",
|
4961
4954
|
"markAsShipped",
|
4962
|
-
"markAsPickedUp",
|
4963
4955
|
"markAsDelivered",
|
4964
4956
|
"itemsToFulfillDesc",
|
4965
4957
|
"locationDescription",
|
@@ -5762,23 +5754,6 @@
|
|
5762
5754
|
],
|
5763
5755
|
"additionalProperties": false
|
5764
5756
|
},
|
5765
|
-
"pickupOptions": {
|
5766
|
-
"type": "object",
|
5767
|
-
"properties": {
|
5768
|
-
"edit": {
|
5769
|
-
"type": "object",
|
5770
|
-
"properties": {
|
5771
|
-
"header": {
|
5772
|
-
"type": "string"
|
5773
|
-
}
|
5774
|
-
},
|
5775
|
-
"required": ["header"],
|
5776
|
-
"additionalProperties": false
|
5777
|
-
}
|
5778
|
-
},
|
5779
|
-
"required": ["edit"],
|
5780
|
-
"additionalProperties": false
|
5781
|
-
},
|
5782
5757
|
"shippingOptions": {
|
5783
5758
|
"type": "object",
|
5784
5759
|
"properties": {
|
@@ -5804,25 +5779,6 @@
|
|
5804
5779
|
"required": ["header", "hint", "label", "successToast"],
|
5805
5780
|
"additionalProperties": false
|
5806
5781
|
},
|
5807
|
-
"pickup": {
|
5808
|
-
"type": "object",
|
5809
|
-
"properties": {
|
5810
|
-
"header": {
|
5811
|
-
"type": "string"
|
5812
|
-
},
|
5813
|
-
"hint": {
|
5814
|
-
"type": "string"
|
5815
|
-
},
|
5816
|
-
"label": {
|
5817
|
-
"type": "string"
|
5818
|
-
},
|
5819
|
-
"successToast": {
|
5820
|
-
"type": "string"
|
5821
|
-
}
|
5822
|
-
},
|
5823
|
-
"required": ["header", "hint", "label", "successToast"],
|
5824
|
-
"additionalProperties": false
|
5825
|
-
},
|
5826
5782
|
"returns": {
|
5827
5783
|
"type": "object",
|
5828
5784
|
"properties": {
|
@@ -5859,7 +5815,7 @@
|
|
5859
5815
|
"type": "string"
|
5860
5816
|
}
|
5861
5817
|
},
|
5862
|
-
"required": ["shipping", "
|
5818
|
+
"required": ["shipping", "returns", "tabs", "action"],
|
5863
5819
|
"additionalProperties": false
|
5864
5820
|
},
|
5865
5821
|
"delete": {
|
@@ -6040,12 +5996,6 @@
|
|
6040
5996
|
"shipping_other": {
|
6041
5997
|
"type": "string"
|
6042
5998
|
},
|
6043
|
-
"pickup_one": {
|
6044
|
-
"type": "string"
|
6045
|
-
},
|
6046
|
-
"pickup_other": {
|
6047
|
-
"type": "string"
|
6048
|
-
},
|
6049
5999
|
"returns_one": {
|
6050
6000
|
"type": "string"
|
6051
6001
|
},
|
@@ -6056,8 +6006,6 @@
|
|
6056
6006
|
"required": [
|
6057
6007
|
"shipping_one",
|
6058
6008
|
"shipping_other",
|
6059
|
-
"pickup_one",
|
6060
|
-
"pickup_other",
|
6061
6009
|
"returns_one",
|
6062
6010
|
"returns_other"
|
6063
6011
|
],
|
@@ -6253,7 +6201,6 @@
|
|
6253
6201
|
"fulfillmentSets",
|
6254
6202
|
"sidebar",
|
6255
6203
|
"salesChannels",
|
6256
|
-
"pickupOptions",
|
6257
6204
|
"shippingOptions",
|
6258
6205
|
"serviceZones"
|
6259
6206
|
],
|
@@ -1281,7 +1281,6 @@
|
|
1281
1281
|
"available": "Available",
|
1282
1282
|
"inStock": "In stock",
|
1283
1283
|
"markAsShipped": "Mark as shipped",
|
1284
|
-
"markAsPickedUp": "Mark as picked up",
|
1285
1284
|
"markAsDelivered": "Mark as delivered",
|
1286
1285
|
"itemsToFulfillDesc": "Choose items and quantities to fulfill",
|
1287
1286
|
"locationDescription": "Choose which location you want to fulfill items from.",
|
@@ -1311,8 +1310,7 @@
|
|
1311
1310
|
"created": "Fulfillment created successfully",
|
1312
1311
|
"canceled": "Fulfillment successfully canceled",
|
1313
1312
|
"fulfillmentShipped": "Cannot cancel an already shipped fulfillment",
|
1314
|
-
"fulfillmentDelivered": "Fulfillment marked as delivered successfully"
|
1315
|
-
"fulfillmentPickedUp": "Fulfillment marked as picked up successfully"
|
1313
|
+
"fulfillmentDelivered": "Fulfillment marked as delivered successfully"
|
1316
1314
|
},
|
1317
1315
|
"trackingLabel": "Tracking",
|
1318
1316
|
"shippingFromLabel": "Shipping from",
|
@@ -1522,11 +1520,6 @@
|
|
1522
1520
|
"action": "Connect sales channels",
|
1523
1521
|
"successToast": "Sales channels were successfully updated."
|
1524
1522
|
},
|
1525
|
-
"pickupOptions": {
|
1526
|
-
"edit": {
|
1527
|
-
"header": "Edit Pickup Option"
|
1528
|
-
}
|
1529
|
-
},
|
1530
1523
|
"shippingOptions": {
|
1531
1524
|
"create": {
|
1532
1525
|
"shipping": {
|
@@ -1535,12 +1528,6 @@
|
|
1535
1528
|
"label": "Shipping options",
|
1536
1529
|
"successToast": "Shipping option {{name}} was successfully created."
|
1537
1530
|
},
|
1538
|
-
"pickup": {
|
1539
|
-
"header": "Create Pickup Option for {{zone}}",
|
1540
|
-
"hint": "Create a new pickup option to define how products are picked up from this location.",
|
1541
|
-
"label": "Pickup options",
|
1542
|
-
"successToast": "Pickup option {{name}} was successfully created."
|
1543
|
-
},
|
1544
1531
|
"returns": {
|
1545
1532
|
"header": "Create a Return Option for {{zone}}",
|
1546
1533
|
"hint": "Create a new return option to define how products are returned to this location.",
|
@@ -1604,8 +1591,6 @@
|
|
1604
1591
|
"count": {
|
1605
1592
|
"shipping_one": "{{count}} shipping option",
|
1606
1593
|
"shipping_other": "{{count}} shipping options",
|
1607
|
-
"pickup_one": "{{count}} pickup option",
|
1608
|
-
"pickup_other": "{{count}} pickup options",
|
1609
1594
|
"returns_one": "{{count}} return option",
|
1610
1595
|
"returns_other": "{{count}} return options"
|
1611
1596
|
},
|
@@ -154,9 +154,7 @@ export const ApiKeyGeneralSection = ({ apiKey }: ApiKeyGeneralSectionProps) => {
|
|
154
154
|
{t("fields.key")}
|
155
155
|
</Text>
|
156
156
|
{apiKey.type === "secret" ? (
|
157
|
-
<Badge size="2xsmall"
|
158
|
-
{prettifyRedactedToken(apiKey.redacted)}
|
159
|
-
</Badge>
|
157
|
+
<Badge size="2xsmall">{prettifyRedactedToken(apiKey.redacted)}</Badge>
|
160
158
|
) : (
|
161
159
|
<Copy asChild content={apiKey.token} className="cursor-pointer">
|
162
160
|
<Badge size="2xsmall" className="text-ui-tag-neutral-text">
|