mirror of
https://github.com/inventree/InvenTree.git
synced 2026-04-25 04:23:33 +00:00
feat(frontend): add inline component addition to bom dialog (#11781)
* feat(frontend): add inline component addition to BOM dialog closes https://github.com/invenhost/InvenTree/issues/311 * adapt to new var name
This commit is contained in:
@@ -12,6 +12,7 @@ import { RenderPart } from '../components/render/Part';
|
|||||||
import { showApiErrorMessage } from '../functions/notifications';
|
import { showApiErrorMessage } from '../functions/notifications';
|
||||||
import { useCreateApiFormModal } from '../hooks/UseForm';
|
import { useCreateApiFormModal } from '../hooks/UseForm';
|
||||||
import { useUserState } from '../states/UserState';
|
import { useUserState } from '../states/UserState';
|
||||||
|
import { usePartFields } from './PartForms';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field set for BomItem form
|
* Field set for BomItem form
|
||||||
@@ -21,6 +22,10 @@ export function bomItemFields({
|
|||||||
}: {
|
}: {
|
||||||
showAssembly?: boolean;
|
showAssembly?: boolean;
|
||||||
}): ApiFormFieldSet {
|
}): ApiFormFieldSet {
|
||||||
|
const newPartFields = usePartFields({
|
||||||
|
create: true
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
part: {
|
part: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@@ -30,7 +35,8 @@ export function bomItemFields({
|
|||||||
filters: {
|
filters: {
|
||||||
active: true, // Only show active parts when creating a new BOM item
|
active: true, // Only show active parts when creating a new BOM item
|
||||||
component: true
|
component: true
|
||||||
}
|
},
|
||||||
|
addCreateFields: newPartFields
|
||||||
},
|
},
|
||||||
quantity: {},
|
quantity: {},
|
||||||
reference: {},
|
reference: {},
|
||||||
|
|||||||
Reference in New Issue
Block a user