diff --git a/src/containers/Items/ItemFormFormik.js b/src/containers/Items/ItemFormFormik.js index 7876cd6ed..83b5fe7a9 100644 --- a/src/containers/Items/ItemFormFormik.js +++ b/src/containers/Items/ItemFormFormik.js @@ -50,7 +50,7 @@ export default function ItemFormFormik({ // Handles the form submit. const handleFormSubmit = (values, form) => { const { setSubmitting, resetForm, setErrors } = form; - const formValues = { ...values }; + const formValues = { ...values, type: values.type.toString() }; setSubmitting(true); @@ -96,7 +96,7 @@ export default function ItemFormFormik({ validationSchema={isNewMode ? CreateItemFormSchema : EditItemFormSchema} initialValues={initialValues} onSubmit={handleFormSubmit} - > + >
diff --git a/src/containers/Items/ItemFormPrimarySection.js b/src/containers/Items/ItemFormPrimarySection.js index 88987a2a7..4c872fd8d 100644 --- a/src/containers/Items/ItemFormPrimarySection.js +++ b/src/containers/Items/ItemFormPrimarySection.js @@ -7,7 +7,12 @@ import { Radio, Position, } from '@blueprintjs/core'; -import { FormattedMessage as T, FormattedHTMLMessage } from 'components'; +import { + FormattedMessage as T, + FormattedHTMLMessage, + FCheckbox, + FFormGroup, +} from 'components'; import { ErrorMessage, FastField } from 'formik'; import { CategoriesSelectList, @@ -29,7 +34,7 @@ import { categoriesFieldShouldUpdate } from './utils'; export default function ItemFormPrimarySection() { // Item form context. const { isNewMode, item, itemsCategories } = useItemFormContext(); - + console.log(item.type, 'XXX'); const nameFieldRef = useRef(null); useEffect(() => { @@ -53,7 +58,34 @@ export default function ItemFormPrimarySection() { return (
{/*----------- Item type ----------*/} - + } + labelInfo={ + + + + + } + inline={true} + > + } + value="service" + /> + } + value="inventory" + /> + + {/* {({ form, field: { value }, meta: { touched, error } }) => ( )} - + */}