From afcc7cc9d2be402eff4df3a5be0a5474de497343 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:15:27 -0500 Subject: [PATCH 1/8] copy changes for enterMagicCode --- src/languages/en.ts | 9 ++++----- src/languages/es.ts | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 7f05ea436837..b3eeb57eedb5 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1116,7 +1116,7 @@ const translations = { helpTextAfterEmail: ' from multiple email addresses.', pleaseVerify: 'Please verify this contact method', getInTouch: "Whenever we need to get in touch with you, we'll use this contact method.", - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod}`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod}. It should arrive within a minute or two.`, setAsDefault: 'Set as default', yourDefaultContactMethod: "This is your current default contact method. Before you can delete it, you'll need to choose another contact method and click “Set as default”.", removeContactMethod: 'Remove contact method', @@ -1132,8 +1132,7 @@ const translations = { passwordRequired: 'password required.', contactMethodRequired: 'Contact method is required.', invalidContactMethod: 'Invalid contact method', - }, - newContactMethod: 'New contact method', +z newContactMethod: 'New contact method', goBackContactMethods: 'Go back to contact methods', }, pronouns: { @@ -1455,7 +1454,7 @@ const translations = { }, cardDetailsLoadingFailure: 'An error occurred while loading the card details. Please check your internet connection and try again.', validateCardTitle: "Let's make sure it's you", - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to view your card details`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to view your card details. It should arrive within a minute or two.`, }, workflowsPage: { workflowTitle: 'Spend', @@ -5179,7 +5178,7 @@ const translations = { removeCopilotConfirmation: 'Are you sure you want to remove this copilot?', changeAccessLevel: 'Change access level', makeSureItIsYou: "Let's make sure it's you", - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to add a copilot.`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to add a copilot. It should arrive within a minute or two.`, enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to update your copilot.`, notAllowed: 'Not so fast...', notAllowedMessageStart: ({accountOwnerEmail}: AccountOwnerParams) => `You don't have permission to take this action for ${accountOwnerEmail} as a`, diff --git a/src/languages/es.ts b/src/languages/es.ts index 92ffd8728d97..bc6144ca7eab 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1113,7 +1113,7 @@ const translations = { helpTextAfterEmail: ' desde varias direcciones de correo electrónico.', pleaseVerify: 'Por favor, verifica este método de contacto', getInTouch: 'Utilizaremos este método de contacto cuando necesitemos contactarte.', - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod}`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod}. Debería llegar en un par de minutos.`, setAsDefault: 'Establecer como predeterminado', yourDefaultContactMethod: 'Este es tu método de contacto predeterminado. Antes de poder eliminarlo, tendrás que elegir otro método de contacto y haz clic en "Establecer como predeterminado".', @@ -1454,7 +1454,7 @@ const translations = { }, cardDetailsLoadingFailure: 'Se ha producido un error al cargar los datos de la tarjeta. Comprueba tu conexión a Internet e inténtalo de nuevo.', validateCardTitle: 'Asegurémonos de que eres tú', - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Introduzca el código mágico enviado a ${contactMethod} para ver los datos de su tarjeta`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Introduzca el código mágico enviado a ${contactMethod} para ver los datos de su tarjeta. Debería llegar en un par de minutos.`, }, workflowsPage: { workflowTitle: 'Gasto', @@ -5695,7 +5695,7 @@ const translations = { removeCopilotConfirmation: '¿Estás seguro de que quieres eliminar este copiloto?', changeAccessLevel: 'Cambiar nivel de acceso', makeSureItIsYou: 'Vamos a asegurarnos de que eres tú', - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod} para agregar un copiloto.`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod} para agregar un copiloto. Debería llegar en un par de minutos.`, enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod} para actualizar el nivel de acceso de tu copiloto.`, notAllowed: 'No tan rápido...', From 326bff52446b8b3b4b045d627aeccf6de289e235 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:16:08 -0500 Subject: [PATCH 2/8] add primary and optional secondary description for validateCode modal --- src/components/ValidateCodeActionModal/index.tsx | 8 ++++++-- src/components/ValidateCodeActionModal/type.ts | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/ValidateCodeActionModal/index.tsx b/src/components/ValidateCodeActionModal/index.tsx index 461c780a50d0..c9079da6c776 100644 --- a/src/components/ValidateCodeActionModal/index.tsx +++ b/src/components/ValidateCodeActionModal/index.tsx @@ -12,11 +12,13 @@ import ONYXKEYS from '@src/ONYXKEYS'; import type {ValidateCodeActionModalProps} from './type'; import ValidateCodeForm from './ValidateCodeForm'; import type {ValidateCodeFormHandle} from './ValidateCodeForm/BaseValidateCodeForm'; +import useLocalize from '@hooks/useLocalize'; function ValidateCodeActionModal({ isVisible, title, - description, + descriptionPrimary, + descriptionSecondary, onClose, onModalHide, validatePendingAction, @@ -29,6 +31,7 @@ function ValidateCodeActionModal({ }: ValidateCodeActionModalProps) { const themeStyles = useThemeStyles(); const safePaddingBottomStyle = useSafePaddingBottomStyle(); + const {translate} = useLocalize(); const firstRenderRef = useRef(true); const validateCodeFormRef = useRef(null); @@ -70,7 +73,8 @@ function ValidateCodeActionModal({ /> - {description} + {descriptionPrimary} + {!!descriptionSecondary && ({descriptionSecondary})} void; From 8bb3ee915b3c527e3b0e3cb3f89e9a464509949d Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:16:45 -0500 Subject: [PATCH 3/8] add secondary description where feature is gated behind validation --- src/pages/ReimbursementAccount/BankAccountStep.tsx | 3 ++- src/pages/settings/Security/TwoFactorAuth/Steps/CodesStep.tsx | 3 ++- src/pages/settings/Wallet/VerifyAccountPage.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/ReimbursementAccount/BankAccountStep.tsx b/src/pages/ReimbursementAccount/BankAccountStep.tsx index f6fab3056cf2..afa2c10bc68e 100644 --- a/src/pages/ReimbursementAccount/BankAccountStep.tsx +++ b/src/pages/ReimbursementAccount/BankAccountStep.tsx @@ -227,7 +227,8 @@ function BankAccountStep({ setIsValidateCodeActionModalVisible(false)} clearError={clearError} /> From f7d7ae7921e60709deffb2ef833d1e99ffd2fde1 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:17:18 -0500 Subject: [PATCH 4/8] update other instances of ValidateCodeActionModal to pass a descriptionPrimary --- .../settings/Profile/Contacts/ContactMethodDetailsPage.tsx | 2 +- src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx | 2 +- .../settings/Security/AddDelegate/DelegateMagicCodeModal.tsx | 2 +- src/pages/settings/Wallet/ExpensifyCardPage.tsx | 2 +- src/pages/settings/Wallet/ReportCardLostPage.tsx | 5 ++--- src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index 24325e15beca..4eaaec665df2 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -269,7 +269,7 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { setIsValidateCodeActionModalVisible(false); }} sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)} - description={translate('contacts.enterMagicCode', {contactMethod})} + descriptionPrimary={translate('contacts.enterMagicCode', {contactMethod})} /> {!isValidateCodeActionModalVisible && getMenuItems()} diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx index c2a7e1b6712c..9d6f167fc04e 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx @@ -171,7 +171,7 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) { hasMagicCodeBeenSent={!!loginData?.validateCodeSent} title={translate('delegate.makeSureItIsYou')} sendValidateCode={() => User.requestValidateCodeAction()} - description={translate('contacts.enterMagicCode', {contactMethod})} + descriptionPrimary={translate('contacts.enterMagicCode', {contactMethod})} /> diff --git a/src/pages/settings/Security/AddDelegate/DelegateMagicCodeModal.tsx b/src/pages/settings/Security/AddDelegate/DelegateMagicCodeModal.tsx index e466b862ae9a..6c108403c36b 100644 --- a/src/pages/settings/Security/AddDelegate/DelegateMagicCodeModal.tsx +++ b/src/pages/settings/Security/AddDelegate/DelegateMagicCodeModal.tsx @@ -56,7 +56,7 @@ function DelegateMagicCodeModal({login, role, onClose, isValidateCodeActionModal sendValidateCode={() => User.requestValidateCodeAction()} hasMagicCodeBeenSent={!!currentDelegate?.validateCodeSent} handleSubmitForm={(validateCode) => Delegate.addDelegate(login, role, validateCode)} - description={translate('delegate.enterMagicCode', {contactMethod: account?.primaryLogin ?? ''})} + descriptionPrimary={translate('delegate.enterMagicCode', {contactMethod: account?.primaryLogin ?? ''})} /> ); } diff --git a/src/pages/settings/Wallet/ExpensifyCardPage.tsx b/src/pages/settings/Wallet/ExpensifyCardPage.tsx index d5e7b595ce55..c1e0f8d6d4b4 100644 --- a/src/pages/settings/Wallet/ExpensifyCardPage.tsx +++ b/src/pages/settings/Wallet/ExpensifyCardPage.tsx @@ -307,7 +307,7 @@ function ExpensifyCardPage({ isVisible={isValidateCodeActionModalVisible} hasMagicCodeBeenSent={!!loginData?.validateCodeSent} title={translate('cardPage.validateCardTitle')} - description={translate('cardPage.enterMagicCode', {contactMethod: account?.primaryLogin ?? ''})} + descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})} /> )} diff --git a/src/pages/settings/Wallet/ReportCardLostPage.tsx b/src/pages/settings/Wallet/ReportCardLostPage.tsx index ec74ea400a13..8e5ef65b82ae 100644 --- a/src/pages/settings/Wallet/ReportCardLostPage.tsx +++ b/src/pages/settings/Wallet/ReportCardLostPage.tsx @@ -81,6 +81,7 @@ function ReportCardLostPage({ const {paddingBottom} = useStyledSafeAreaInsets(); const formattedAddress = PersonalDetailsUtils.getFormattedAddress(privatePersonalDetails ?? {}); + const primaryLogin = account?.primaryLogin ?? ''; useEffect(() => { if (!isEmptyObject(physicalCard?.errors) || !(prevIsLoading && !formData?.isLoading)) { @@ -132,8 +133,6 @@ function ReportCardLostPage({ }; const sendValidateCode = () => { - const primaryLogin = account?.primaryLogin ?? ''; - if (loginList?.[primaryLogin]?.validateCodeSent) { return; } @@ -201,7 +200,7 @@ function ReportCardLostPage({ onClose={() => setIsValidateCodeActionModalVisible(false)} isVisible={isValidateCodeActionModalVisible} title={translate('cardPage.validateCardTitle')} - description={translate('cardPage.enterMagicCode', {contactMethod: account?.primaryLogin ?? ''})} + descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})} /> ) : ( diff --git a/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx b/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx index b1673a8bd51c..4c031ab382e7 100644 --- a/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx +++ b/src/pages/settings/Wallet/ReportVirtualCardFraudPage.tsx @@ -108,7 +108,7 @@ function ReportVirtualCardFraudPage({ onClose={() => setIsValidateCodeActionModalVisible(false)} isVisible={isValidateCodeActionModalVisible} title={translate('cardPage.validateCardTitle')} - description={translate('cardPage.enterMagicCode', {contactMethod: account?.primaryLogin ?? ''})} + descriptionPrimary={translate('cardPage.enterMagicCode', {contactMethod: primaryLogin})} hasMagicCodeBeenSent={!!loginData?.validateCodeSent} /> From adc7ea51acdf8ce5ae084c216f45ace314a666ed Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:18:05 -0500 Subject: [PATCH 5/8] style --- src/components/ValidateCodeActionModal/index.tsx | 4 ++-- src/languages/es.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/ValidateCodeActionModal/index.tsx b/src/components/ValidateCodeActionModal/index.tsx index c9079da6c776..192f5950a367 100644 --- a/src/components/ValidateCodeActionModal/index.tsx +++ b/src/components/ValidateCodeActionModal/index.tsx @@ -5,6 +5,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Modal from '@components/Modal'; import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; import useSafePaddingBottomStyle from '@hooks/useSafePaddingBottomStyle'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST'; @@ -12,7 +13,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import type {ValidateCodeActionModalProps} from './type'; import ValidateCodeForm from './ValidateCodeForm'; import type {ValidateCodeFormHandle} from './ValidateCodeForm/BaseValidateCodeForm'; -import useLocalize from '@hooks/useLocalize'; function ValidateCodeActionModal({ isVisible, @@ -74,7 +74,7 @@ function ValidateCodeActionModal({ {descriptionPrimary} - {!!descriptionSecondary && ({descriptionSecondary})} + {!!descriptionSecondary && {descriptionSecondary}} `Introduzca el código mágico enviado a ${contactMethod} para ver los datos de su tarjeta. Debería llegar en un par de minutos.`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => + `Introduzca el código mágico enviado a ${contactMethod} para ver los datos de su tarjeta. Debería llegar en un par de minutos.`, }, workflowsPage: { workflowTitle: 'Gasto', @@ -5695,7 +5696,8 @@ const translations = { removeCopilotConfirmation: '¿Estás seguro de que quieres eliminar este copiloto?', changeAccessLevel: 'Cambiar nivel de acceso', makeSureItIsYou: 'Vamos a asegurarnos de que eres tú', - enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod} para agregar un copiloto. Debería llegar en un par de minutos.`, + enterMagicCode: ({contactMethod}: EnterMagicCodeParams) => + `Por favor, introduce el código mágico enviado a ${contactMethod} para agregar un copiloto. Debería llegar en un par de minutos.`, enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Por favor, introduce el código mágico enviado a ${contactMethod} para actualizar el nivel de acceso de tu copiloto.`, notAllowed: 'No tan rápido...', From b8a95def7e5df05149c6a20252d0e3250ef3d2e2 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:34:46 -0500 Subject: [PATCH 6/8] fix typo --- src/languages/en.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b3eeb57eedb5..6bf6188c8cfa 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1132,7 +1132,8 @@ const translations = { passwordRequired: 'password required.', contactMethodRequired: 'Contact method is required.', invalidContactMethod: 'Invalid contact method', -z newContactMethod: 'New contact method', + }, + newContactMethod: 'New contact method', goBackContactMethods: 'Go back to contact methods', }, pronouns: { From 18c591e3b37ad7904f91a31a95ebe8a4c22eef06 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 21:38:45 -0500 Subject: [PATCH 7/8] remove unused var --- src/components/ValidateCodeActionModal/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ValidateCodeActionModal/index.tsx b/src/components/ValidateCodeActionModal/index.tsx index 192f5950a367..083a4457402e 100644 --- a/src/components/ValidateCodeActionModal/index.tsx +++ b/src/components/ValidateCodeActionModal/index.tsx @@ -31,7 +31,6 @@ function ValidateCodeActionModal({ }: ValidateCodeActionModalProps) { const themeStyles = useThemeStyles(); const safePaddingBottomStyle = useSafePaddingBottomStyle(); - const {translate} = useLocalize(); const firstRenderRef = useRef(true); const validateCodeFormRef = useRef(null); From b8ac6eb1140fa81423b2ba1c44d619196c23cdb7 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Tue, 12 Nov 2024 23:47:34 -0500 Subject: [PATCH 8/8] remove unused import --- src/components/ValidateCodeActionModal/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ValidateCodeActionModal/index.tsx b/src/components/ValidateCodeActionModal/index.tsx index 083a4457402e..5cb9bfe9f96f 100644 --- a/src/components/ValidateCodeActionModal/index.tsx +++ b/src/components/ValidateCodeActionModal/index.tsx @@ -5,7 +5,6 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Modal from '@components/Modal'; import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; -import useLocalize from '@hooks/useLocalize'; import useSafePaddingBottomStyle from '@hooks/useSafePaddingBottomStyle'; import useThemeStyles from '@hooks/useThemeStyles'; import CONST from '@src/CONST';