Skip to content

Commit 42b00e5

Browse files
authored
feat: add brand_color_hex_code and oauth_predirect_instructions into the predirect page (#268)
* fix: add the optional brand_color_hex_code to the institution fields * fix: add all supported options to the predirect screen and remove feature check * fix: update body text and tests for PredirectInstructions
1 parent b0441af commit 42b00e5

File tree

12 files changed

+509
-138
lines changed

12 files changed

+509
-138
lines changed

src/const/language/es.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@
406406
"Unable to connect": "No se puede conectar",
407407
"Maintenance in progress": "Mantenimiento en curso",
408408
"Deposits verified. You're almost done setting things up. Continue to your institution.": "Depósitos verificados. Ya casi terminas de configurar todo. Continúa con tu institución.",
409-
"After logging in, share at least one account and %1profile information%2.": "Después de iniciar sesión, comparta al menos una cuenta y %1información de perfil%2.",
410-
"After logging in, share at least one account.": "Después de iniciar sesión, comparta al menos una cuenta.",
411409
"Connection not supported by %1": "Conexión no compatible con %1",
412410
"%1 currently limits how your data can be shared. We'll enable this connection once %1 opens access.": "%1 actualmente limita cómo se pueden compartir sus datos. Habilitaremos esta conexión una vez que %1 abra el acceso.",
413411
"UNAVAILABLE": "INDISPONIBLE",
@@ -421,6 +419,8 @@
421419
"Information to select on the %1 site": "Información para seleccionar en el sitio %1",
422420
"Checking or savings account": "Cuenta corriente o de ahorros",
423421
"Profile information": "Información del perfil",
422+
"Account numbers": "Números de cuenta",
423+
"To complete your connection, please %1share%2 the following after signing in:": "Para completar su conexión, por favor, %1comparta%2 lo siguiente después de iniciar sesión:",
424424
"connect/disclosure/button\u0004Continue": "Continuar",
425425
"connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "Al hacer clic en Continuar, tu aceptas la ",
426426
"connect/disclosure/policy/link\u0004MX Privacy Policy.": "Política de privacidad de Money Experience.",

src/const/language/es.po

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ msgid "Basic account information"
891891
msgstr "Información básica de la cuenta"
892892

893893
#: src/views/disclosure/Disclosure.js
894+
#: src/views/oauth/experiments/PredirectInstructions.tsx
894895
msgid "Tax documents"
895896
msgstr "Documentos fiscales"
896897

@@ -1422,6 +1423,7 @@ msgstr ""
14221423
"y descripciones."
14231424

14241425
#: src/const/DataClusters.js
1426+
#: src/views/oauth/experiments/PredirectInstructions.tsx
14251427
msgid "Statements"
14261428
msgstr "Declaraciones"
14271429

@@ -2036,17 +2038,6 @@ msgstr ""
20362038
"Depósitos verificados. Ya casi terminas de configurar todo. Continúa con tu "
20372039
"institución."
20382040

2039-
#: src/views/oauth/experiments/PredirectInstructions.tsx
2040-
msgid ""
2041-
"After logging in, share at least one account and %1profile information%2."
2042-
msgstr ""
2043-
"Después de iniciar sesión, comparta al menos una cuenta y %1información de "
2044-
"perfil%2."
2045-
2046-
#: src/views/oauth/experiments/PredirectInstructions.tsx
2047-
msgid "After logging in, share at least one account."
2048-
msgstr "Después de iniciar sesión, comparta al menos una cuenta."
2049-
20502041
#: src/utilities/institutionStatus.ts
20512042
msgid "Connection not supported by %1"
20522043
msgstr "Conexión no compatible con %1"
@@ -2102,3 +2093,14 @@ msgstr "Cuenta corriente o de ahorros"
21022093
#: src/views/oauth/experiments/PredirectInstructions.tsx
21032094
msgid "Profile information"
21042095
msgstr "Información del perfil"
2096+
2097+
#: src/views/oauth/experiments/PredirectInstructions.tsx
2098+
msgid "Account numbers"
2099+
msgstr "Números de cuenta"
2100+
2101+
#: src/views/oauth/experiments/PredirectInstructions.tsx
2102+
msgid ""
2103+
"To complete your connection, please %1share%2 the following after signing in:"
2104+
msgstr ""
2105+
"Para completar su conexión, por favor, %1comparta%2 lo siguiente después de "
2106+
"iniciar sesión:"

src/const/language/frCa.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@
407407
"Unable to connect": "Impossible de se connecter",
408408
"Maintenance in progress": "Entretien en cours",
409409
"Deposits verified. You're almost done setting things up. Continue to your institution.": "Dépôts vérifiés. Vous avez presque terminé la configuration. Rendez-vous dans votre établissement.",
410-
"After logging in, share at least one account and %1profile information%2.": "Après vous être connecté, partagez au moins un compte et %1informations de profil%2.",
411-
"After logging in, share at least one account.": "Après vous être connecté, partagez au moins un compte.",
412410
"Connection not supported by %1": "Connexion non prise en charge par %1",
413411
"%1 currently limits how your data can be shared. We'll enable this connection once %1 opens access.": "%1 limite actuellement la manière dont vos données peuvent être partagées. Nous activerons cette connexion une fois que %1 ouvrira l'accès.",
414412
"UNAVAILABLE": "INDISPONIBLE",
@@ -422,6 +420,8 @@
422420
"Information to select on the %1 site": "Informations à sélectionner sur le site %1.",
423421
"Checking or savings account": "Compte courant ou compte d'épargne",
424422
"Profile information": "Informations de profil",
423+
"Account numbers": "Numéros de compte",
424+
"To complete your connection, please %1share%2 the following after signing in:": "Pour finaliser votre connexion, veuillez %1partager%2 les informations suivantes après vous être connecté :",
425425
"connect/disclosure/policy/text\u0004By clicking Continue, you agree to the ": "En cliquant sur Continuer, vous acceptez la ",
426426
"connect/disclosure/policy/link\u0004MX Privacy Policy.": "Politique de confidentialité de MX.",
427427
"connect/disclosure/policy/link\u0004MX Privacy Policy": "Politique de confidentialité de MX.",

src/const/language/frCa.po

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ msgid "Basic account information"
983983
msgstr "Informations de base sur le compte"
984984

985985
#: src/views/disclosure/Disclosure.js
986+
#: src/views/oauth/experiments/PredirectInstructions.tsx
986987
msgid "Tax documents"
987988
msgstr "Documents fiscaux"
988989

@@ -1514,6 +1515,7 @@ msgstr ""
15141515
"dates et descriptions."
15151516

15161517
#: src/const/DataClusters.js
1518+
#: src/views/oauth/experiments/PredirectInstructions.tsx
15171519
msgid "Statements"
15181520
msgstr "Déclarations"
15191521

@@ -2114,17 +2116,6 @@ msgstr ""
21142116
"Dépôts vérifiés. Vous avez presque terminé la configuration. Rendez-vous "
21152117
"dans votre établissement."
21162118

2117-
#: src/views/oauth/experiments/PredirectInstructions.tsx
2118-
msgid ""
2119-
"After logging in, share at least one account and %1profile information%2."
2120-
msgstr ""
2121-
"Après vous être connecté, partagez au moins un compte et %1informations de "
2122-
"profil%2."
2123-
2124-
#: src/views/oauth/experiments/PredirectInstructions.tsx
2125-
msgid "After logging in, share at least one account."
2126-
msgstr "Après vous être connecté, partagez au moins un compte."
2127-
21282119
#: src/utilities/institutionStatus.ts
21292120
msgid "Connection not supported by %1"
21302121
msgstr "Connexion non prise en charge par %1"
@@ -2180,3 +2171,14 @@ msgstr "Compte courant ou compte d'épargne"
21802171
#: src/views/oauth/experiments/PredirectInstructions.tsx
21812172
msgid "Profile information"
21822173
msgstr "Informations de profil"
2174+
2175+
#: src/views/oauth/experiments/PredirectInstructions.tsx
2176+
msgid "Account numbers"
2177+
msgstr "Numéros de compte"
2178+
2179+
#: src/views/oauth/experiments/PredirectInstructions.tsx
2180+
msgid ""
2181+
"To complete your connection, please %1share%2 the following after signing in:"
2182+
msgstr ""
2183+
"Pour finaliser votre connexion, veuillez %1partager%2 les informations "
2184+
"suivantes après vous être connecté :"

src/services/mockedData.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,13 @@ export const USER_DATA = {
420420
created_at: 1661194428,
421421
}
422422

423-
export const FAVORITE_INSTITUTIONS = [
423+
export const FAVORITE_INSTITUTIONS: InstitutionResponseType[] = [
424424
{
425425
account_verification_is_enabled: true,
426426
account_identification_is_enabled: true,
427427
code: 'gringotts',
428428
guid: 'INS-123',
429+
is_disabled_by_client: false,
429430
login_url: null,
430431
name: 'Gringotts',
431432
popularity: 43985,
@@ -438,6 +439,7 @@ export const FAVORITE_INSTITUTIONS = [
438439
account_identification_is_enabled: true,
439440
code: '77277',
440441
guid: 'INS-345',
442+
is_disabled_by_client: false,
441443
login_url: 'https://www.americanexpress.com/en-us/account/login/',
442444
name: 'American Express Credit Card',
443445
popularity: 20,
@@ -450,6 +452,7 @@ export const FAVORITE_INSTITUTIONS = [
450452
account_identification_is_enabled: false,
451453
code: '78033',
452454
guid: 'INS-567',
455+
is_disabled_by_client: false,
453456
login_url: null,
454457
name: 'Discover Credit Card',
455458
popularity: 9,
@@ -462,6 +465,7 @@ export const FAVORITE_INSTITUTIONS = [
462465
account_identification_is_enabled: true,
463466
code: '1d303f53-a9c2-4819-9469-9320b561280b',
464467
guid: 'INS-789',
468+
is_disabled_by_client: false,
465469
login_url: null,
466470
name: 'Capital One',
467471
popularity: 9,
@@ -484,12 +488,13 @@ export const FAVORITE_INSTITUTIONS = [
484488
},
485489
]
486490

487-
export const SEARCHED_INSTITUTIONS = [
491+
export const SEARCHED_INSTITUTIONS: InstitutionResponseType[] = [
488492
{
489493
account_verification_is_enabled: true,
490494
account_identification_is_enabled: true,
491495
code: 'gringotts',
492496
guid: 'INS-f1a3285d-e855-b68f-6aa7-8ae775c0e0e9',
497+
is_disabled_by_client: false,
493498
login_url: null,
494499
name: 'Gringotts',
495500
popularity: 43984,
@@ -502,6 +507,7 @@ export const SEARCHED_INSTITUTIONS = [
502507
account_identification_is_enabled: false,
503508
code: '043ff29f-ff1b-43ac-936f-27d26403c6aa',
504509
guid: 'INS-39fc8bea-4568-40ce-95d5-c2ea33a86398',
510+
is_disabled_by_client: false,
505511
login_url: null,
506512
name: 'MX Bank',
507513
popularity: 3,
@@ -514,6 +520,7 @@ export const SEARCHED_INSTITUTIONS = [
514520
account_identification_is_enabled: false,
515521
code: '11166c24-99c4-4552-a6a2-4a4706abf9b0',
516522
guid: 'INS-c706ddb2-dfee-4575-a1ce-df2f907ab4af',
523+
is_disabled_by_client: false,
517524
login_url: 'https://mx.com',
518525
name: 'Gringotts Oauth/MDX V50',
519526
popularity: 1,
@@ -526,6 +533,7 @@ export const SEARCHED_INSTITUTIONS = [
526533
account_identification_is_enabled: false,
527534
code: '4a32a8d9-44e8-4302-a1a5-e37c109eead4',
528535
guid: 'INS-f8968535-d8e1-45e9-8d0e-80bdcaaeb0fd',
536+
is_disabled_by_client: false,
529537
login_url: null,
530538
name: 'Gringotts TEST(Clone)',
531539
popularity: 0,
@@ -538,6 +546,7 @@ export const SEARCHED_INSTITUTIONS = [
538546
account_identification_is_enabled: false,
539547
code: '83ee1118-4ae9-4140-a501-8b74c2f60cbe',
540548
guid: 'INS-83914605-0efa-45e5-b1f2-b5a9a0afa909',
549+
is_disabled_by_client: false,
541550
login_url: null,
542551
name: 'Grinnell State Bank',
543552
popularity: 0,

src/views/oauth/OAuthDefault.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,17 @@ import useAnalyticsPath from 'src/hooks/useAnalyticsPath'
2020
import useAnalyticsEvent from 'src/hooks/useAnalyticsEvent'
2121
import { AnalyticEvents, PageviewInfo } from 'src/const/Analytics'
2222
import { useApi } from 'src/context/ApiContext'
23-
import { getUserFeatures } from 'src/redux/reducers/userFeaturesSlice'
24-
import {
25-
PredirectInstructions,
26-
WELLS_FARGO_INSTRUCTIONS_FEATURE_NAME,
27-
} from 'src/views/oauth/experiments/PredirectInstructions'
23+
import { PredirectInstructions } from 'src/views/oauth/experiments/PredirectInstructions'
24+
import { isWellsFargoInstitution } from 'src/views/oauth/experiments/predirectInstructionsUtils'
2825

2926
export const OAuthDefault = (props) => {
3027
// Experiment code - Remove after experiment is over
3128
const language = window?.app?.options?.language || 'en-US'
32-
const userFeatures = useSelector(getUserFeatures)
33-
const isWellsFargoInstructionsFeatureEnabled =
34-
userFeatures.some(
35-
(feature) =>
36-
feature.feature_name === WELLS_FARGO_INSTRUCTIONS_FEATURE_NAME &&
37-
feature.is_enabled === 'test',
38-
) &&
39-
(props.institution.guid === 'INS-6073ad01-da9e-f6ba-dfdf-5f1500d8e867' || // Wells Fargo PROD guid
40-
props.institution.guid === 'INS-f9e8d5f6-b953-da63-32e4-6e88fbe8b250') && // Wells Fargo SAND guid for testing
41-
language.toLowerCase() === 'en-us'
29+
const isWellsFargo = isWellsFargoInstitution(props.institution)
30+
31+
const hasPredirectInstructions =
32+
Array.isArray(props.institution?.oauth_predirect_instructions) &&
33+
props.institution?.oauth_predirect_instructions.length > 0
4234

4335
const { api } = useApi()
4436
useAnalyticsPath(...PageviewInfo.CONNECT_OAUTH_INSTRUCTIONS, {
@@ -58,11 +50,12 @@ export const OAuthDefault = (props) => {
5850

5951
return (
6052
<div role="alert">
61-
{isWellsFargoInstructionsFeatureEnabled ? (
53+
{/* This check allows us to merge our frontend code before the backend is ready.
54+
Wells Fargo will continue to get the special treatment, and other institutions
55+
will only start seeing the pre-redirect instructions once the backend is ready. */}
56+
{isWellsFargo || hasPredirectInstructions ? (
6257
<>
63-
{/* // This experiment removes the institution block and completely changes the instructional
64-
text */}
65-
<PredirectInstructions institutionName={props?.institution?.name} />
58+
<PredirectInstructions institution={props?.institution} />
6659
</>
6760
) : (
6861
<>

0 commit comments

Comments
 (0)