From 455c56c4b3846c583f39ba56352d645128b0c967 Mon Sep 17 00:00:00 2001 From: Rares Stefan Date: Mon, 27 Mar 2023 20:49:31 +0200 Subject: [PATCH] fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled (#3592) * Hide inventory stock field if stock locations module enabled * Create purple-cats-brake.md --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> --- .changeset/purple-cats-brake.md | 5 +++++ .../variant-form/variant-stock-form/index.tsx | 21 ++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .changeset/purple-cats-brake.md diff --git a/.changeset/purple-cats-brake.md b/.changeset/purple-cats-brake.md new file mode 100644 index 0000000000..7d04dec3b1 --- /dev/null +++ b/.changeset/purple-cats-brake.md @@ -0,0 +1,5 @@ +--- +"@medusajs/admin-ui": patch +--- + +fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled diff --git a/packages/admin-ui/ui/src/components/forms/product/variant-form/variant-stock-form/index.tsx b/packages/admin-ui/ui/src/components/forms/product/variant-form/variant-stock-form/index.tsx index af88ce589c..bf89f2d1bf 100644 --- a/packages/admin-ui/ui/src/components/forms/product/variant-form/variant-stock-form/index.tsx +++ b/packages/admin-ui/ui/src/components/forms/product/variant-form/variant-stock-form/index.tsx @@ -17,7 +17,6 @@ import { useAdminStockLocations } from "medusa-react" import { useFeatureFlag } from "../../../../../providers/feature-flag-provider" // import { InventoryLevelDTO, StockLocationDTO } from "@medusajs/medusa" - export type VariantStockFormType = { manage_inventory?: boolean allow_backorder: boolean @@ -108,15 +107,17 @@ const VariantStockForm = ({ form }: Props) => { placeholder="SUN-G, JK1234..." {...register(path("sku"))} /> - + {!stockLocationEnabled && ( + + )}