Skip to content
Closed
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
4 changes: 4 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,10 @@ const CONST = {
CORPAY: 'CORPAY',
},
WISE: {
/** Wise's legal pages, linked from the terms page of the onboarding */
TERMS_URL: 'https://wise.com/terms-and-conditions',
PRIVACY_URL: 'https://wise.com/privacy-policy',

/** Server-derived state of the Wise onboarding */
ONBOARDING_STATUS: {
IN_REVIEW: 'IN_REVIEW',
Expand Down
9 changes: 9 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ const DYNAMIC_ROUTES = {
entryScreens: [SCREENS.SETTINGS.WALLET.ROOT, SCREENS.WORKSPACE.WORKFLOWS],
getRoute: (bankAccountID: number | undefined) => `global-reimbursements/${bankAccountID}` as const,
},
WISE_BUSINESS_ONBOARDING: {
path: 'business-onboarding/:subPage?/:action?',
entryScreens: [SCREENS.SETTINGS.WALLET.DYNAMIC_WISE_GLOBAL_REIMBURSEMENTS_INTRO],
getRoute: (subPage?: string, action?: 'edit') => `business-onboarding${subPage ? `/${subPage}` : ''}${subPage && action ? `/${action}` : ''}` as const,
},
WISE_ACCEPT_TERMS: {
path: 'accept-terms',
entryScreens: [SCREENS.SETTINGS.WALLET.DYNAMIC_WISE_BUSINESS_ONBOARDING],
},
BANK_ACCOUNT_VERIFY_ACCOUNT: {
path: 'verify-bank-account',
entryScreens: [SCREENS.REIMBURSEMENT_ACCOUNT],
Expand Down
2 changes: 2 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ const SCREENS = {
SHARE_BANK_ACCOUNT: 'Settings_Wallet_Share_Bank_Account',
EDIT_BANK_ACCOUNT_NICKNAME: 'Settings_Wallet_Edit_Bank_Account_Nickname',
DYNAMIC_WISE_GLOBAL_REIMBURSEMENTS_INTRO: 'Dynamic_Settings_Wallet_Wise_Global_Reimbursements_Intro',
DYNAMIC_WISE_BUSINESS_ONBOARDING: 'Dynamic_Settings_Wallet_Wise_Business_Onboarding',
DYNAMIC_WISE_ACCEPT_TERMS: 'Dynamic_Settings_Wallet_Wise_Accept_Terms',
TRAVEL_CVV: 'Settings_Wallet_Travel_CVV',
TRAVEL_CVV_VERIFY_ACCOUNT: 'Settings_Wallet_Travel_CVV_VerifyAccount',
PERSONAL_CARD_DETAILS: 'Settings_Wallet_Personal_Card_Details',
Expand Down
18 changes: 17 additions & 1 deletion src/components/DynamicForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ActivityIndicator from '@components/ActivityIndicator';

import useAndroidBackButtonHandler from '@hooks/useAndroidBackButtonHandler';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSubPage from '@hooks/useSubPage';
Expand All @@ -13,6 +14,7 @@ import {clearSensitiveAnswers, forgetSensitiveAnswers, saveDraftAnswers, saveSen
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {DynamicFormListField, DynamicFormListItem, DynamicFormPage} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

import {Str} from 'expensify-common';
Expand Down Expand Up @@ -154,6 +156,14 @@ function DynamicFormFlow({
clearSensitiveAnswers(formID);
}, [isRedirecting, formID]);

// A visit that opens without a page waits for the earlier visit's sensitive answers to be gone, so no input starts from them. The flow can be left without
// its own Back, such as by a swipe back, which leaves them in memory.
const hasSensitiveAnswers = !isEmptyObject(sensitiveAnswersByForm?.[formID]);
const [isClearingEarlierVisit, setIsClearingEarlierVisit] = useState(isRedirecting);
if (isClearingEarlierVisit && !hasSensitiveAnswers) {
setIsClearingEarlierVisit(false);
}

// A submission that finishes without an error drops the sensitive answers
const wasSubmittingRef = useRef(false);
useEffect(() => {
Expand Down Expand Up @@ -292,6 +302,12 @@ function DynamicFormFlow({
prevPage();
};

// A flow on replaced routes has no page stack for Android's back to pop, so it takes the header's steps
useAndroidBackButtonHandler(() => {
goBack();
return true;
});

// An entry editor highlights its list's step, and the confirmation page the last one
const stepPage = shownPages.find((page) => page.key === currentPageName) ?? (listItemPage && findListPage(listItemPage.listKey));
// The indicator draws no names and keys its steps by them, so the unique page keys stand in for titles an untitled page does not have
Expand All @@ -314,7 +330,7 @@ function DynamicFormFlow({
stepIndex={stepIndex}
shouldShowStepIndicator={isStepIndicatorAsked && stepNames.length > 1}
>
{isDraftLoading || isRedirecting || isOnUnavailablePage || (!hasPageToShow && pages.length > 0) ? (
{isDraftLoading || isRedirecting || isClearingEarlierVisit || isOnUnavailablePage || (!hasPageToShow && pages.length > 0) ? (
<View style={[styles.flex1, styles.fullScreenLoading]}>
<ActivityIndicator size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} />
</View>
Expand Down
3 changes: 3 additions & 0 deletions src/components/DynamicForm/renderers/textRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import TextInput from '@components/TextInput';

import getTextInputAutocorrectProps from '@libs/getTextInputAutocorrectProps';

import variables from '@styles/variables';

import CONST from '@src/CONST';
import type {DynamicFormNumberField, DynamicFormTextField} from '@src/types/onyx';

Expand Down Expand Up @@ -61,6 +63,7 @@ function renderTextInput(
inputMode={inputMode}
multiline={isMultiline}
autoGrowHeight={isMultiline}
maxAutoGrowHeight={isMultiline ? variables.textInputAutoGrowMaxHeight : undefined}
{...(isMultiline ? {} : getTextInputAutocorrectProps())}
/>
),
Expand Down
3 changes: 3 additions & 0 deletions src/components/DynamicForm/utils/formatDynamicFieldValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function formatDynamicFieldValue(field: DynamicFormField, values: DynamicFormVal
return `${answer}%`;
case 'address':
return formatAddress(field.key, values, translate);
case 'text':
// A row shows one line, so a multiline answer is joined into it, which also gives a cut answer its ellipsis
return field.multiline ? answer.replaceAll(/\s*\r?\n\s*/g, ' ').trim() : answer;
default:
return answer;
}
Expand Down
33 changes: 33 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,39 @@ const translations: TranslationDeepObject<typeof en> = {
accountRequiresAttention: 'Dieses Konto erfordert Ihre Aufmerksamkeit',
unlock: 'Entsperren',
},
wiseOnboarding: {
confirmationTitle: 'Lassen Sie uns prüfen, ob alles stimmt',
representative: {
title: 'Wir benötigen einige Angaben von Ihnen',
description: 'Wir sind verpflichtet, diese Informationen zur Zahlungsabwicklung zu erheben.',
legalFirstName: 'Rechtlicher Vorname',
legalLastName: 'Rechtlicher Nachname',
ssn: 'Sozialversicherungsnummer oder ITIN',
idDocument: 'Identitätsprüfung',
idDocumentDescription: 'Bitte laden Sie einen amtlichen Ausweis hoch.',
},
business: {
title: 'Geben Sie Ihre Unternehmensdaten ein',
legalName: 'Rechtlicher Firmenname',
companyRole: 'Ihre Rolle im Unternehmen',
companyRoleOwner: 'Eigentümer',
companyRoleDirector: 'Geschäftsführer',
companyRoleOther: 'Sonstiges',
industryCategories: 'Branchenkategorie',
description: 'Unternehmensbeschreibung',
descriptionHint: 'Beschreiben Sie kurz, was Ihr Unternehmen macht.',
},
terms: {
title: 'Bedingungen akzeptieren',
subtitle: 'Bitte akzeptieren Sie die folgenden Bedingungen.',
certify: 'Ich bestätige, dass meine Angaben wahr und korrekt sind.',
expensifyTerms: `Ich stimme den <a href="${CONST.OLD_DOT_PUBLIC_URLS.TERMS_URL}">Allgemeinen Geschäftsbedingungen</a> und der <a href="${CONST.OLD_DOT_PUBLIC_URLS.PRIVACY_URL}">Datenschutzerklärung</a> von Expensify zu.`,
expensifyTermsAccessibilityLabel: 'Ich stimme den Allgemeinen Geschäftsbedingungen und der Datenschutzerklärung von Expensify zu.',
wiseTerms: `Ich stimme den <a href="${CONST.WISE.TERMS_URL}">Allgemeinen Geschäftsbedingungen</a> und der <a href="${CONST.WISE.PRIVACY_URL}">Datenschutzerklärung</a> von Wise zu.`,
wiseTermsAccessibilityLabel: 'Ich stimme den Allgemeinen Geschäftsbedingungen und der Datenschutzerklärung von Wise zu.',
error: 'Bitte akzeptieren Sie alle Bedingungen, um fortzufahren.',
},
},
wiseGlobalReimbursementsIntro: {
title: 'Globale Rückerstattungen einrichten?',
subtitle: 'Zahlen Sie Mitglieder weltweit in ihrer lokalen Währung.',
Expand Down
33 changes: 33 additions & 0 deletions src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,39 @@ const translations: TranslationDeepObject<typeof en> = {
accountRequiresAttention: 'Αυτός ο λογαριασμός χρειάζεται προσοχή',
unlock: 'Ξεκλείδωμα',
},
wiseOnboarding: {
confirmationTitle: 'Ας ελέγξουμε ότι όλα είναι σωστά',
representative: {
title: 'Χρειαζόμαστε μερικά στοιχεία σας',
description: 'Είμαστε υποχρεωμένοι να συλλέξουμε αυτές τις πληροφορίες για την επεξεργασία πληρωμών.',
legalFirstName: 'Επίσημο μικρό όνομα',
legalLastName: 'Νόμιμο επώνυμο',
ssn: 'Αριθμός κοινωνικής ασφάλισης ή ITIN',
idDocument: 'Επαλήθευση ταυτότητας',
idDocumentDescription: 'Ανεβάστε ένα επίσημο έγγραφο ταυτότητας.',
},
business: {
title: 'Εισαγάγετε τα στοιχεία της επιχείρησής σας',
legalName: 'Επίσημη επωνυμία επιχείρησης',
companyRole: 'Ο ρόλος σας στην εταιρεία',
companyRoleOwner: 'Ιδιοκτήτης',
companyRoleDirector: 'Διευθυντής',
companyRoleOther: 'Άλλο',
industryCategories: 'Κατηγορία κλάδου',
description: 'Περιγραφή επιχείρησης',
descriptionHint: 'Περιγράψτε σύντομα τι κάνει η εταιρεία σας.',
},
terms: {
title: 'Αποδοχή όρων',
subtitle: 'Αποδεχτείτε τους παρακάτω όρους.',
certify: 'Βεβαιώνω ότι οι πληροφορίες που έδωσα είναι αληθείς και ακριβείς.',
expensifyTerms: `Αποδέχομαι τους <a href="${CONST.OLD_DOT_PUBLIC_URLS.TERMS_URL}">όρους και προϋποθέσεις</a> και την <a href="${CONST.OLD_DOT_PUBLIC_URLS.PRIVACY_URL}">πολιτική απορρήτου</a> της Expensify.`,
expensifyTermsAccessibilityLabel: 'Αποδέχομαι τους όρους και προϋποθέσεις και την πολιτική απορρήτου της Expensify.',
wiseTerms: `Αποδέχομαι τους <a href="${CONST.WISE.TERMS_URL}">όρους και προϋποθέσεις</a> και την <a href="${CONST.WISE.PRIVACY_URL}">πολιτική απορρήτου</a> της Wise.`,
wiseTermsAccessibilityLabel: 'Αποδέχομαι τους όρους και προϋποθέσεις και την πολιτική απορρήτου της Wise.',
error: 'Αποδεχτείτε όλους τους όρους για να συνεχίσετε.',
},
},
wiseGlobalReimbursementsIntro: {
title: 'Να ρυθμιστούν οι παγκόσμιες αποζημιώσεις;',
subtitle: 'Πληρώστε μέλη παγκοσμίως στο τοπικό τους νόμισμα.',
Expand Down
34 changes: 34 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,40 @@ const translations = {
editNickname: 'Edit nickname',
nickname: 'Nickname',
editNicknameInstruction: 'Give the bank account a nickname that sets it apart from others.',
wiseOnboarding: {
confirmationTitle: "Let's double check that everything looks right",
representative: {
title: 'We need some details from you',
description: "We're required to collect this information to process payments.",
legalFirstName: 'Legal first name',
legalLastName: 'Legal last name',
// @context US Social Security Number, not a national ID of the reader's country.
ssn: 'Social Security Number or ITIN',
idDocument: 'ID verification',
idDocumentDescription: 'Please upload a government-issued ID.',
},
business: {
title: 'Enter your business info',
legalName: 'Legal business name',
companyRole: 'Your role at the company',
companyRoleOwner: 'Owner',
companyRoleDirector: 'Director',
companyRoleOther: 'Other',
industryCategories: 'Industry category',
description: 'Business description',
descriptionHint: 'Briefly describe what your company does.',
},
terms: {
title: 'Accept terms',
subtitle: 'Please accept the terms below.',
certify: "I certify that the information I've provided is true and accurate.",
expensifyTerms: `I agree to the Expensify <a href="${CONST.OLD_DOT_PUBLIC_URLS.TERMS_URL}">terms and conditions</a> and <a href="${CONST.OLD_DOT_PUBLIC_URLS.PRIVACY_URL}">privacy policy</a>.`,
expensifyTermsAccessibilityLabel: 'I agree to the Expensify terms and conditions and privacy policy.',
wiseTerms: `I agree to the Wise <a href="${CONST.WISE.TERMS_URL}">terms and conditions</a> and <a href="${CONST.WISE.PRIVACY_URL}">privacy policy</a>.`,
wiseTermsAccessibilityLabel: 'I agree to the Wise terms and conditions and privacy policy.',
error: 'Please accept all of the terms to continue.',
},
},
wiseGlobalReimbursementsIntro: {
headerTitle: 'Global reimbursements',
title: 'Set up global reimbursements?',
Expand Down
33 changes: 33 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,39 @@ const translations: TranslationDeepObject<typeof en> = {
accountRequiresAttention: 'Esta cuenta requiere atención',
unlock: 'Desbloquear',
},
wiseOnboarding: {
confirmationTitle: 'Comprobemos que todo esté correcto',
representative: {
title: 'Necesitamos algunos datos tuyos',
description: 'Debemos recopilar esta información para procesar pagos.',
legalFirstName: 'Nombre legal',
legalLastName: 'Apellidos legales',
ssn: 'Número de seguro social o ITIN',
idDocument: 'Verificación de identidad',
idDocumentDescription: 'Sube un documento de identidad oficial.',
},
business: {
title: 'Introduce los datos de tu empresa',
legalName: 'Razón social',
companyRole: 'Tu cargo en la empresa',
companyRoleOwner: 'Propietario',
companyRoleDirector: 'Director',
companyRoleOther: 'Otro',
industryCategories: 'Categoría del sector',
description: 'Descripción de la empresa',
descriptionHint: 'Describe brevemente a qué se dedica tu empresa.',
},
terms: {
title: 'Aceptar términos',
subtitle: 'Acepta los términos a continuación.',
certify: 'Certifico que la información que he proporcionado es verdadera y exacta.',
expensifyTerms: `Acepto los <a href="${CONST.OLD_DOT_PUBLIC_URLS.TERMS_URL}">términos y condiciones</a> y la <a href="${CONST.OLD_DOT_PUBLIC_URLS.PRIVACY_URL}">política de privacidad</a> de Expensify.`,
expensifyTermsAccessibilityLabel: 'Acepto los términos y condiciones y la política de privacidad de Expensify.',
wiseTerms: `Acepto los <a href="${CONST.WISE.TERMS_URL}">términos y condiciones</a> y la <a href="${CONST.WISE.PRIVACY_URL}">política de privacidad</a> de Wise.`,
wiseTermsAccessibilityLabel: 'Acepto los términos y condiciones y la política de privacidad de Wise.',
error: 'Acepta todos los términos para continuar.',
},
},
wiseGlobalReimbursementsIntro: {
title: '¿Configurar reembolsos globales?',
subtitle: 'Paga a miembros de todo el mundo en su moneda local.',
Expand Down
33 changes: 33 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,39 @@ const translations: TranslationDeepObject<typeof en> = {
accountRequiresAttention: 'Ce compte nécessite une attention particulière',
unlock: 'Déverrouiller',
},
wiseOnboarding: {
confirmationTitle: 'Vérifions que tout est correct',
representative: {
title: 'Nous avons besoin de quelques informations',
description: 'Nous sommes tenus de recueillir ces informations pour traiter les paiements.',
legalFirstName: 'Prénom légal',
legalLastName: 'Nom de famille légal',
ssn: 'Numéro de sécurité sociale ou ITIN',
idDocument: 'Vérification d’identité',
idDocumentDescription: 'Veuillez téléverser une pièce d’identité officielle.',
},
business: {
title: 'Saisissez les informations de votre entreprise',
legalName: 'Raison sociale',
companyRole: 'Votre rôle dans l’entreprise',
companyRoleOwner: 'Propriétaire',
companyRoleDirector: 'Directeur',
companyRoleOther: 'Autre',
industryCategories: 'Secteur d’activité',
description: 'Description de l’entreprise',
descriptionHint: 'Décrivez brièvement ce que fait votre entreprise.',
},
terms: {
title: 'Accepter les conditions',
subtitle: 'Veuillez accepter les conditions ci-dessous.',
certify: 'Je certifie que les informations fournies sont exactes et véridiques.',
expensifyTerms: `J’accepte les <a href="${CONST.OLD_DOT_PUBLIC_URLS.TERMS_URL}">conditions générales</a> et la <a href="${CONST.OLD_DOT_PUBLIC_URLS.PRIVACY_URL}">politique de confidentialité</a> d’Expensify.`,
expensifyTermsAccessibilityLabel: 'J’accepte les conditions générales et la politique de confidentialité d’Expensify.',
wiseTerms: `J’accepte les <a href="${CONST.WISE.TERMS_URL}">conditions générales</a> et la <a href="${CONST.WISE.PRIVACY_URL}">politique de confidentialité</a> de Wise.`,
wiseTermsAccessibilityLabel: 'J’accepte les conditions générales et la politique de confidentialité de Wise.',
error: 'Veuillez accepter toutes les conditions pour continuer.',
},
},
wiseGlobalReimbursementsIntro: {
title: 'Configurer les remboursements globaux ?',
subtitle: 'Payez des membres partout dans le monde dans leur devise locale.',
Expand Down
Loading
Loading