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>
This commit is contained in:
Rares Stefan
2023-03-27 20:49:31 +02:00
committed by GitHub
parent 95c9fbfdd5
commit 455c56c4b3
2 changed files with 16 additions and 10 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/admin-ui": patch
---
fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled

View File

@@ -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"))}
/>
<InputField
label="Quantity in stock"
type="number"
placeholder="100..."
errors={errors}
{...register(path("inventory_quantity"), {
valueAsNumber: true,
})}
/>
{!stockLocationEnabled && (
<InputField
label="Quantity in stock"
type="number"
placeholder="100..."
errors={errors}
{...register(path("inventory_quantity"), {
valueAsNumber: true,
})}
/>
)}
<InputField
label="EAN (Barcode)"
placeholder="123456789102..."