mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
fix: inventory item Type in Edit Mode.
This commit is contained in:
@@ -232,7 +232,7 @@ function ItemForm({
|
|||||||
{({ isSubmitting, handleSubmit }) => (
|
{({ isSubmitting, handleSubmit }) => (
|
||||||
<Form>
|
<Form>
|
||||||
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
||||||
<ItemFormPrimarySection itemId={itemId} />
|
<ItemFormPrimarySection itemType={itemDetail?.type}/>
|
||||||
<ItemFormBody />
|
<ItemFormBody />
|
||||||
<ItemFormInventorySection />
|
<ItemFormInventorySection />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,10 +38,8 @@ function ItemFormPrimarySection({
|
|||||||
changePageSubtitle,
|
changePageSubtitle,
|
||||||
|
|
||||||
// #ownProps
|
// #ownProps
|
||||||
itemId,
|
itemType,
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage } = useIntl();
|
|
||||||
const isNewMode = !itemId;
|
|
||||||
|
|
||||||
const itemTypeHintContent = (
|
const itemTypeHintContent = (
|
||||||
<>
|
<>
|
||||||
@@ -91,7 +89,7 @@ function ItemFormPrimarySection({
|
|||||||
changePageSubtitle(transitionItemTypeKeyToLabel(_value));
|
changePageSubtitle(transitionItemTypeKeyToLabel(_value));
|
||||||
})}
|
})}
|
||||||
selectedValue={value}
|
selectedValue={value}
|
||||||
disabled={value === 'inventory' && !isNewMode}
|
disabled={itemType === 'inventory'}
|
||||||
>
|
>
|
||||||
<Radio label={<T id={'service'} />} value="service" />
|
<Radio label={<T id={'service'} />} value="service" />
|
||||||
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
|
||||||
@@ -142,10 +140,7 @@ function ItemFormPrimarySection({
|
|||||||
inline={true}
|
inline={true}
|
||||||
intent={inputIntent({ error, touched })}
|
intent={inputIntent({ error, touched })}
|
||||||
helperText={<ErrorMessage name="category_id" />}
|
helperText={<ErrorMessage name="category_id" />}
|
||||||
className={classNames(
|
className={classNames('form-group--category', Classes.FILL)}
|
||||||
'form-group--category',
|
|
||||||
Classes.FILL,
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<CategoriesSelectList
|
<CategoriesSelectList
|
||||||
categoriesList={categoriesList}
|
categoriesList={categoriesList}
|
||||||
|
|||||||
Reference in New Issue
Block a user