diff --git a/packages/webapp/src/containers/CashFlow/MoneyInDialog/OtherIncome/OtherIncomeFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyInDialog/OtherIncome/OtherIncomeFormFields.tsx index 2fb11a057..9f76aaaaf 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyInDialog/OtherIncome/OtherIncomeFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyInDialog/OtherIncome/OtherIncomeFormFields.tsx @@ -25,7 +25,6 @@ import { FTextArea, FMoneyInputGroup, } from '@/components'; -import { DateInput } from '@blueprintjs/datetime'; import { CLASSES, ACCOUNT_TYPE, Features } from '@/constants'; import { @@ -73,29 +72,22 @@ export default function OtherIncomeFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + > + , + }} + /> + @@ -134,10 +126,7 @@ export default function OtherIncomeFormFields() { diff --git a/packages/webapp/src/containers/CashFlow/MoneyInDialog/OwnerContribution/OwnerContributionFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyInDialog/OwnerContribution/OwnerContributionFormFields.tsx index 6514039f3..8c6d29358 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyInDialog/OwnerContribution/OwnerContributionFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyInDialog/OwnerContribution/OwnerContributionFormFields.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { FastField, ErrorMessage } from 'formik'; import { Position, ControlGroup } from '@blueprintjs/core'; import classNames from 'classnames'; -import { DateInput } from '@blueprintjs/datetime'; import { FormattedMessage as T, FAccountsSuggestField, @@ -14,11 +13,11 @@ import { BranchSelect, BranchSelectButton, FeatureCan, - FFormGroup, FMoneyInputGroup, FTextArea, FInputGroup, + FDateInput, } from '@/components'; import { ACCOUNT_TYPE, CLASSES, Features } from '@/constants'; import { @@ -69,29 +68,25 @@ export default function OwnerContributionFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + > + , + }} + /> + {/*------------ Transaction number -----------*/} diff --git a/packages/webapp/src/containers/CashFlow/MoneyInDialog/TransferFromAccount/TransferFromAccountFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyInDialog/TransferFromAccount/TransferFromAccountFormFields.tsx index ed49d476d..2a659a19a 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyInDialog/TransferFromAccount/TransferFromAccountFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyInDialog/TransferFromAccount/TransferFromAccountFormFields.tsx @@ -1,7 +1,5 @@ // @ts-nocheck import React from 'react'; -import { FastField, ErrorMessage } from 'formik'; -import { DateInput } from '@blueprintjs/datetime'; import { FormGroup, Position, ControlGroup } from '@blueprintjs/core'; import classNames from 'classnames'; import { @@ -17,16 +15,13 @@ import { FMoneyInputGroup, FFormGroup, FTextArea, + FDateInput, + FInputGroup, } from '@/components'; import { MoneyInOutTransactionNoField } from '../../_components'; import { MoneyInExchangeRateField } from '../MoneyInExchangeRateField'; import { CLASSES, ACCOUNT_TYPE, Features } from '@/constants'; -import { - inputIntent, - momentFormatter, - tansformDateValue, - handleDateChange, -} from '@/utils'; +import { momentFormatter } from '@/utils'; import { useMoneyInDailogContext } from '../MoneyInDialogProvider'; import { useMoneyInFieldsContext } from '../MoneyInFieldsProvider'; import { @@ -66,29 +61,21 @@ export default function TransferFromAccountFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + > + + {/*------------ Transaction number -----------*/} diff --git a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OtherExpense/OtherExpnseFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OtherExpense/OtherExpnseFormFields.tsx index e526ab221..56d8d719b 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OtherExpense/OtherExpnseFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OtherExpense/OtherExpnseFormFields.tsx @@ -1,6 +1,5 @@ // @ts-nocheck import React from 'react'; -import { FastField, ErrorMessage } from 'formik'; import { FormGroup, Position, ControlGroup } from '@blueprintjs/core'; import classNames from 'classnames'; import { @@ -17,15 +16,10 @@ import { FFormGroup, FInputGroup, FMoneyInputGroup, + FDateInput, } from '@/components'; -import { DateInput } from '@blueprintjs/datetime'; import { Features, ACCOUNT_TYPE } from '@/constants'; -import { - inputIntent, - momentFormatter, - tansformDateValue, - handleDateChange, -} from '@/utils'; +import { momentFormatter } from '@/utils'; import { CLASSES } from '@/constants/classes'; import { useMoneyOutDialogContext } from '../MoneyOutDialogProvider'; import { useSetPrimaryBranchToForm, BranchRowDivider } from '../utils'; @@ -65,29 +59,23 @@ export default function OtherExpnseFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + fastField + > + + {/*------------ Transaction number -----------*/} diff --git a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OwnerDrawings/OwnerDrawingsFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OwnerDrawings/OwnerDrawingsFormFields.tsx index 99b6e870c..5c7a73c4d 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OwnerDrawings/OwnerDrawingsFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/OwnerDrawings/OwnerDrawingsFormFields.tsx @@ -1,7 +1,5 @@ // @ts-nocheck import React from 'react'; -import { FastField, ErrorMessage } from 'formik'; -import { DateInput } from '@blueprintjs/datetime'; import { FormGroup, Position, ControlGroup } from '@blueprintjs/core'; import classNames from 'classnames'; import { @@ -18,14 +16,10 @@ import { FTextArea, FInputGroup, FMoneyInputGroup, + FDateInput, } from '@/components'; import { CLASSES, Features, ACCOUNT_TYPE } from '@/constants'; -import { - inputIntent, - momentFormatter, - tansformDateValue, - handleDateChange, -} from '@/utils'; +import { momentFormatter } from '@/utils'; import { useMoneyOutDialogContext } from '../MoneyOutDialogProvider'; import { useSetPrimaryBranchToForm, @@ -67,29 +61,21 @@ export default function OwnerDrawingsFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + > + + {/*------------ Transaction number -----------*/} diff --git a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/TransferToAccount/TransferToAccountFormFields.tsx b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/TransferToAccount/TransferToAccountFormFields.tsx index c3a9e332f..2856341f7 100644 --- a/packages/webapp/src/containers/CashFlow/MoneyOutDialog/TransferToAccount/TransferToAccountFormFields.tsx +++ b/packages/webapp/src/containers/CashFlow/MoneyOutDialog/TransferToAccount/TransferToAccountFormFields.tsx @@ -1,6 +1,6 @@ // @ts-nocheck import React from 'react'; -import { FastField, ErrorMessage } from 'formik'; +import { ErrorMessage } from 'formik'; import { FormGroup, Position, ControlGroup } from '@blueprintjs/core'; import classNames from 'classnames'; import { @@ -17,14 +17,12 @@ import { FTextArea, FMoneyInputGroup, FInputGroup, + FDateInput, } from '@/components'; -import { DateInput } from '@blueprintjs/datetime'; import { ACCOUNT_TYPE } from '@/constants/accountTypes'; import { inputIntent, momentFormatter, - tansformDateValue, - handleDateChange, } from '@/utils'; import { Features } from '@/constants'; import { CLASSES } from '@/constants/classes'; @@ -66,31 +64,23 @@ export default function TransferToAccountFormFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - intent={inputIntent({ error, touched })} - helperText={} - minimal={true} - className={classNames(CLASSES.FILL, 'form-group--date')} - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - /> - - )} - + } + labelInfo={} + fill + fastField + > + + diff --git a/packages/webapp/src/containers/Dialogs/InventoryAdjustmentFormDialog/InventoryAdjustmentFormDialogFields.tsx b/packages/webapp/src/containers/Dialogs/InventoryAdjustmentFormDialog/InventoryAdjustmentFormDialogFields.tsx index 09d432762..0d054efee 100644 --- a/packages/webapp/src/containers/Dialogs/InventoryAdjustmentFormDialog/InventoryAdjustmentFormDialogFields.tsx +++ b/packages/webapp/src/containers/Dialogs/InventoryAdjustmentFormDialog/InventoryAdjustmentFormDialogFields.tsx @@ -4,15 +4,14 @@ import intl from 'react-intl-universal'; import styled from 'styled-components'; import classNames from 'classnames'; import { FastField, ErrorMessage, Field } from 'formik'; +import { Classes, FormGroup, Position } from '@blueprintjs/core'; import { - Classes, - FormGroup, - InputGroup, - TextArea, - Position, -} from '@blueprintjs/core'; -import { FFormGroup, FormattedMessage as T } from '@/components'; -import { DateInput } from '@blueprintjs/datetime'; + FFormGroup, + FormattedMessage as T, + FDateInput, + FInputGroup, + FTextArea, +} from '@/components'; import { useAutofocus } from '@/hooks'; import { ListSelect, @@ -25,13 +24,7 @@ import { BranchSelectButton, FAccountsSuggestField, } from '@/components'; -import { - inputIntent, - momentFormatter, - tansformDateValue, - handleDateChange, - toSafeNumber, -} from '@/utils'; +import { inputIntent, momentFormatter, toSafeNumber } from '@/utils'; import { Features, CLASSES } from '@/constants'; import { useInventoryAdjContext } from './InventoryAdjustmentFormProvider'; @@ -107,30 +100,24 @@ export default function InventoryAdjustmentFormDialogFields() { {/*------------ Date -----------*/} - - {({ form, field: { value }, meta: { error, touched } }) => ( - } - labelInfo={} - fill - > - { - form.setFieldValue('date', formattedDate); - })} - value={tansformDateValue(value)} - popoverProps={{ - position: Position.BOTTOM, - minimal: true, - }} - intent={inputIntent({ error, touched })} - inputRef={(ref) => (dateFieldRef.current = ref)} - /> - - )} - + } + labelInfo={} + fill + fastField + > + (dateFieldRef.current = ref)} + fastField + /> + @@ -190,38 +177,23 @@ export default function InventoryAdjustmentFormDialogFields() { {/*------------ Reference -----------*/} - - {({ form, field, meta: { error, touched } }) => ( - } - intent={inputIntent({ error, touched })} - helperText={} - className={'form-group--reference-no'} - > - - - )} - + } + fastField + > + + {/*------------ Adjustment reasons -----------*/} - - {({ field, meta: { error, touched } }) => ( - } - labelInfo={} - className={'form-group--adjustment-reasons'} - intent={inputIntent({ error, touched })} - helperText={} - > -