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 StefanandOliver Windall Juhl authored and GitHub committed 2023-03-27 20:49:31 +02:00
1 parent 95c9fbfdd5
commit 455c56c4b3
2 files changed
+16 -10

No files matched your search

+5
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
@@ -17,7 +17,6 @@ import { useAdminStockLocations } from "medusa-react"
import { useFeatureFlag } from "../../../../../providers/feature-flag-provider" import { useFeatureFlag } from "../../../../../providers/feature-flag-provider"
// import { InventoryLevelDTO, StockLocationDTO } from "@medusajs/medusa" // import { InventoryLevelDTO, StockLocationDTO } from "@medusajs/medusa"
export type VariantStockFormType = { export type VariantStockFormType = {
manage_inventory?: boolean manage_inventory?: boolean
allow_backorder: boolean allow_backorder: boolean
@@ -108,15 +107,17 @@ const VariantStockForm = ({ form }: Props) => {
placeholder="SUN-G, JK1234..." placeholder="SUN-G, JK1234..."
{...register(path("sku"))} {...register(path("sku"))}
/> />
<InputField {!stockLocationEnabled && (
label="Quantity in stock" <InputField
type="number" label="Quantity in stock"
placeholder="100..." type="number"
errors={errors} placeholder="100..."
{...register(path("inventory_quantity"), { errors={errors}
valueAsNumber: true, {...register(path("inventory_quantity"), {
})} valueAsNumber: true,
/> })}
/>
)}
<InputField <InputField
label="EAN (Barcode)" label="EAN (Barcode)"
placeholder="123456789102..." placeholder="123456789102..."