From 898e2957cc5b8e338ab11ffb36f8b0890af536d9 Mon Sep 17 00:00:00 2001 From: Rocio Perez Date: Mon, 26 Jul 2021 22:31:52 -0400 Subject: [PATCH 1/2] Show verification modal instead of redirecting to concierge --- src/libs/actions/BankAccounts.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 53434116618b..1a71f44f7ce7 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -552,7 +552,6 @@ function validateBankAccount(bankAccountID, validateCode) { .then((response) => { if (response.jsonCode === 200) { Growl.show('Bank Account successfully validated!', CONST.GROWL.SUCCESS, 3000); - Navigation.dismissModal(); Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, error: ''}); return; } From dc4f7134c80bba4f402dee5f261b9ca00f4fdba7 Mon Sep 17 00:00:00 2001 From: Rocio Perez Date: Tue, 27 Jul 2021 21:13:20 -0400 Subject: [PATCH 2/2] Create new step --- src/libs/actions/BankAccounts.js | 7 ++- src/pages/ReimbursementAccount/EnableStep.js | 56 +++++++++++++++++++ .../ReimbursementAccountPage.js | 6 ++ src/pages/workspace/WorkspaceCardPage.js | 7 ++- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 src/pages/ReimbursementAccount/EnableStep.js diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 1a71f44f7ce7..898929504e41 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -9,7 +9,6 @@ import * as API from '../API'; import BankAccount from '../models/BankAccount'; import promiseAllSettled from '../promiseAllSettled'; import Growl from '../Growl'; -import Navigation from '../Navigation/Navigation'; import {translateLocal} from '../translate'; /** @@ -552,7 +551,11 @@ function validateBankAccount(bankAccountID, validateCode) { .then((response) => { if (response.jsonCode === 200) { Growl.show('Bank Account successfully validated!', CONST.GROWL.SUCCESS, 3000); - Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, error: ''}); + API.User_IsUsingExpensifyCard() + .then(({isUsingExpensifyCard}) => { + Onyx.merge(ONYXKEYS.USER, {isUsingExpensifyCard}); + Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, error: ''}); + }); return; } diff --git a/src/pages/ReimbursementAccount/EnableStep.js b/src/pages/ReimbursementAccount/EnableStep.js new file mode 100644 index 000000000000..45c991561b78 --- /dev/null +++ b/src/pages/ReimbursementAccount/EnableStep.js @@ -0,0 +1,56 @@ +import React from 'react'; +import {Image, View} from 'react-native'; +import styles from '../../styles/styles'; +import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; +import {navigateToConciergeChat} from '../../libs/actions/Report'; +import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; +import Navigation from '../../libs/Navigation/Navigation'; +import Text from '../../components/Text'; +import CONST from '../../CONST'; +import TextLink from '../../components/TextLink'; +import compose from '../../libs/compose'; + +const propTypes = { + ...withLocalizePropTypes, +}; + +const EnableStep = ({translate}) => { + const verifyingUrl = `${CONST.CLOUDFRONT_URL}/images/icons/emptystates/emptystate_reviewing.gif`; + return ( + + + + + + {translate('validationStep.reviewingInfo')} + { + // There are two modals that must be dismissed before we can reveal the Concierge + // chat underneath these screens + Navigation.dismissModal(); + Navigation.dismissModal(); + navigateToConciergeChat(); + }} + > + {translate('common.here')} + + {translate('validationStep.forNextSteps')} + + + + ); +}; + +EnableStep.propTypes = propTypes; +EnableStep.displayName = 'EnableStep'; + +export default compose( + withLocalize, +)(EnableStep); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index ce76ff22233c..05c93882eb35 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -24,6 +24,7 @@ import CompanyStep from './CompanyStep'; import RequestorStep from './RequestorStep'; import ValidationStep from './ValidationStep'; import BeneficialOwnersStep from './BeneficialOwnersStep'; +import EnableStep from './EnableStep'; import ROUTES from '../../ROUTES'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; @@ -232,6 +233,11 @@ class ReimbursementAccountPage extends React.Component { error={error} /> )} + {currentStep === CONST.BANK_ACCOUNT.STEP.ENABLE && ( + + )} ); diff --git a/src/pages/workspace/WorkspaceCardPage.js b/src/pages/workspace/WorkspaceCardPage.js index 98f18de11873..680d66c1c81a 100644 --- a/src/pages/workspace/WorkspaceCardPage.js +++ b/src/pages/workspace/WorkspaceCardPage.js @@ -22,6 +22,7 @@ import CONFIG from '../../CONFIG'; import CONST from '../../CONST'; import HeroCardWebImage from '../../../assets/images/cascading-cards-web.svg'; import HeroCardMobileImage from '../../../assets/images/cascading-cards-mobile.svg'; +import BankAccount from '../../libs/models/BankAccount'; const propTypes = { /* Onyx Props */ @@ -70,13 +71,15 @@ const WorkspaceCardPage = ({ isSmallScreenWidth, reimbursementAccount, }) => { - const isVerifying = lodashGet(reimbursementAccount, 'achData.state', '') === CONST.BANK_ACCOUNT.STATE.VERIFYING; + const isVerifying = lodashGet(reimbursementAccount, 'achData.state', '') === BankAccount.STATE.VERIFYING; + const isNotAutoProvisioned = !user.isUsingExpensifyCard + && lodashGet(reimbursementAccount, 'achData.state', '') === BankAccount.STATE.OPEN; let buttonText; if (user.isFromPublicDomain) { buttonText = translate('workspace.card.addEmail'); } else if (user.isUsingExpensifyCard) { buttonText = translate('workspace.card.manageCards'); - } else if (isVerifying) { + } else if (isVerifying || isNotAutoProvisioned) { buttonText = translate('workspace.card.finishSetup'); } else { buttonText = translate('workspace.card.getStarted');