From bf1cc3562d3f2c3885ddc55386f50292a8c1178f Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Fri, 19 May 2023 11:29:09 +0100 Subject: [PATCH 01/15] fix: change all 'two factor' to 'two-factor' in translation --- src/languages/en.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index 77d5d229a326..dacfd756bd44 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -26,7 +26,7 @@ export default { zoom: 'Zoom', password: 'Password', magicCode: 'Magic code', - twoFactorCode: 'Two factor code', + twoFactorCode: 'Two-factor code', workspaces: 'Workspaces', profile: 'Profile', payments: 'Payments', @@ -186,7 +186,7 @@ export default { requestNewCode: 'You can also', requestNewCodeLink: 'request a new code here', successfulNewCodeRequest: 'Code requested. Please check your device.', - tfaRequiredTitle: 'Two factor authentication\nrequired', + tfaRequiredTitle: 'Two-factor authentication\nrequired', tfaRequiredDescription: 'Please enter the two-factor authentication code\nwhere you are trying to sign in.', }, moneyRequestConfirmationList: { @@ -514,7 +514,7 @@ export default { stepCodes: 'Recovery codes', keepCodesSafe: 'Keep these recovery codes safe!', codesLoseAccess: - 'If you lose access to your authenticator app and don’t have these codes, you will lose access to your account. \n\nNote: Setting up two factor authentication will log you out of all other active sessions.', + 'If you lose access to your authenticator app and don’t have these codes, you will lose access to your account. \n\nNote: Setting up two-factor authentication will log you out of all other active sessions.', stepVerify: 'Verify', scanCode: 'Scan the QR code using your', authenticatorApp: 'authenticator app', @@ -529,8 +529,8 @@ export default { }, twoFactorAuthForm: { error: { - pleaseFillTwoFactorAuth: 'Please enter your two factor code', - incorrect2fa: 'Incorrect two factor authentication code. Please try again.', + pleaseFillTwoFactorAuth: 'Please enter your two-factor code', + incorrect2fa: 'Incorrect two-factor authentication code. Please try again.', }, }, passwordConfirmationScreen: { @@ -667,20 +667,20 @@ export default { error: { pleaseFillMagicCode: 'Please enter your magic code', incorrectMagicCode: 'Incorrect magic code.', - pleaseFillTwoFactorAuth: 'Please enter your two factor code', + pleaseFillTwoFactorAuth: 'Please enter your two-factor code', }, }, passwordForm: { pleaseFillOutAllFields: 'Please fill out all fields', pleaseFillPassword: 'Please enter your password', - pleaseFillTwoFactorAuth: 'Please enter your two factor code', - enterYourTwoFactorAuthenticationCodeToContinue: 'Enter your two factor authentication code to continue', + pleaseFillTwoFactorAuth: 'Please enter your two-factor code', + enterYourTwoFactorAuthenticationCodeToContinue: 'Enter your two-factor authentication code to continue', forgot: 'Forgot?', requiredWhen2FAEnabled: 'Required when 2FA is enabled', error: { incorrectPassword: 'Incorrect password. Please try again.', incorrectLoginOrPassword: 'Incorrect login or password. Please try again.', - incorrect2fa: 'Incorrect two factor authentication code. Please try again.', + incorrect2fa: 'Incorrect two-factor authentication code. Please try again.', twoFactorAuthenticationEnabled: 'You have 2FA enabled on this account. Please sign in using your email or phone number.', invalidLoginOrPassword: 'Invalid login or password. Please try again or reset your password.', unableToResetPassword: From 9a8ec1158a7b347a2ee5a2e15a1ae52cef402435 Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Fri, 19 May 2023 11:30:06 +0100 Subject: [PATCH 02/15] fix: make two-factor consistent in code comments as well --- src/pages/ReimbursementAccount/ValidationStep.js | 2 +- src/pages/signin/PasswordForm.js | 2 +- .../signin/ValidateCodeForm/BaseValidateCodeForm.js | 2 +- tests/unit/ValidationUtilsTest.js | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/ReimbursementAccount/ValidationStep.js b/src/pages/ReimbursementAccount/ValidationStep.js index ab8010f1b347..7b2a5b0d6df1 100644 --- a/src/pages/ReimbursementAccount/ValidationStep.js +++ b/src/pages/ReimbursementAccount/ValidationStep.js @@ -41,7 +41,7 @@ const propTypes = { /** User's account who is setting up bank account */ account: PropTypes.shape({ - /** If user has Two factor authentication enabled */ + /** If user has two-factor authentication enabled */ requiresTwoFactorAuth: PropTypes.bool, }), }; diff --git a/src/pages/signin/PasswordForm.js b/src/pages/signin/PasswordForm.js index 6bbe1d9585ad..07d988d172af 100755 --- a/src/pages/signin/PasswordForm.js +++ b/src/pages/signin/PasswordForm.js @@ -29,7 +29,7 @@ const propTypes = { /** The details about the account that the user is signing in with */ account: PropTypes.shape({ - /** Whether or not two factor authentication is required */ + /** Whether or not two-factor authentication is required */ requiresTwoFactorAuth: PropTypes.bool, /** Whether or not a sign on form is loading (being submitted) */ diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js index 04fbe20cca61..952de8d265bf 100755 --- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js +++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js @@ -31,7 +31,7 @@ const propTypes = { /** The details about the account that the user is signing in with */ account: PropTypes.shape({ - /** Whether or not two factor authentication is required */ + /** Whether or not two-factor authentication is required */ requiresTwoFactorAuth: PropTypes.bool, /** Whether or not a sign on form is loading (being submitted) */ diff --git a/tests/unit/ValidationUtilsTest.js b/tests/unit/ValidationUtilsTest.js index e2d7b13f3364..48ad9f20b028 100644 --- a/tests/unit/ValidationUtilsTest.js +++ b/tests/unit/ValidationUtilsTest.js @@ -2,23 +2,23 @@ const ValidationUtils = require('../../src/libs/ValidationUtils'); describe('ValidationUtils', () => { describe('isValidTwoFactorCode', () => { - test('numeric two factor code', () => { + test('numeric two-factor code', () => { expect(ValidationUtils.isValidTwoFactorCode('123456')).toBe(true); }); - test('numeric two factor code with leading zeroes', () => { + test('numeric two-factor code with leading zeroes', () => { expect(ValidationUtils.isValidTwoFactorCode('000001')).toBe(true); }); - test('alphanumeric two factor code', () => { + test('alphanumeric two-factor code', () => { expect(ValidationUtils.isValidTwoFactorCode('abc123')).toBe(false); }); - test('special characters two factor code', () => { + test('special characters two-factor code', () => { expect(ValidationUtils.isValidTwoFactorCode('!@#$%^')).toBe(false); }); - test('partial special characters two factor code', () => { + test('partial special characters two-factor code', () => { expect(ValidationUtils.isValidTwoFactorCode('123$%^')).toBe(false); }); }); From 6a3ec6677fd187223b12c30507a37fe8ddd275a1 Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Fri, 19 May 2023 11:32:50 +0100 Subject: [PATCH 03/15] fix: use download translation in CodesPage --- src/pages/settings/Security/TwoFactorAuth/CodesPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Security/TwoFactorAuth/CodesPage.js b/src/pages/settings/Security/TwoFactorAuth/CodesPage.js index 915d2534fa0d..827b09d733a8 100644 --- a/src/pages/settings/Security/TwoFactorAuth/CodesPage.js +++ b/src/pages/settings/Security/TwoFactorAuth/CodesPage.js @@ -102,7 +102,7 @@ function CodesPage(props) { style={styles.twoFactorAuthCodesButton} />