feat(TEAMMSBMOB-19904): инпут ввода номера счета
This commit is contained in:
Regular → Executable
Regular → Executable
@@ -4,6 +4,7 @@ enum EXTERNAL_ACCOUNTS_FORM_FIELDS {
|
||||
CURRENCY = 'currency',
|
||||
CLIENT_SWIFT_CODE = 'clientSwiftCode',
|
||||
BANK_SWIFT_CODE = 'bankSwiftCode',
|
||||
ACCOUNT = 'account',
|
||||
}
|
||||
|
||||
enum EXTERNAL_ACCOUNT_FORM_CURRENCY_TYPES {
|
||||
|
||||
@@ -15,6 +15,7 @@ const LOCALIZATION = {
|
||||
DEFAULT_USAGE_COLUMN_TITLE: 'По умолчанию',
|
||||
ACCOUNT_USAGE_ERROR: 'Выберите хотя бы один вариант',
|
||||
EMPTY_FIELD_ERROR: 'Поле не заполнено',
|
||||
ACCOUNT_LABEL: 'Номер счёта',
|
||||
} as const;
|
||||
|
||||
export { LOCALIZATION };
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Fields } from '@fractal-ui/form';
|
||||
import { useField } from 'react-final-form';
|
||||
import { EXTERNAL_ACCOUNTS_FORM_FIELDS, LOCALIZATION } from '../constants';
|
||||
|
||||
const AccountInput = () => {
|
||||
const { input: clientIdFieldInput } = useField(EXTERNAL_ACCOUNTS_FORM_FIELDS.CLIENT_ID, { subscription: { value: true } });
|
||||
|
||||
if (!clientIdFieldInput.value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Fields.InputAccount label={LOCALIZATION.ACCOUNT_LABEL} labelPosition="top" name={EXTERNAL_ACCOUNTS_FORM_FIELDS.ACCOUNT} />;
|
||||
};
|
||||
|
||||
export { AccountInput };
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
import { Flex } from '@msb/shared';
|
||||
import { Form } from 'react-final-form';
|
||||
import { useHandleSubmit, useInitialValues, validate } from '../model';
|
||||
import { AccountInput } from './AccountInput';
|
||||
import { CommonFormFields } from './CommonFormFields';
|
||||
import { CurrencyExternalFields } from './CurrencyExternalFields';
|
||||
import { ExternalAccountsCreateFormProvider } from './ExternalAccountsCreateFormProvider';
|
||||
@@ -27,6 +28,7 @@ const ExternalAccountsCreateForm = () => {
|
||||
<CommonFormFields organizationsSelectOptions={organizationsSelectOptions} />
|
||||
<RubExternalFields />
|
||||
<CurrencyExternalFields />
|
||||
<AccountInput />
|
||||
<AccountsCreateFormSubmitButton />
|
||||
</Flex>
|
||||
</ExternalAccountsCreateFormProvider>
|
||||
|
||||
Reference in New Issue
Block a user