mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
BIG-359:
This commit is contained in:
@@ -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}
|
||||
>
|
||||
>
|
||||
<Form>
|
||||
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
||||
<ItemFormPrimarySection />
|
||||
|
||||
@@ -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 (
|
||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER_PRIMARY)}>
|
||||
{/*----------- Item type ----------*/}
|
||||
<FastField name={'type'}>
|
||||
<FFormGroup
|
||||
name={'type'}
|
||||
label={<T id={'item_type'} />}
|
||||
labelInfo={
|
||||
<span>
|
||||
<FieldRequiredHint />
|
||||
<Hint
|
||||
content={itemTypeHintContent}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
/>
|
||||
</span>
|
||||
}
|
||||
inline={true}
|
||||
>
|
||||
<FCheckbox
|
||||
inline={true}
|
||||
name="type"
|
||||
label={<T id={'service'} />}
|
||||
value="service"
|
||||
/>
|
||||
<FCheckbox
|
||||
inline={true}
|
||||
name="type"
|
||||
label={<T id={'inventory'} />}
|
||||
value="inventory"
|
||||
/>
|
||||
</FFormGroup>
|
||||
{/* <FastField name={'type'}>
|
||||
{({ form, field: { value }, meta: { touched, error } }) => (
|
||||
<FormGroup
|
||||
medium={true}
|
||||
@@ -85,7 +117,7 @@ export default function ItemFormPrimarySection() {
|
||||
</RadioGroup>
|
||||
</FormGroup>
|
||||
)}
|
||||
</FastField>
|
||||
</FastField> */}
|
||||
|
||||
<Row>
|
||||
<Col xs={7}>
|
||||
|
||||
Reference in New Issue
Block a user