diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 168bac43e887..6f4c9b07b24b 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,8 +551,11 @@ 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: ''}); + 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 90f93b04e5c7..5a385e313440 100644 --- a/src/pages/workspace/WorkspaceCardPage.js +++ b/src/pages/workspace/WorkspaceCardPage.js @@ -22,6 +22,7 @@ import CONST from '../../CONST'; import Permissions from '../../libs/Permissions'; import HeroCardWebImage from '../../../assets/images/cascading-cards-web.svg'; import HeroCardMobileImage from '../../../assets/images/cascading-cards-mobile.svg'; +import BankAccount from '../../libs/models/BankAccount'; import {openSignedInLink} from '../../libs/actions/App'; const propTypes = { @@ -72,13 +73,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');