From ad15b2030ec921bf00e2134ae309c8bcf21e1930 Mon Sep 17 00:00:00 2001 From: Pujan Date: Wed, 28 Jun 2023 21:04:28 +0530 Subject: [PATCH 1/2] updated workspace bank account setup notfound flow --- .../ContinueBankAccountSetup.js | 90 +++++++++---------- .../ReimbursementAccountPage.js | 11 +++ 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js b/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js index 4eca196d328a..1d0c3032d5b9 100644 --- a/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js +++ b/src/pages/ReimbursementAccount/ContinueBankAccountSetup.js @@ -7,16 +7,13 @@ import * as Expensicons from '../../components/Icon/Expensicons'; import * as Illustrations from '../../components/Icon/Illustrations'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import Button from '../../components/Button'; -import compose from '../../libs/compose'; import CONST from '../../CONST'; -import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; import HeaderWithBackButton from '../../components/HeaderWithBackButton'; import MenuItem from '../../components/MenuItem'; import styles from '../../styles/styles'; import ScreenWrapper from '../../components/ScreenWrapper'; import Section from '../../components/Section'; import Text from '../../components/Text'; -import withPolicy from '../workspace/withPolicy'; import * as ReimbursementAccountProps from './reimbursementAccountPropTypes'; import WorkspaceResetBankAccountModal from '../workspace/WorkspaceResetBankAccountModal'; import * as BankAccounts from '../../libs/actions/BankAccounts'; @@ -29,11 +26,6 @@ const propTypes = { /** Callback to continue to the next step of the setup */ continue: PropTypes.func.isRequired, - /** Policy values needed in the component */ - policy: PropTypes.shape({ - name: PropTypes.string, - }).isRequired, - /* The workspace name */ policyName: PropTypes.string, @@ -47,48 +39,46 @@ function ContinueBankAccountSetup(props) { const pendingAction = lodashGet(props.reimbursementAccount, 'pendingAction', null); return ( - - - -
+ +
+ - - {props.translate('workspace.bankAccount.youreAlmostDone')} -
-
- + {props.translate('workspace.bankAccount.youreAlmostDone')} +
+
{props.reimbursementAccount.shouldShowResetModal && }
@@ -99,4 +89,4 @@ ContinueBankAccountSetup.propTypes = propTypes; ContinueBankAccountSetup.defaultProps = defaultProps; ContinueBankAccountSetup.displayName = 'ContinueBankAccountSetup'; -export default compose(withPolicy, withLocalize)(ContinueBankAccountSetup); +export default withLocalize(ContinueBankAccountSetup); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index d12231e85370..9c4609e934f7 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -31,6 +31,7 @@ import HeaderWithBackButton from '../../components/HeaderWithBackButton'; import * as ReimbursementAccountProps from './reimbursementAccountPropTypes'; import reimbursementAccountDraftPropTypes from './ReimbursementAccountDraftPropTypes'; import withPolicy from '../workspace/withPolicy'; +import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; const propTypes = { /** Plaid SDK token to use to initialize the widget */ @@ -329,6 +330,16 @@ class ReimbursementAccountPage extends React.Component { const currentStep = achData.currentStep || CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT; const policyName = lodashGet(this.props.policy, 'name'); + if (_.isEmpty(this.props.policy)) { + return ( + Navigation.navigate(ROUTES.SETTINGS_WORKSPACES)} + shouldShowLink + /> + ); + } + const isLoading = this.props.isLoadingReportData || this.props.account.isLoading || this.props.reimbursementAccount.isLoading; // Prevent the full-page blocking offline view from being displayed for these steps if the device goes offline. From df7d7bd393abe9f18e7f1bfcbebb4b6c0f1d72e0 Mon Sep 17 00:00:00 2001 From: Pujan Date: Wed, 28 Jun 2023 21:44:33 +0530 Subject: [PATCH 2/2] ScreenWrapper added --- .../ReimbursementAccount/ReimbursementAccountPage.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js index 9c4609e934f7..7b4681100f6b 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.js +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.js @@ -332,11 +332,13 @@ class ReimbursementAccountPage extends React.Component { if (_.isEmpty(this.props.policy)) { return ( - Navigation.navigate(ROUTES.SETTINGS_WORKSPACES)} - shouldShowLink - /> + + Navigation.navigate(ROUTES.SETTINGS_WORKSPACES)} + shouldShowLink + /> + ); }