Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ const ROUTES = {
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/wallet/add-bank-account', backTo),
},
SETTINGS_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT: `settings/wallet/add-bank-account/${VERIFY_ACCOUNT}`,
SETTINGS_ADD_US_BANK_ACCOUNT: 'settings/wallet/add-us-bank-account',
SETTINGS_ENABLE_PAYMENTS: 'settings/wallet/enable-payments',
SETTINGS_WALLET_ENABLE_GLOBAL_REIMBURSEMENTS: {
Expand Down Expand Up @@ -1580,6 +1581,10 @@ const ROUTES = {
return `workspaces/${policyID}/invoices` as const;
},
},
WORKSPACE_INVOICES_VERIFY_ACCOUNT: {
route: `workspaces/:policyID/invoices/${VERIFY_ACCOUNT}`,
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/${VERIFY_ACCOUNT}` as const,
},
WORKSPACE_INVOICES_COMPANY_NAME: {
route: 'workspaces/:policyID/invoices/company-name',
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/company-name` as const,
Expand Down
2 changes: 2 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const SCREENS = {
APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links',
ADD_DEBIT_CARD: 'Settings_Add_Debit_Card',
ADD_PAYMENT_CARD_CHANGE_CURRENCY: 'Settings_Add_Payment_Card_Change_Currency',
ADD_BANK_ACCOUNT_VERIFY_ACCOUNT: 'Settings_Add_Bank_Account_Verify_Account',
ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account',
ADD_US_BANK_ACCOUNT: 'Settings_Add_US_Bank_Account',
CLOSE: 'Settings_Close',
Expand Down Expand Up @@ -564,6 +565,7 @@ const SCREENS = {
EXPENSIFY_CARD_SETTINGS_ACCOUNT: 'Workspace_ExpensifyCard_Settings_Account',
EXPENSIFY_CARD_SETTINGS_FREQUENCY: 'Workspace_ExpensifyCard_Settings_Frequency',
INVOICES: 'Workspace_Invoices',
INVOICES_VERIFY_ACCOUNT: 'Workspace_Invoices_Verify_Account',
INVOICES_COMPANY_NAME: 'Workspace_Invoices_Company_Name',
INVOICES_COMPANY_WEBSITE: 'Workspace_Invoices_Company_Website',
MEMBERS: 'Workspace_Members',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS]: () => require<ReactComponentModule>('../../../../pages/EnablePayments/EnablePayments').default,
[SCREENS.SETTINGS.WALLET.ENABLE_GLOBAL_REIMBURSEMENTS]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/EnableGlobalReimbursements').default,
[SCREENS.SETTINGS.ADD_DEBIT_CARD]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/AddDebitCardPage').default,
[SCREENS.SETTINGS.ADD_BANK_ACCOUNT_VERIFY_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/NewBankAccountVerifyAccountPage').default,
[SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/settings/Wallet/InternationalDepositAccount').default,
[SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/AddPersonalBankAccountPage').default,
[SCREENS.SETTINGS.PROFILE.STATUS]: () => require<ReactComponentModule>('../../../../pages/settings/Profile/CustomStatus/StatusPage').default,
Expand Down Expand Up @@ -653,6 +654,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
[SCREENS.WORKSPACE.TAX_CODE]: () => require<ReactComponentModule>('../../../../pages/workspace/taxes/WorkspaceTaxCodePage').default,
[SCREENS.WORKSPACE.INVOICES_COMPANY_NAME]: () => require<ReactComponentModule>('../../../../pages/workspace/invoices/WorkspaceInvoicingDetailsName').default,
[SCREENS.WORKSPACE.INVOICES_COMPANY_WEBSITE]: () => require<ReactComponentModule>('../../../../pages/workspace/invoices/WorkspaceInvoicingDetailsWebsite').default,
[SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/workspace/invoices/WorkspaceInvoicesVerifyAccountPage').default,
[SCREENS.WORKSPACE.COMPANY_CARDS_ASSIGN_CARD]: () => require<ReactComponentModule>('../../../../pages/workspace/companyCards/assignCard/AssignCardFeedPage').default,
[SCREENS.WORKSPACE.COMPANY_CARDS_SELECT_FEED]: () => require<ReactComponentModule>('../../../../pages/workspace/companyCards/WorkspaceCompanyCardFeedSelectorPage').default,
[SCREENS.WORKSPACE.COMPANY_CARDS_BANK_CONNECTION]: () => require<ReactComponentModule>('../../../../pages/workspace/companyCards/BankConnection').default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const SETTINGS_TO_RHP: Partial<Record<keyof SettingsSplitNavigatorParamList, str
SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD_CONFIRMATION,
SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS,
SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED,
SCREENS.SETTINGS.ADD_BANK_ACCOUNT_VERIFY_ACCOUNT,
],
[SCREENS.SETTINGS.SECURITY]: [
SCREENS.TWO_FACTOR_AUTH.ROOT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const WORKSPACE_TO_RHP: Partial<Record<keyof WorkspaceSplitNavigatorParamList, s
SCREENS.WORKSPACE.REPORT_FIELDS_EDIT_VALUE,
SCREENS.WORKSPACE.REPORT_FIELDS_EDIT_INITIAL_VALUE,
],
[SCREENS.WORKSPACE.INVOICES]: [SCREENS.WORKSPACE.INVOICES_COMPANY_NAME, SCREENS.WORKSPACE.INVOICES_COMPANY_WEBSITE],
[SCREENS.WORKSPACE.INVOICES]: [SCREENS.WORKSPACE.INVOICES_COMPANY_NAME, SCREENS.WORKSPACE.INVOICES_COMPANY_WEBSITE, SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT],
[SCREENS.WORKSPACE.COMPANY_CARDS]: [
SCREENS.WORKSPACE.COMPANY_CARDS_ADD_NEW,
SCREENS.WORKSPACE.COMPANY_CARDS_TYPE,
Expand Down
8 changes: 8 additions & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
path: ROUTES.SETTINGS_ADD_BANK_ACCOUNT.route,
exact: true,
},
[SCREENS.SETTINGS.ADD_BANK_ACCOUNT_VERIFY_ACCOUNT]: {
path: ROUTES.SETTINGS_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT,
exact: true,
},
[SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT]: {
path: ROUTES.SETTINGS_ADD_US_BANK_ACCOUNT,
exact: true,
Expand Down Expand Up @@ -641,6 +645,10 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.WORKSPACE.INVOICES_COMPANY_WEBSITE]: {
path: ROUTES.WORKSPACE_INVOICES_COMPANY_WEBSITE.route,
},
[SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT]: {
path: ROUTES.WORKSPACE_INVOICES_VERIFY_ACCOUNT.route,
exact: true,
},
[SCREENS.WORKSPACE.COMPANY_CARDS_SELECT_FEED]: {
path: ROUTES.WORKSPACE_COMPANY_CARDS_SELECT_FEED.route,
},
Expand Down
7 changes: 7 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ type SettingsNavigatorParamList = {
};
[SCREENS.SETTINGS.ADD_DEBIT_CARD]: undefined;
[SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: undefined;
[SCREENS.SETTINGS.ADD_BANK_ACCOUNT_VERIFY_ACCOUNT]: undefined;
[SCREENS.SETTINGS.ADD_US_BANK_ACCOUNT]: undefined;
[SCREENS.SETTINGS.PROFILE.STATUS]: undefined;
[SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER]: undefined;
Expand Down Expand Up @@ -975,6 +976,9 @@ type SettingsNavigatorParamList = {
policyID: string;
taxID: string;
};
[SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT]: {
policyID: string;
};
[SCREENS.WORKSPACE.INVOICES_COMPANY_NAME]: {
policyID: string;
};
Expand Down Expand Up @@ -1980,6 +1984,9 @@ type WorkspaceSplitNavigatorParamList = {
[SCREENS.WORKSPACE.INVOICES]: {
policyID: string;
};
[SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT]: {
policyID: string;
};
[SCREENS.WORKSPACE.MEMBERS]: {
policyID: string;
};
Expand Down
16 changes: 16 additions & 0 deletions src/pages/settings/Wallet/NewBankAccountVerifyAccountPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import VerifyAccountPageBase from '@pages/settings/VerifyAccountPageBase';
import ROUTES from '@src/ROUTES';

function NewBankAccountVerifyAccountPage() {
return (
<VerifyAccountPageBase
navigateBackTo={ROUTES.SETTINGS_WALLET}
navigateForwardTo={ROUTES.SETTINGS_ADD_BANK_ACCOUNT.route}
/>
);
}

NewBankAccountVerifyAccountPage.displayName = 'NewBankAccountVerifyAccountPage';

export default NewBankAccountVerifyAccountPage;
11 changes: 10 additions & 1 deletion src/pages/settings/Wallet/PaymentMethodList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ type PaymentMethodListProps = {
/** Whether the bank accounts should be displayed in private and business sections */
shouldShowBankAccountSections?: boolean;

/** The policy ID associated with the workspace, if component is rendered in workspace context */
policyID?: string;

/** Function to be called when the user presses the add bank account button */
onAddBankAccountPress?: () => void;

Expand Down Expand Up @@ -177,6 +180,7 @@ function PaymentMethodList({
shouldShowRightIcon = true,
invoiceTransferBankAccountID,
shouldShowBankAccountSections = false,
policyID = '',
onAddBankAccountPress = () => {},
itemIconRight,
filterType,
Expand Down Expand Up @@ -371,7 +375,12 @@ function PaymentMethodList({

const onPressItem = useCallback(() => {
if (!isUserValidated) {
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute(), ROUTES.SETTINGS_ADD_BANK_ACCOUNT.route));
const path = Navigation.getActiveRoute();
if (path.includes(ROUTES.WORKSPACES_LIST.route) && policyID) {
Navigation.navigate(ROUTES.WORKSPACE_INVOICES_VERIFY_ACCOUNT.getRoute(policyID));
} else {
Navigation.navigate(ROUTES.SETTINGS_ADD_BANK_ACCOUNT_VERIFY_ACCOUNT);
}
return;
}
onAddBankAccountPress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function WorkspaceInvoiceVBASection({policyID}: WorkspaceInvoiceVBASectionProps)
actionPaymentMethodType={shouldShowDefaultDeleteMenu ? paymentMethod.selectedPaymentMethodType : ''}
style={[styles.mt5, shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8]}
listItemStyle={shouldUseNarrowLayout ? styles.ph5 : styles.ph8}
policyID={policyID}
/>
<Popover
isVisible={shouldShowDefaultDeleteMenu}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {WorkspaceSplitNavigatorParamList} from '@libs/Navigation/types';
import VerifyAccountPageBase from '@pages/settings/VerifyAccountPageBase';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';

type WorkspaceInvoicesVerifyAccountPageProps = PlatformStackScreenProps<WorkspaceSplitNavigatorParamList, typeof SCREENS.WORKSPACE.INVOICES_VERIFY_ACCOUNT>;
function WorkspaceInvoicesVerifyAccountPage({route}: WorkspaceInvoicesVerifyAccountPageProps) {
const workspaceInvoicePath = ROUTES.WORKSPACE_INVOICES.getRoute(route.params.policyID);
return (
<VerifyAccountPageBase
navigateBackTo={workspaceInvoicePath}
navigateForwardTo={ROUTES.SETTINGS_ADD_BANK_ACCOUNT.getRoute(workspaceInvoicePath)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route forwarding here led to this issue:

Which Melvin corrected by changing the route to:

navigateForwardTo={ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID: route.params.policyID, backTo: workspaceInvoicePath})}

/>
);
}

WorkspaceInvoicesVerifyAccountPage.displayName = 'WorkspaceInvoicesVerifyAccountPage';

export default WorkspaceInvoicesVerifyAccountPage;
Loading