Skip to content

Commit 6062195

Browse files
authored
Merge pull request #57647 from shubham1206agra/hide-fix-alert
Hide fix form alert for single form input
2 parents 73e3884 + c90760f commit 6062195

File tree

97 files changed

+327
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+327
-295
lines changed

src/components/AddPaymentCard/PaymentCardChangeCurrencyForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function PaymentCardChangeCurrencyForm({changeBillingCurrency, isSecurityCodeReq
8484
submitButtonText={translate('common.save')}
8585
scrollContextEnabled
8686
style={[styles.mh5, styles.flexGrow1]}
87+
shouldHideFixErrorsAlert
8788
>
8889
<PaymentCardCurrencyHeader />
8990
<>

src/components/SubStepForms/DateOfBirthStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function DateOfBirthStep<TFormID extends keyof OnyxFormValuesMapping>({
8484
style={[styles.mh5, styles.flexGrow2, styles.justifyContentBetween]}
8585
submitButtonStyles={[styles.mb0]}
8686
enabledWhenOffline
87+
shouldHideFixErrorsAlert
8788
>
8889
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb5]}>{formTitle}</Text>
8990
<InputWrapper

src/components/SubStepForms/SingleFieldStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function SingleFieldStep<TFormID extends keyof OnyxFormValuesMapping>({
9090
style={[styles.mh5, styles.flexGrow1]}
9191
submitButtonStyles={[styles.mb0]}
9292
enabledWhenOffline={enabledWhenOffline}
93+
shouldHideFixErrorsAlert
9394
>
9495
<View>
9596
<Text style={[styles.textHeadlineLineHeightXXL]}>{formTitle}</Text>

src/components/SubStepForms/YesNoStep.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function YesNoStep({title, description, defaultValue, onSelectedValue, submitBut
5959
style={[styles.mh5, styles.flexGrow1]}
6060
submitButtonStyles={submitButtonStyles}
6161
isLoading={isLoading}
62+
shouldHideFixErrorsAlert
6263
>
6364
<Text style={[styles.textHeadlineLineHeightXXL]}>{title}</Text>
6465
<Text style={[styles.pv3, styles.textSupporting]}>{description}</Text>

src/components/TextPicker/TextSelectorModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function TextSelectorModal({
123123
submitButtonText={translate('common.save')}
124124
style={[styles.mh5, styles.flex1]}
125125
enabledWhenOffline
126+
shouldHideFixErrorsAlert
126127
>
127128
<View style={styles.pb4}>{!!subtitle && <Text style={[styles.sidebarLinkText, styles.optionAlternateText]}>{subtitle}</Text>}</View>
128129
<InputWrapper

src/pages/AddPersonalBankAccountPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ function AddPersonalBankAccountPage() {
111111
onSubmit={submitBankAccountForm}
112112
validate={validatePlaidSelection}
113113
style={[styles.mh5, styles.flex1]}
114+
shouldHideFixErrorsAlert
114115
>
115116
<InputWrapper
116117
inputID={INPUT_IDS.BANK_INFO_STEP.SELECTED_PLAID_ACCOUNT_ID}

src/pages/EditReportFieldDate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function EditReportFieldDatePage({fieldName, isRequired, onSubmit, fieldValue, f
5151
validate={validate}
5252
submitButtonText={translate('common.save')}
5353
enabledWhenOffline
54+
shouldHideFixErrorsAlert
5455
>
5556
<View style={styles.mb4}>
5657
<InputWrapper

src/pages/EditReportFieldText.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function EditReportFieldTextPage({fieldName, onSubmit, fieldValue, isRequired, f
5151
validate={validate}
5252
submitButtonText={translate('common.save')}
5353
enabledWhenOffline
54+
shouldHideFixErrorsAlert
5455
>
5556
<View style={styles.mb4}>
5657
<InputWrapper
Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
import {useIsFocused} from '@react-navigation/native';
22
import React, {useCallback, useEffect} from 'react';
3-
import type {OnyxEntry} from 'react-native-onyx';
4-
import {withOnyx} from 'react-native-onyx';
3+
import {useOnyx} from 'react-native-onyx';
54
import AddPlaidBankAccount from '@components/AddPlaidBankAccount';
65
import FormProvider from '@components/Form/FormProvider';
76
import InputWrapper from '@components/Form/InputWrapper';
87
import useLocalize from '@hooks/useLocalize';
98
import type {SubStepProps} from '@hooks/useSubStep/types';
109
import useThemeStyles from '@hooks/useThemeStyles';
11-
import * as BankAccounts from '@userActions/BankAccounts';
10+
import {clearPersonalBankAccountSetupType, updateAddPersonalBankAccountDraft, validatePlaidSelection} from '@userActions/BankAccounts';
1211
import ONYXKEYS from '@src/ONYXKEYS';
13-
import type {PersonalBankAccountForm} from '@src/types/form';
1412
import INPUT_IDS from '@src/types/form/PersonalBankAccountForm';
15-
import type {PlaidData} from '@src/types/onyx';
16-
17-
type PlaidOnyxProps = {
18-
/** The draft values of the bank account being setup */
19-
personalBankAccountDraft: OnyxEntry<PersonalBankAccountForm>;
20-
21-
/** Contains plaid data */
22-
plaidData: OnyxEntry<PlaidData>;
23-
};
24-
25-
type PlaidStepProps = PlaidOnyxProps & SubStepProps;
2613

2714
const BANK_INFO_STEP_KEYS = INPUT_IDS.BANK_INFO_STEP;
2815

29-
function PlaidStep({personalBankAccountDraft, onNext, plaidData}: PlaidStepProps) {
16+
function PlaidStep({onNext}: SubStepProps) {
3017
const {translate} = useLocalize();
3118
const styles = useThemeStyles();
3219
const isFocused = useIsFocused();
20+
const [personalBankAccountDraft] = useOnyx(ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT_FORM_DRAFT);
21+
const [plaidData] = useOnyx(ONYXKEYS.PLAID_DATA);
3322
const selectedPlaidAccountID = personalBankAccountDraft?.[BANK_INFO_STEP_KEYS.PLAID_ACCOUNT_ID] ?? '';
3423

3524
const handleNextPress = useCallback(() => {
@@ -47,38 +36,39 @@ function PlaidStep({personalBankAccountDraft, onNext, plaidData}: PlaidStepProps
4736
[BANK_INFO_STEP_KEYS.PLAID_ACCESS_TOKEN]: plaidData?.[BANK_INFO_STEP_KEYS.PLAID_ACCESS_TOKEN] ?? '',
4837
};
4938

50-
BankAccounts.updateAddPersonalBankAccountDraft(bankAccountData);
39+
updateAddPersonalBankAccountDraft(bankAccountData);
5140
onNext();
5241
}, [onNext, personalBankAccountDraft, plaidData]);
5342

5443
const handleSelectPlaidAccount = (plaidAccountID: string) => {
55-
BankAccounts.updateAddPersonalBankAccountDraft({plaidAccountID});
44+
updateAddPersonalBankAccountDraft({plaidAccountID});
5645
};
5746

5847
useEffect(() => {
5948
const plaidBankAccounts = plaidData?.bankAccounts ?? [];
6049
if (isFocused || plaidBankAccounts.length) {
6150
return;
6251
}
63-
BankAccounts.clearPersonalBankAccountSetupType();
52+
clearPersonalBankAccountSetupType();
6453
}, [isFocused, plaidData]);
6554

6655
return (
6756
<FormProvider
6857
formID={ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT_FORM}
69-
validate={BankAccounts.validatePlaidSelection}
58+
validate={validatePlaidSelection}
7059
onSubmit={handleNextPress}
7160
scrollContextEnabled
7261
submitButtonText={translate('common.next')}
7362
style={[styles.mh5, styles.flexGrow1]}
7463
isSubmitButtonVisible={(plaidData?.bankAccounts ?? []).length > 0}
64+
shouldHideFixErrorsAlert
7565
>
7666
<InputWrapper
7767
InputComponent={AddPlaidBankAccount}
7868
text={translate('walletPage.chooseAccountBody')}
7969
onSelect={handleSelectPlaidAccount}
8070
plaidData={plaidData}
81-
onExitPlaid={BankAccounts.clearPersonalBankAccountSetupType}
71+
onExitPlaid={clearPersonalBankAccountSetupType}
8272
allowDebit
8373
isDisplayedInWalletFlow
8474
selectedPlaidAccountID={selectedPlaidAccountID}
@@ -91,11 +81,4 @@ function PlaidStep({personalBankAccountDraft, onNext, plaidData}: PlaidStepProps
9181

9282
PlaidStep.displayName = 'PlaidStep';
9383

94-
export default withOnyx<PlaidStepProps, PlaidOnyxProps>({
95-
personalBankAccountDraft: {
96-
key: ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT_FORM_DRAFT,
97-
},
98-
plaidData: {
99-
key: ONYXKEYS.PLAID_DATA,
100-
},
101-
})(PlaidStep);
84+
export default PlaidStep;

src/pages/GroupChatNameEditPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function GroupChatNameEditPage({report}: GroupChatNameEditPageProps) {
9191
validate={validate}
9292
style={[styles.mh5, styles.flex1]}
9393
enabledWhenOffline
94+
shouldHideFixErrorsAlert
9495
>
9596
<InputWrapper
9697
InputComponent={TextInput}

src/pages/PrivateNotes/PrivateNotesEditPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function PrivateNotesEditPage({route, report, accountID}: PrivateNotesEditPagePr
135135
style={[styles.flexGrow1, styles.ph5]}
136136
submitButtonText={translate('common.save')}
137137
enabledWhenOffline
138+
shouldHideFixErrorsAlert
138139
>
139140
<Text style={[styles.mb5]}>
140141
{translate(

src/pages/ReimbursementAccount/NonUSD/BankInfo/subSteps/AccountHolderDetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function AccountHolderDetails({onNext, isEditing, corpayFields}: BankInfoSubStep
125125
validate={validate}
126126
onSubmit={handleSubmit}
127127
style={[styles.mh5, styles.flexGrow1]}
128+
shouldHideFixErrorsAlert={(accountHolderDetailsFields?.length ?? 0) <= 1}
128129
>
129130
<View>
130131
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb6]}>{translate('bankInfoStep.whatAreYour')}</Text>

src/pages/ReimbursementAccount/NonUSD/BankInfo/subSteps/BankAccountDetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function BankAccountDetails({onNext, isEditing, corpayFields}: BankInfoSubStepPr
103103
validate={validate}
104104
style={[styles.mh5, styles.flexGrow1]}
105105
isSubmitDisabled={!inputs}
106+
shouldHideFixErrorsAlert={(bankAccountDetailsFields?.length ?? 0) <= 1}
106107
>
107108
<>
108109
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb6]}>{translate('bankInfoStep.whatAreYour')}</Text>

src/pages/ReimbursementAccount/NonUSD/BeneficialOwnerInfo/BeneficialOwnerDetailsFormSubSteps/Documents.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ function Documents({onNext, isEditing, ownerBeingModifiedID}: DocumentsProps) {
8787
shouldSaveDraft: isEditing,
8888
});
8989

90+
const testForShouldHideFixErrorsAlert =
91+
[
92+
isDocumentNeededStatus.isProofOfOwnershipNeeded,
93+
isDocumentNeededStatus.isCopyOfIDNeeded,
94+
isDocumentNeededStatus.isProofOfAddressNeeded,
95+
isDocumentNeededStatus.isCodiceFiscaleNeeded,
96+
].filter(Boolean).length <= 1;
97+
9098
return (
9199
<FormProvider
92100
formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM}
@@ -95,6 +103,7 @@ function Documents({onNext, isEditing, ownerBeingModifiedID}: DocumentsProps) {
95103
onSubmit={handleSubmit}
96104
style={[styles.mh5, styles.flexGrow1]}
97105
submitButtonStyles={[styles.mb0]}
106+
shouldHideFixErrorsAlert={testForShouldHideFixErrorsAlert}
98107
>
99108
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb5]}>{translate('ownershipInfoStep.uploadDocuments')}</Text>
100109
<Text style={[styles.textSupporting, styles.mb5]}>{translate('ownershipInfoStep.pleaseUpload')}</Text>

src/pages/ReimbursementAccount/NonUSD/BusinessInfo/subSteps/AverageReimbursement.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function AverageReimbursement({onNext, isEditing}: AverageReimbursementProps) {
5858
validate={validate}
5959
style={[styles.flexGrow1]}
6060
submitButtonStyles={[styles.mh5]}
61+
shouldHideFixErrorsAlert
6162
>
6263
<Text style={[styles.textHeadlineLineHeightXXL, styles.mh5, styles.mb3]}>{translate('businessInfoStep.whatsYourExpectedAverageReimbursements')}</Text>
6364
<InputWrapper

src/pages/ReimbursementAccount/NonUSD/BusinessInfo/subSteps/IncorporationLocation.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ function IncorporationLocation({onNext, isEditing}: IncorporationLocationProps)
8787
validate={validate}
8888
style={[styles.flexGrow1]}
8989
submitButtonStyles={[styles.mh5]}
90+
shouldHideFixErrorsAlert={!shouldGatherState}
9091
>
9192
<Text style={[styles.textHeadlineLineHeightXXL, styles.mh5, styles.mb3]}>{translate('businessInfoStep.whereWasTheBusinessIncorporated')}</Text>
9293
{shouldGatherState && (

src/pages/ReimbursementAccount/NonUSD/BusinessInfo/subSteps/PaymentVolume.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function PaymentVolume({onNext, isEditing}: PaymentVolumeProps) {
5858
validate={validate}
5959
style={[styles.flexGrow1]}
6060
submitButtonStyles={[styles.mh5]}
61+
shouldHideFixErrorsAlert
6162
>
6263
<Text style={[styles.textHeadlineLineHeightXXL, styles.mh5, styles.mb3]}>{translate('businessInfoStep.whatsTheBusinessAnnualPayment')}</Text>
6364
<InputWrapper

src/pages/ReimbursementAccount/NonUSD/BusinessInfo/subSteps/RegistrationNumber.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function RegistrationNumber({onNext, isEditing}: RegistrationNumberProps) {
6060
onSubmit={handleSubmit}
6161
validate={validate}
6262
style={[styles.mh5, styles.flexGrow1]}
63+
shouldHideFixErrorsAlert
6364
>
6465
<Text style={[styles.textHeadlineLineHeightXXL]}>{translate('businessInfoStep.whatsTheBusinessRegistrationNumber')}</Text>
6566
<InputWrapper

src/pages/ReimbursementAccount/NonUSD/Country/subSteps/Confirmation.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function Confirmation({onNext, policyID}: ConfirmationStepProps) {
8282
style={[styles.flexGrow1]}
8383
submitButtonStyles={[styles.mh5, styles.pb0]}
8484
isSubmitDisabled={disableSubmit}
85+
shouldHideFixErrorsAlert
8586
>
8687
<Text style={[styles.textHeadlineLineHeightXXL, styles.ph5, styles.mb3]}>{translate('countryStep.confirmBusinessBank')}</Text>
8788
<MenuItemWithTopDescription

src/pages/ReimbursementAccount/NonUSD/SignerInfo/EnterEmail.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
77
import Text from '@components/Text';
88
import TextInput from '@components/TextInput';
99
import useLocalize from '@hooks/useLocalize';
10+
import usePolicy from '@hooks/usePolicy';
1011
import useThemeStyles from '@hooks/useThemeStyles';
1112
import {getFieldRequiredErrors} from '@libs/ValidationUtils';
1213
import CONST from '@src/CONST';
@@ -29,7 +30,7 @@ function EnterEmail({onSubmit, isUserDirector}: EnterEmailProps) {
2930

3031
const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
3132
const policyID = reimbursementAccount?.achData?.policyID;
32-
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
33+
const policy = usePolicy(policyID);
3334
const currency = policy?.outputCurrency ?? '';
3435
const shouldGatherBothEmails = currency === CONST.CURRENCY.AUD && !isUserDirector;
3536

@@ -56,6 +57,7 @@ function EnterEmail({onSubmit, isUserDirector}: EnterEmailProps) {
5657
onSubmit={onSubmit}
5758
validate={validate}
5859
style={[styles.mh5, styles.flexGrow1]}
60+
shouldHideFixErrorsAlert={!shouldGatherBothEmails}
5961
>
6062
<Text style={[styles.textHeadlineLineHeightXXL]}>{translate(shouldGatherBothEmails ? 'signerInfoStep.enterTwoEmails' : 'signerInfoStep.enterOneEmail')}</Text>
6163
{!shouldGatherBothEmails && <Text style={[styles.pv3, styles.textSupporting]}>{translate('signerInfoStep.regulationRequiresOneMoreDirector')}</Text>}

src/pages/ReimbursementAccount/USD/BankInfo/subSteps/Plaid.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {SubStepProps} from '@hooks/useSubStep/types';
99
import useThemeStyles from '@hooks/useThemeStyles';
1010
import {setBankAccountSubStep, validatePlaidSelection} from '@userActions/BankAccounts';
1111
import {updateReimbursementAccountDraft} from '@userActions/ReimbursementAccount';
12+
import CONST from '@src/CONST';
1213
import ONYXKEYS from '@src/ONYXKEYS';
1314
import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';
1415

@@ -47,7 +48,7 @@ function Plaid({onNext, setUSDBankAccountStep}: PlaidProps) {
4748
onNext(bankAccountData);
4849
}, [plaidData, reimbursementAccountDraft, onNext]);
4950

50-
const bankAccountID = Number(reimbursementAccount?.achData?.bankAccountID ?? '-1');
51+
const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? CONST.DEFAULT_NUMBER_ID;
5152

5253
useEffect(() => {
5354
const plaidBankAccounts = plaidData?.bankAccounts ?? [];
@@ -72,6 +73,7 @@ function Plaid({onNext, setUSDBankAccountStep}: PlaidProps) {
7273
submitButtonText={translate('common.next')}
7374
style={[styles.mh5, styles.flexGrow1]}
7475
isSubmitButtonVisible={(plaidData?.bankAccounts ?? []).length > 0}
76+
shouldHideFixErrorsAlert
7577
>
7678
<InputWrapper
7779
InputComponent={AddPlaidBankAccount}

src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/ConfirmationBusiness.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import TextLink from '@components/TextLink';
1212
import useLocalize from '@hooks/useLocalize';
1313
import type {SubStepProps} from '@hooks/useSubStep/types';
1414
import useThemeStyles from '@hooks/useThemeStyles';
15-
import * as ValidationUtils from '@libs/ValidationUtils';
15+
import {getFieldRequiredErrors} from '@libs/ValidationUtils';
1616
import getSubStepValues from '@pages/ReimbursementAccount/utils/getSubStepValues';
1717
import CONST from '@src/CONST';
1818
import type {TranslationPaths} from '@src/languages/types';
@@ -44,7 +44,7 @@ function ConfirmationBusiness({onNext, onMove}: SubStepProps) {
4444

4545
const validate = useCallback(
4646
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => {
47-
const errors = ValidationUtils.getFieldRequiredErrors(values, [BUSINESS_INFO_STEP_KEYS.HAS_NO_CONNECTION_TO_CANNABIS]);
47+
const errors = getFieldRequiredErrors(values, [BUSINESS_INFO_STEP_KEYS.HAS_NO_CONNECTION_TO_CANNABIS]);
4848

4949
if (!values.hasNoConnectionToCannabis) {
5050
errors.hasNoConnectionToCannabis = translate('bankAccount.error.restrictedBusiness');
@@ -136,6 +136,7 @@ function ConfirmationBusiness({onNext, onMove}: SubStepProps) {
136136
submitButtonText={translate('common.confirm')}
137137
style={[styles.mh5, styles.flexGrow1]}
138138
enabledWhenOffline={false}
139+
shouldHideFixErrorsAlert
139140
>
140141
<InputWrapper
141142
InputComponent={CheckboxWithLabel}

src/pages/ReimbursementAccount/USD/BusinessInfo/subSteps/IncorporationDateBusiness.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import useLocalize from '@hooks/useLocalize';
99
import useReimbursementAccountStepFormSubmit from '@hooks/useReimbursementAccountStepFormSubmit';
1010
import type {SubStepProps} from '@hooks/useSubStep/types';
1111
import useThemeStyles from '@hooks/useThemeStyles';
12-
import * as ValidationUtils from '@libs/ValidationUtils';
12+
import {getFieldRequiredErrors, isValidDate, isValidPastDate} from '@libs/ValidationUtils';
1313
import ONYXKEYS from '@src/ONYXKEYS';
1414
import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';
1515

@@ -25,11 +25,11 @@ function IncorporationDateBusiness({onNext, isEditing}: SubStepProps) {
2525

2626
const validate = useCallback(
2727
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => {
28-
const errors = ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);
28+
const errors = getFieldRequiredErrors(values, STEP_FIELDS);
2929

30-
if (values.incorporationDate && !ValidationUtils.isValidDate(values.incorporationDate)) {
30+
if (values.incorporationDate && !isValidDate(values.incorporationDate)) {
3131
errors.incorporationDate = translate('common.error.dateInvalid');
32-
} else if (values.incorporationDate && !ValidationUtils.isValidPastDate(values.incorporationDate)) {
32+
} else if (values.incorporationDate && !isValidPastDate(values.incorporationDate)) {
3333
errors.incorporationDate = translate('bankAccount.error.incorporationDateFuture');
3434
}
3535

@@ -54,6 +54,7 @@ function IncorporationDateBusiness({onNext, isEditing}: SubStepProps) {
5454
onSubmit={handleSubmit}
5555
style={[styles.mh5, styles.flexGrow1]}
5656
submitButtonStyles={[styles.mb0]}
57+
shouldHideFixErrorsAlert
5758
>
5859
<Text style={[styles.textHeadlineLineHeightXXL]}>{translate('businessInfoStep.selectYourCompanysIncorporationDate')}</Text>
5960
<InputWrapper

0 commit comments

Comments
 (0)