Skip to content

Commit

Permalink
Merge pull request #15294 from tienifr/fix/14972-The-Terms-of-Service…
Browse files Browse the repository at this point in the history
…-checkbox-does-not-respond-properly-while-navigating-the-connect-bank-account-flow

Fix/14972 the terms of service checkbox does not respond properly while navigating the connect bank account flow
  • Loading branch information
NikkiWines authored Feb 22, 2023
2 parents 1b0b16f + fe2b320 commit dad522f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
genericErrorMessage: 'Oops... something went wrong and your request could not be completed. Please try again later.',
error: {
invalidAmount: 'Invalid amount',
acceptedTerms: 'You must accept the Terms of Service to continue',
acceptTerms: 'You must accept the Terms of Service to continue',
phoneNumber: `Please enter a valid phone number, with the country code (e.g. ${CONST.EXAMPLE_PHONE_NUMBER})`,
fieldRequired: 'This field is required.',
characterLimit: ({limit}) => `Exceeds the maximum length of ${limit} characters`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
genericErrorMessage: 'Ups... algo no ha ido bien y la acción no se pudo completar. Por favor inténtalo más tarde.',
error: {
invalidAmount: 'Monto no válido',
acceptedTerms: 'Debes aceptar los Términos de servicio para continuar',
acceptTerms: 'Debes aceptar los Términos de servicio para continuar',
phoneNumber: `Ingresa un teléfono válido, incluyendo el código de país (p. ej. ${CONST.EXAMPLE_PHONE_NUMBER})`,
fieldRequired: 'Este campo es obligatorio.',
characterLimit: ({limit}) => `Supera el límite de ${limit} caracteres`,
Expand Down
3 changes: 1 addition & 2 deletions src/libs/ReimbursementAccountUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import lodashGet from 'lodash/get';
* @returns {*}
*/
function getDefaultStateForField(reimbursementAccountDraft, reimbursementAccount, fieldName, defaultValue = '') {
return lodashGet(reimbursementAccountDraft, fieldName)
|| lodashGet(reimbursementAccount, ['achData', fieldName], defaultValue);
return lodashGet(reimbursementAccountDraft, fieldName, lodashGet(reimbursementAccount, ['achData', fieldName], defaultValue));
}

export {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EnablePayments/TermsStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TermsStep extends React.Component {
}

render() {
const errorMessage = this.state.error ? this.props.translate('common.error.acceptedTerms') : (ErrorUtils.getLatestErrorMessage(this.props.walletTerms) || '');
const errorMessage = this.state.error ? this.props.translate('common.error.acceptTerms') : (ErrorUtils.getLatestErrorMessage(this.props.walletTerms) || '');
return (
<>
<HeaderWithCloseButton
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/ACHContractStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ACHContractStep extends React.Component {
}

if (!ValidationUtils.isRequiredFulfilled(values.acceptTermsAndConditions)) {
errors.acceptTermsAndConditions = this.props.translate('common.error.acceptedTerms');
errors.acceptTermsAndConditions = this.props.translate('common.error.acceptTerms');
}

if (!ValidationUtils.isRequiredFulfilled(values.certifyTrueInformation)) {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ReimbursementAccount/BankAccountManualStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class BankAccountManualStep extends React.Component {
if (!routingNumber || !CONST.BANK_ACCOUNT.REGEX.SWIFT_BIC.test(routingNumber) || !ValidationUtils.isValidRoutingNumber(routingNumber)) {
errorFields.routingNumber = this.props.translate('bankAccount.error.routingNumber');
}
if (!values.acceptedTerms) {
errorFields.acceptedTerms = this.props.translate('common.error.acceptedTerms');
if (!values.acceptTerms) {
errorFields.acceptTerms = this.props.translate('common.error.acceptTerms');
}

return errorFields;
Expand Down Expand Up @@ -113,7 +113,7 @@ class BankAccountManualStep extends React.Component {
/>
<CheckboxWithLabel
style={styles.mt4}
inputID="acceptedTerms"
inputID="acceptTerms"
LabelComponent={() => (
<Text>
{this.props.translate('common.iAcceptThe')}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/settings/Payments/AddDebitCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class DebitCardPage extends Component {
errors.password = this.props.translate('addDebitCardPage.error.password');
}

if (!values.acceptedTerms) {
errors.acceptedTerms = this.props.translate('common.error.acceptedTerms');
if (!values.acceptTerms) {
errors.acceptTerms = this.props.translate('common.error.acceptTerms');
}

return errors;
Expand Down Expand Up @@ -186,7 +186,7 @@ class DebitCardPage extends Component {
/>
</View>
<CheckboxWithLabel
inputID="acceptedTerms"
inputID="acceptTerms"
LabelComponent={() => (
<Text>
{`${this.props.translate('common.iAcceptThe')}`}
Expand Down

0 comments on commit dad522f

Please sign in to comment.