mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix: active checkbox in itemForm.
This commit is contained in:
@@ -40,7 +40,6 @@ const defaultInitialValues = {
|
|||||||
sell_account_id: '',
|
sell_account_id: '',
|
||||||
inventory_account_id: '',
|
inventory_account_id: '',
|
||||||
category_id: '',
|
category_id: '',
|
||||||
note: '',
|
|
||||||
sellable: 1,
|
sellable: 1,
|
||||||
purchasable: true,
|
purchasable: true,
|
||||||
};
|
};
|
||||||
@@ -232,7 +231,7 @@ function ItemForm({
|
|||||||
{({ isSubmitting, handleSubmit }) => (
|
{({ isSubmitting, handleSubmit }) => (
|
||||||
<Form>
|
<Form>
|
||||||
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
<div class={classNames(CLASSES.PAGE_FORM_BODY)}>
|
||||||
<ItemFormPrimarySection itemType={itemDetail?.type}/>
|
<ItemFormPrimarySection itemType={itemDetail?.type} />
|
||||||
<ItemFormBody />
|
<ItemFormBody />
|
||||||
<ItemFormInventorySection />
|
<ItemFormInventorySection />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import classNames from 'classnames';
|
|||||||
import { FastField } from 'formik';
|
import { FastField } from 'formik';
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item form floating actions.
|
* Item form floating actions.
|
||||||
*/
|
*/
|
||||||
@@ -54,14 +55,14 @@ export default function ItemFormFloatingActions({
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/*----------- Active ----------*/}
|
{/*----------- Active ----------*/}
|
||||||
<FastField name={'active'}>
|
<FastField name={'active'} type={'checkbox'}>
|
||||||
{({ field, field: { value } }) => (
|
{({ form, field, field: { value } }) => (
|
||||||
<FormGroup inline={true} className={'form-group--active'}>
|
<FormGroup inline={true} className={'form-group--active'}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
inline={true}
|
inline={true}
|
||||||
label={<T id={'active'} />}
|
label={<T id={'active'} />}
|
||||||
defaultChecked={value}
|
checked={value}
|
||||||
{...field}
|
onChange={() => form.setFieldValue('active', !value)}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user