fix: inventory item Type in Edit Mode.

This commit is contained in:
elforjani3
2020-11-29 16:57:51 +02:00
parent 8bff6afc19
commit 24b965e0ae
2 changed files with 4 additions and 9 deletions

View File

@@ -232,7 +232,7 @@ function ItemForm({
{({ isSubmitting, handleSubmit }) => (
<Form>
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
<ItemFormPrimarySection itemId={itemId} />
<ItemFormPrimarySection itemType={itemDetail?.type}/>
<ItemFormBody />
<ItemFormInventorySection />
</div>

View File

@@ -38,10 +38,8 @@ function ItemFormPrimarySection({
changePageSubtitle,
// #ownProps
itemId,
itemType,
}) {
const { formatMessage } = useIntl();
const isNewMode = !itemId;
const itemTypeHintContent = (
<>
@@ -91,7 +89,7 @@ function ItemFormPrimarySection({
changePageSubtitle(transitionItemTypeKeyToLabel(_value));
})}
selectedValue={value}
disabled={value === 'inventory' && !isNewMode}
disabled={itemType === 'inventory'}
>
<Radio label={<T id={'service'} />} value="service" />
<Radio label={<T id={'non_inventory'} />} value="non-inventory" />
@@ -142,10 +140,7 @@ function ItemFormPrimarySection({
inline={true}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name="category_id" />}
className={classNames(
'form-group--category',
Classes.FILL,
)}
className={classNames('form-group--category', Classes.FILL)}
>
<CategoriesSelectList
categoriesList={categoriesList}