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:
5
.changeset/purple-cats-brake.md
Normal file
5
.changeset/purple-cats-brake.md
Normal 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 { 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..."
|
||||
|
||||
Reference in New Issue
Block a user