Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ function AccountHolderDetails({onNext, isEditing, corpayFields}: BankInfoSubStep
);
}

const InputComponent = getInputComponent(field);
return (
<View
style={styles.mb6}
key={field.id}
>
<InputWrapper
InputComponent={getInputComponent(field)}
InputComponent={InputComponent}
inputID={field.id}
label={field.label}
aria-label={field.label}
Expand All @@ -139,6 +140,8 @@ function AccountHolderDetails({onNext, isEditing, corpayFields}: BankInfoSubStep
}}
hint={field.id === ACCOUNT_HOLDER_NAME ? translate('bankInfoStep.accountHolderNameDescription') : undefined}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
autoCorrect={InputComponent === TextInput ? false : undefined}
spellCheck={InputComponent === TextInput ? false : undefined}
/>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ function BankAccountDetails({onNext, isEditing, corpayFields}: BankInfoSubStepPr
return getInputForValueSet(field, SafeString(defaultValues[field.id as keyof typeof defaultValues]), isEditing, styles);
}

const InputComponent = getInputComponent(field);
return (
<View
style={styles.mb6}
key={field.id}
>
<InputWrapper
InputComponent={getInputComponent(field)}
InputComponent={InputComponent}
inputID={field.id}
label={field.label}
aria-label={field.label}
Expand All @@ -106,6 +107,8 @@ function BankAccountDetails({onNext, isEditing, corpayFields}: BankInfoSubStepPr
country: '',
}}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
autoCorrect={InputComponent === TextInput ? false : undefined}
spellCheck={InputComponent === TextInput ? false : undefined}
/>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,41 @@ function AccountHolderInformation({isEditing, onNext, formValues, fieldsMap}: Cu
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb6]}>{translate('addPersonalBankAccount.accountHolderInformationStepHeader')}</Text>
{Object.values(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS] ?? {})
.sort((a, b) => CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_FIELDS.indexOf(a.id) - CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_FIELDS.indexOf(b.id))
.map((field, index) => (
<View
style={getStyle(field, index)}
key={field.id}
>
<InputWrapper
InputComponent={getInputComponent(field)}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
description={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? field.label : undefined}
items={getItems(field)}
shouldAllowChange={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined}
optionsList={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? CONST.ALL_COUNTRIES : undefined}
value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? formValues.bankCountry : undefined}
shouldSaveDraft={!isEditing}
renamedInputKeys={{
street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderAddress1) ? '' : 'accountHolderAddress1',
street2: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderAddress2) ? '' : 'accountHolderAddress2',
city: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderCity) ? '' : 'accountHolderCity',
state: '',
zipCode: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderPostal) ? '' : 'accountHolderPostal',
country: '',
lat: '',
lng: '',
}}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
/>
</View>
))}
.map((field, index) => {
const InputComponent = getInputComponent(field);
return (
<View
style={getStyle(field, index)}
key={field.id}
>
<InputWrapper
InputComponent={InputComponent}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
description={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? field.label : undefined}
items={getItems(field)}
shouldAllowChange={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined}
optionsList={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? CONST.ALL_COUNTRIES : undefined}
value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? formValues.bankCountry : undefined}
shouldSaveDraft={!isEditing}
renamedInputKeys={{
street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderAddress1) ? '' : 'accountHolderAddress1',
street2: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderAddress2) ? '' : 'accountHolderAddress2',
city: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderCity) ? '' : 'accountHolderCity',
state: '',
zipCode: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_HOLDER_DETAILS]?.accountHolderPostal) ? '' : 'accountHolderPostal',
country: '',
lat: '',
lng: '',
}}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
autoCorrect={InputComponent === TextInput ? false : undefined}
spellCheck={InputComponent === TextInput ? false : undefined}
/>
</View>
);
})}
</View>
</FormProvider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,27 @@ function BankAccountDetails({isEditing, onNext, onMove, formValues, fieldsMap}:
shouldShowFullPageOfflineView
/>
</View>
{Object.values(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_DETAILS] ?? {}).map((field) => (
<View
style={(field.valueSet ?? []).length > 0 ? [styles.mhn5, styles.pv1] : [styles.pv2]}
key={field.id}
>
<InputWrapper
InputComponent={(field.valueSet ?? []).length > 0 ? ValuePicker : TextInput}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
items={(field.valueSet ?? []).map(({id, text}) => ({value: id, label: text}))}
shouldSaveDraft={!isEditing}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
/>
</View>
))}
{Object.values(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.ACCOUNT_DETAILS] ?? {}).map((field) => {
const isValuePicker = (field.valueSet ?? []).length > 0;
return (
<View
style={isValuePicker ? [styles.mhn5, styles.pv1] : [styles.pv2]}
key={field.id}
>
<InputWrapper
InputComponent={isValuePicker ? ValuePicker : TextInput}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
items={(field.valueSet ?? []).map(({id, text}) => ({value: id, label: text}))}
shouldSaveDraft={!isEditing}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
autoCorrect={!isValuePicker ? false : undefined}
spellCheck={!isValuePicker ? false : undefined}
/>
</View>
);
})}
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt4]}>
<Icon
src={icons.QuestionMark}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,37 @@ function BankInformation({isEditing, onNext, formValues, fieldsMap}: CustomSubPa
<Text style={[styles.textHeadlineLineHeightXXL, styles.mb6]}>{translate('addPersonalBankAccount.bankInformationStepHeader')}</Text>
{Object.values(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION] ?? {})
.sort((a, b) => CONST.CORPAY_FIELDS.BANK_INFORMATION_FIELDS.indexOf(a.id) - CONST.CORPAY_FIELDS.BANK_INFORMATION_FIELDS.indexOf(b.id))
.map((field, index) => (
<View
style={getStyle(field, index)}
key={field.id}
>
<InputWrapper
InputComponent={getInputComponent(field)}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
items={getItems(field)}
shouldSaveDraft={!isEditing}
renamedInputKeys={{
street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankAddressLine1) ? '' : 'bankAddressLine1',
street2: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankAddressLine2) ? '' : 'bankAddressLine2',
city: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankCity) ? '' : 'bankCity',
state: '',
zipCode: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankPostal) ? '' : 'bankPostal',
country: '',
lat: '',
lng: '',
}}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
/>
</View>
))}
.map((field, index) => {
const InputComponent = getInputComponent(field);
return (
<View
style={getStyle(field, index)}
key={field.id}
>
<InputWrapper
InputComponent={InputComponent}
inputID={field.id}
defaultValue={formValues[field.id]}
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
items={getItems(field)}
shouldSaveDraft={!isEditing}
renamedInputKeys={{
street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankAddressLine1) ? '' : 'bankAddressLine1',
street2: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankAddressLine2) ? '' : 'bankAddressLine2',
city: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankCity) ? '' : 'bankCity',
state: '',
zipCode: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.PAGE_NAME.BANK_INFORMATION]?.bankPostal) ? '' : 'bankPostal',
country: '',
lat: '',
lng: '',
}}
forwardedFSClass={CONST.FULLSTORY.CLASS.MASK}
autoCorrect={InputComponent === TextInput ? false : undefined}
spellCheck={InputComponent === TextInput ? false : undefined}
/>
</View>
);
})}
</View>
</FormProvider>
);
Expand Down
Loading