From e3644d1acd2a3bba3ae94caa5a1e5ee2219ad280 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 12 Apr 2024 08:22:14 +0200 Subject: [PATCH 1/8] Remove SCREENS.WORKSPACES_CENTRAL_PANE --- .../Navigators/FullScreenNavigator.tsx | 77 +++++++++++++++-- .../CustomFullScreenRouter.tsx | 20 +---- .../getTopmostWorkspacesCentralPaneName.ts | 17 +--- src/libs/Navigation/linkingConfig/config.ts | 82 +++++++++---------- .../linkingConfig/getAdaptedStateFromPath.ts | 6 +- src/libs/Navigation/types.ts | 56 ++++++++++++- 6 files changed, 172 insertions(+), 86 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index 07b069462dd1..065e11495a01 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -5,7 +5,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import createCustomFullScreenNavigator from '@libs/Navigation/AppNavigator/createCustomFullScreenNavigator'; import getRootNavigatorScreenOptions from '@libs/Navigation/AppNavigator/getRootNavigatorScreenOptions'; -import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackNavigators'; import SCREENS from '@src/SCREENS'; const loadWorkspaceInitialPage = () => require('../../../../pages/workspace/WorkspaceInitialPage').default as React.ComponentType; @@ -17,19 +16,85 @@ function FullScreenNavigator() { const StyleUtils = useStyleUtils(); const {isSmallScreenWidth} = useWindowDimensions(); const screenOptions = getRootNavigatorScreenOptions(isSmallScreenWidth, styles, StyleUtils); - return ( - + require('@pages/workspace/WorkspaceProfilePage').default as React.ComponentType} + /> + require('@pages/workspace/card/WorkspaceCardPage').default as React.ComponentType} + /> + require('@pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType} + /> + require('@pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType} + /> + require('@pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType} + /> + require('@pages/workspace/invoices/WorkspaceInvoicesPage').default as React.ComponentType} + /> + require('@pages/workspace/travel/WorkspaceTravelPage').default as React.ComponentType} + /> + require('@pages/workspace/WorkspaceMembersPage').default as React.ComponentType} + /> + + require('@pages/workspace/accounting/WorkspaceAccountingPage').default as React.ComponentType} + /> + + require('@pages/workspace/categories/WorkspaceCategoriesPage').default as React.ComponentType} + /> + require('@pages/workspace/WorkspaceMoreFeaturesPage').default as React.ComponentType} + /> + require('@pages/workspace/tags/WorkspaceTagsPage').default as React.ComponentType} + /> + require('@pages/workspace/taxes/WorkspaceTaxesPage').default as React.ComponentType} + /> + require('@pages/workspace/distanceRates/PolicyDistanceRatesPage').default as React.ComponentType} /> diff --git a/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx b/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx index eb19f891ecd5..99e6fb23b8ba 100644 --- a/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx @@ -11,11 +11,6 @@ const isAtLeastOneInState = (state: StackState, screenName: string): boolean => function adaptStateIfNecessary(state: StackState) { const isNarrowLayout = getIsNarrowLayout(); const workspaceCentralPane = state.routes.at(-1); - const topmostWorkspaceCentralPaneRoute = workspaceCentralPane?.state?.routes[0]; - - // When a screen from the FullScreenNavigator is opened from the deeplink then params should be passed to SCREENS.WORKSPACE.INITIAL from the variable defined below. - const workspacesCentralPaneParams = - workspaceCentralPane?.params && 'params' in workspaceCentralPane.params ? (workspaceCentralPane.params.params as Record) : undefined; // There should always be WORKSPACE.INITIAL screen in the state to make sure go back works properly if we deeplinkg to a subpage of settings. if (!isAtLeastOneInState(state, SCREENS.WORKSPACE.INITIAL)) { @@ -28,7 +23,7 @@ function adaptStateIfNecessary(state: StackState) { // Unshift the root screen to fill left pane. state.routes.unshift({ name: SCREENS.WORKSPACE.INITIAL, - params: topmostWorkspaceCentralPaneRoute?.params ?? workspacesCentralPaneParams, + params: workspaceCentralPane?.params, }); } } @@ -37,22 +32,15 @@ function adaptStateIfNecessary(state: StackState) { // - WORKSPACE.INITIAL to cover left pane. // - WORKSPACES_CENTRAL_PANE to cover central pane. if (!isNarrowLayout) { - if (!isAtLeastOneInState(state, SCREENS.WORKSPACES_CENTRAL_PANE)) { + if (state.routes.length === 1 && state.routes[0].name === SCREENS.WORKSPACE.INITIAL) { // @ts-expect-error Updating read only property // noinspection JSConstantReassignment state.stale = true; // eslint-disable-line // Push the default settings central pane screen. if (state.stale === true) { state.routes.push({ - name: SCREENS.WORKSPACES_CENTRAL_PANE, - state: { - routes: [ - { - name: SCREENS.WORKSPACE.PROFILE, - params: state.routes[0]?.params, - }, - ], - }, + name: SCREENS.WORKSPACE.PROFILE, + params: state.routes[0]?.params, }); } } diff --git a/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts b/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts index db11368c1345..ec3159ade059 100644 --- a/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts +++ b/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts @@ -1,5 +1,4 @@ import type {NavigationState, PartialState} from '@react-navigation/native'; -import SCREENS from '@src/SCREENS'; // Get the name of topmost report in the navigation stack. function getTopmostWorkspacesCentralPaneName(state: NavigationState | PartialState): string | undefined { @@ -7,21 +6,7 @@ function getTopmostWorkspacesCentralPaneName(state: NavigationState | PartialSta return; } - const topmostCentralPane = state.routes.filter((route) => typeof route !== 'number' && 'name' in route && route.name === SCREENS.WORKSPACES_CENTRAL_PANE).at(-1); - - if (!topmostCentralPane) { - return; - } - - if (!!topmostCentralPane.params && 'screen' in topmostCentralPane.params && typeof topmostCentralPane.params.screen === 'string') { - return topmostCentralPane.params.screen; - } - - if (!topmostCentralPane.state) { - return; - } - - return topmostCentralPane.state?.routes.at(-1)?.name; + return state.routes.at(-1)?.name } export default getTopmostWorkspacesCentralPaneName; diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 95294b7711b5..468a5ce8c3d9 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -635,49 +635,45 @@ const config: LinkingOptions['config'] = { [SCREENS.WORKSPACE.INITIAL]: { path: ROUTES.WORKSPACE_INITIAL.route, }, - [SCREENS.WORKSPACES_CENTRAL_PANE]: { - screens: { - [SCREENS.WORKSPACE.PROFILE]: ROUTES.WORKSPACE_PROFILE.route, - [SCREENS.WORKSPACE.CARD]: { - path: ROUTES.WORKSPACE_CARD.route, - }, - [SCREENS.WORKSPACE.WORKFLOWS]: { - path: ROUTES.WORKSPACE_WORKFLOWS.route, - }, - [SCREENS.WORKSPACE.REIMBURSE]: { - path: ROUTES.WORKSPACE_REIMBURSE.route, - }, - [SCREENS.WORKSPACE.BILLS]: { - path: ROUTES.WORKSPACE_BILLS.route, - }, - [SCREENS.WORKSPACE.INVOICES]: { - path: ROUTES.WORKSPACE_INVOICES.route, - }, - [SCREENS.WORKSPACE.TRAVEL]: { - path: ROUTES.WORKSPACE_TRAVEL.route, - }, - [SCREENS.WORKSPACE.MEMBERS]: { - path: ROUTES.WORKSPACE_MEMBERS.route, - }, - [SCREENS.WORKSPACE.ACCOUNTING]: { - path: ROUTES.WORKSPACE_ACCOUNTING.route, - }, - [SCREENS.WORKSPACE.CATEGORIES]: { - path: ROUTES.WORKSPACE_CATEGORIES.route, - }, - [SCREENS.WORKSPACE.MORE_FEATURES]: { - path: ROUTES.WORKSPACE_MORE_FEATURES.route, - }, - [SCREENS.WORKSPACE.TAGS]: { - path: ROUTES.WORKSPACE_TAGS.route, - }, - [SCREENS.WORKSPACE.TAXES]: { - path: ROUTES.WORKSPACE_TAXES.route, - }, - [SCREENS.WORKSPACE.DISTANCE_RATES]: { - path: ROUTES.WORKSPACE_DISTANCE_RATES.route, - }, - }, + [SCREENS.WORKSPACE.PROFILE]: ROUTES.WORKSPACE_PROFILE.route, + [SCREENS.WORKSPACE.CARD]: { + path: ROUTES.WORKSPACE_CARD.route, + }, + [SCREENS.WORKSPACE.WORKFLOWS]: { + path: ROUTES.WORKSPACE_WORKFLOWS.route, + }, + [SCREENS.WORKSPACE.REIMBURSE]: { + path: ROUTES.WORKSPACE_REIMBURSE.route, + }, + [SCREENS.WORKSPACE.BILLS]: { + path: ROUTES.WORKSPACE_BILLS.route, + }, + [SCREENS.WORKSPACE.INVOICES]: { + path: ROUTES.WORKSPACE_INVOICES.route, + }, + [SCREENS.WORKSPACE.TRAVEL]: { + path: ROUTES.WORKSPACE_TRAVEL.route, + }, + [SCREENS.WORKSPACE.MEMBERS]: { + path: ROUTES.WORKSPACE_MEMBERS.route, + }, + [SCREENS.WORKSPACE.ACCOUNTING]: { + path: ROUTES.WORKSPACE_ACCOUNTING.route, + }, + [SCREENS.WORKSPACE.CATEGORIES]: { + path: ROUTES.WORKSPACE_CATEGORIES.route, + }, + [SCREENS.WORKSPACE.MORE_FEATURES]: { + path: ROUTES.WORKSPACE_MORE_FEATURES.route, + }, + [SCREENS.WORKSPACE.TAGS]: { + path: ROUTES.WORKSPACE_TAGS.route, + }, + [SCREENS.WORKSPACE.TAXES]: { + path: ROUTES.WORKSPACE_TAXES.route, + }, + [SCREENS.WORKSPACE.DISTANCE_RATES]: { + path: ROUTES.WORKSPACE_DISTANCE_RATES.route, }, }, }, diff --git a/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts b/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts index d7bcfbb68952..52e62604c0a5 100644 --- a/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts +++ b/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts @@ -86,11 +86,9 @@ function createFullScreenNavigator(route?: NavigationPartialRoute; + [SCREENS.WORKSPACE.PROFILE]: { + policyID: string; + }; + [SCREENS.WORKSPACE.CARD]: { + policyID: string; + }; + [SCREENS.WORKSPACE.WORKFLOWS]: { + policyID: string; + }; + [SCREENS.WORKSPACE.WORKFLOWS_APPROVER]: { + policyID: string; + }; + [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY]: { + policyID: string; + }; + [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET]: { + policyID: string; + }; + [SCREENS.WORKSPACE.REIMBURSE]: { + policyID: string; + }; + [SCREENS.WORKSPACE.BILLS]: { + policyID: string; + }; + [SCREENS.WORKSPACE.INVOICES]: { + policyID: string; + }; + [SCREENS.WORKSPACE.TRAVEL]: { + policyID: string; + }; + [SCREENS.WORKSPACE.MEMBERS]: { + policyID: string; + }; + [SCREENS.WORKSPACE.ACCOUNTING]: { + policyID: string; + }; + [SCREENS.WORKSPACE.CATEGORIES]: { + policyID: string; + }; + [SCREENS.WORKSPACE.MORE_FEATURES]: { + policyID: string; + }; + [SCREENS.WORKSPACE.TAGS]: { + policyID: string; + tagName: string; + }; + [SCREENS.WORKSPACE.TAXES]: { + policyID: string; + }; + [SCREENS.WORKSPACE.DISTANCE_RATES]: { + policyID: string; + }; + [SCREENS.WORKSPACE.ACCOUNTING]: { + policyID: string; + }; }; type OnboardingModalNavigatorParamList = { From bc8db3bb0d71df4415b80ebe1a79da7368f084cd Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 12 Apr 2024 11:22:09 +0200 Subject: [PATCH 2/8] Refactor FullScreenNavigator --- .../Navigators/FullScreenNavigator.tsx | 99 +++++-------------- .../CustomFullScreenRouter.tsx | 2 +- src/libs/Navigation/getTopmostRouteName.ts | 12 +++ .../getTopmostWorkspacesCentralPaneName.ts | 12 --- src/pages/workspace/WorkspaceInitialPage.tsx | 4 +- 5 files changed, 42 insertions(+), 87 deletions(-) create mode 100644 src/libs/Navigation/getTopmostRouteName.ts delete mode 100644 src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index 065e11495a01..42bca6e2de4c 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -5,12 +5,32 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import createCustomFullScreenNavigator from '@libs/Navigation/AppNavigator/createCustomFullScreenNavigator'; import getRootNavigatorScreenOptions from '@libs/Navigation/AppNavigator/getRootNavigatorScreenOptions'; +import type {FullScreenNavigatorParamList} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; const loadWorkspaceInitialPage = () => require('../../../../pages/workspace/WorkspaceInitialPage').default as React.ComponentType; const RootStack = createCustomFullScreenNavigator(); +type Screens = Partial React.ComponentType>>; + +const workspacesScreens = { + [SCREENS.WORKSPACE.PROFILE]: () => require('../../../../pages/workspace/WorkspaceProfilePage').default as React.ComponentType, + [SCREENS.WORKSPACE.CARD]: () => require('../../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType, + [SCREENS.WORKSPACE.WORKFLOWS]: () => require('../../../../pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType, + [SCREENS.WORKSPACE.REIMBURSE]: () => require('../../../../pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType, + [SCREENS.WORKSPACE.BILLS]: () => require('../../../../pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType, + [SCREENS.WORKSPACE.INVOICES]: () => require('../../../../pages/workspace/invoices/WorkspaceInvoicesPage').default as React.ComponentType, + [SCREENS.WORKSPACE.TRAVEL]: () => require('../../../../pages/workspace/travel/WorkspaceTravelPage').default as React.ComponentType, + [SCREENS.WORKSPACE.MEMBERS]: () => require('../../../../pages/workspace/WorkspaceMembersPage').default as React.ComponentType, + [SCREENS.WORKSPACE.ACCOUNTING]: () => require('../../../../pages/workspace/accounting/WorkspaceAccountingPage').default as React.ComponentType, + [SCREENS.WORKSPACE.CATEGORIES]: () => require('../../../../pages/workspace/categories/WorkspaceCategoriesPage').default as React.ComponentType, + [SCREENS.WORKSPACE.MORE_FEATURES]: () => require('../../../../pages/workspace/WorkspaceMoreFeaturesPage').default as React.ComponentType, + [SCREENS.WORKSPACE.TAGS]: () => require('../../../../pages/workspace/tags/WorkspaceTagsPage').default as React.ComponentType, + [SCREENS.WORKSPACE.TAXES]: () => require('../../../../pages/workspace/taxes/WorkspaceTaxesPage').default as React.ComponentType, + [SCREENS.WORKSPACE.DISTANCE_RATES]: () => require('../../../../pages/workspace/distanceRates/PolicyDistanceRatesPage').default as React.ComponentType, +} satisfies Screens; + function FullScreenNavigator() { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -24,78 +44,13 @@ function FullScreenNavigator() { options={screenOptions.homeScreen} getComponent={loadWorkspaceInitialPage} /> - require('@pages/workspace/WorkspaceProfilePage').default as React.ComponentType} - /> - require('@pages/workspace/card/WorkspaceCardPage').default as React.ComponentType} - /> - require('@pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType} - /> - require('@pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType} - /> - require('@pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType} - /> - require('@pages/workspace/invoices/WorkspaceInvoicesPage').default as React.ComponentType} - /> - require('@pages/workspace/travel/WorkspaceTravelPage').default as React.ComponentType} - /> - require('@pages/workspace/WorkspaceMembersPage').default as React.ComponentType} - /> - - require('@pages/workspace/accounting/WorkspaceAccountingPage').default as React.ComponentType} - /> - - require('@pages/workspace/categories/WorkspaceCategoriesPage').default as React.ComponentType} - /> - require('@pages/workspace/WorkspaceMoreFeaturesPage').default as React.ComponentType} - /> - require('@pages/workspace/tags/WorkspaceTagsPage').default as React.ComponentType} - /> - require('@pages/workspace/taxes/WorkspaceTaxesPage').default as React.ComponentType} - /> - require('@pages/workspace/distanceRates/PolicyDistanceRatesPage').default as React.ComponentType} - /> + {Object.entries(workspacesScreens).map(([screenName, componentGetter]) => ( + + ))} ); diff --git a/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx b/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx index 99e6fb23b8ba..27e976d9be0c 100644 --- a/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx +++ b/src/libs/Navigation/AppNavigator/createCustomFullScreenNavigator/CustomFullScreenRouter.tsx @@ -30,7 +30,7 @@ function adaptStateIfNecessary(state: StackState) { // If the screen is wide, there should be at least two screens inside: // - WORKSPACE.INITIAL to cover left pane. - // - WORKSPACES_CENTRAL_PANE to cover central pane. + // - WORKSPACE.PROFILE (first workspace settings screen) to cover central pane. if (!isNarrowLayout) { if (state.routes.length === 1 && state.routes[0].name === SCREENS.WORKSPACE.INITIAL) { // @ts-expect-error Updating read only property diff --git a/src/libs/Navigation/getTopmostRouteName.ts b/src/libs/Navigation/getTopmostRouteName.ts new file mode 100644 index 000000000000..7ae3afaf2cc9 --- /dev/null +++ b/src/libs/Navigation/getTopmostRouteName.ts @@ -0,0 +1,12 @@ +import type {NavigationState, PartialState} from '@react-navigation/native'; + +// Get the name of topmost route in the navigation stack. +function getTopmostRouteName(state: NavigationState | PartialState): string | undefined { + if (!state) { + return; + } + + return state.routes.at(-1)?.name; +} + +export default getTopmostRouteName; diff --git a/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts b/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts deleted file mode 100644 index ec3159ade059..000000000000 --- a/src/libs/Navigation/getTopmostWorkspacesCentralPaneName.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {NavigationState, PartialState} from '@react-navigation/native'; - -// Get the name of topmost report in the navigation stack. -function getTopmostWorkspacesCentralPaneName(state: NavigationState | PartialState): string | undefined { - if (!state) { - return; - } - - return state.routes.at(-1)?.name -} - -export default getTopmostWorkspacesCentralPaneName; diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index a6a131f5372c..f1c215447e4e 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -19,7 +19,7 @@ import usePrevious from '@hooks/usePrevious'; import useSingleExecution from '@hooks/useSingleExecution'; import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; -import getTopmostWorkspacesCentralPaneName from '@libs/Navigation/getTopmostWorkspacesCentralPaneName'; +import getTopmostRouteName from '@libs/Navigation/getTopmostRouteName'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils'; @@ -68,7 +68,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, policyMembers, r const hasPolicyCreationError = !!(policy?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD && policy.errors); const waitForNavigate = useWaitForNavigation(); const {singleExecution, isExecuting} = useSingleExecution(); - const activeRoute = useNavigationState(getTopmostWorkspacesCentralPaneName); + const activeRoute = useNavigationState(getTopmostRouteName); const {translate} = useLocalize(); const {canUseAccountingIntegrations} = usePermissions(); From a451aaf0ea7d7322f4439d78c0701cfae66bf3be Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 12 Apr 2024 11:42:16 +0200 Subject: [PATCH 3/8] Refactor styles in FullScreenNavigator --- .../AppNavigator/Navigators/FullScreenNavigator.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index 42bca6e2de4c..3b2d64db9778 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -7,6 +7,7 @@ import createCustomFullScreenNavigator from '@libs/Navigation/AppNavigator/creat import getRootNavigatorScreenOptions from '@libs/Navigation/AppNavigator/getRootNavigatorScreenOptions'; import type {FullScreenNavigatorParamList} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; +import useModalScreenOptions from '@libs/Navigation/AppNavigator/ModalStackNavigators/useModalScreenOptions'; const loadWorkspaceInitialPage = () => require('../../../../pages/workspace/WorkspaceInitialPage').default as React.ComponentType; @@ -36,9 +37,11 @@ function FullScreenNavigator() { const StyleUtils = useStyleUtils(); const {isSmallScreenWidth} = useWindowDimensions(); const screenOptions = getRootNavigatorScreenOptions(isSmallScreenWidth, styles, StyleUtils); + const workspaceScreenOptions = useModalScreenOptions((screenStyles) => ({cardStyle: screenStyles.navigationScreenCardStyle, headerShown: false})); + return ( - + Date: Fri, 12 Apr 2024 11:42:44 +0200 Subject: [PATCH 4/8] Remove WorkspaceSettingsModalStackNavigator --- .../WorkspaceSettingsModalStackNavigator.tsx | 89 ------------------- .../ModalStackNavigators/index.tsx | 2 - 2 files changed, 91 deletions(-) delete mode 100644 src/libs/Navigation/AppNavigator/ModalStackNavigators/WorkspaceSettingsModalStackNavigator.tsx diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/WorkspaceSettingsModalStackNavigator.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/WorkspaceSettingsModalStackNavigator.tsx deleted file mode 100644 index 2dce4247c7ae..000000000000 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/WorkspaceSettingsModalStackNavigator.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import {createStackNavigator} from '@react-navigation/stack'; -import React from 'react'; -import SCREENS from '@src/SCREENS'; -import useModalScreenOptions from './useModalScreenOptions'; - -const StackNavigator = createStackNavigator(); - -function WorkspaceSettingsModalStackNavigator() { - const screenOptions = useModalScreenOptions((styles) => ({cardStyle: styles.navigationScreenCardStyle, headerShown: false})); - - return ( - - require('@pages/workspace/WorkspaceProfilePage').default as React.ComponentType} - /> - require('@pages/workspace/card/WorkspaceCardPage').default as React.ComponentType} - /> - require('@pages/workspace/workflows/WorkspaceWorkflowsPage').default as React.ComponentType} - /> - require('@pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType} - /> - require('@pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType} - /> - require('@pages/workspace/invoices/WorkspaceInvoicesPage').default as React.ComponentType} - /> - require('@pages/workspace/travel/WorkspaceTravelPage').default as React.ComponentType} - /> - require('@pages/workspace/WorkspaceMembersPage').default as React.ComponentType} - /> - - require('@pages/workspace/accounting/WorkspaceAccountingPage').default as React.ComponentType} - /> - - require('@pages/workspace/categories/WorkspaceCategoriesPage').default as React.ComponentType} - /> - require('@pages/workspace/WorkspaceMoreFeaturesPage').default as React.ComponentType} - /> - require('@pages/workspace/tags/WorkspaceTagsPage').default as React.ComponentType} - /> - require('@pages/workspace/taxes/WorkspaceTaxesPage').default as React.ComponentType} - /> - require('@pages/workspace/distanceRates/PolicyDistanceRatesPage').default as React.ComponentType} - /> - - ); -} - -export default WorkspaceSettingsModalStackNavigator; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index c251f8143631..e8a5f5d17cb5 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -35,7 +35,6 @@ import type {ThemeStyles} from '@styles/index'; import type {Screen} from '@src/SCREENS'; import SCREENS from '@src/SCREENS'; import useModalScreenOptions from './useModalScreenOptions'; -import WorkspaceSettingsModalStackNavigator from './WorkspaceSettingsModalStackNavigator'; type Screens = Partial React.ComponentType>>; @@ -345,5 +344,4 @@ export { TaskModalStackNavigator, WalletStatementStackNavigator, ProcessMoneyRequestHoldStackNavigator, - WorkspaceSettingsModalStackNavigator, }; From 0578de4d75897be641adddb942c578f4fff13c23 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 12 Apr 2024 12:48:05 +0200 Subject: [PATCH 5/8] Remove wrapper for lhp screens --- src/SCREENS.ts | 3 --- .../ModalStackNavigators/index.tsx | 18 +++--------------- .../Navigators/FullScreenNavigator.tsx | 2 +- .../Navigators/LeftModalNavigator.tsx | 8 +++++--- src/libs/Navigation/linkingConfig/config.ts | 12 ++---------- src/libs/Navigation/types.ts | 16 +++------------- src/pages/SearchPage/index.tsx | 2 +- src/styles/theme/themes/dark.ts | 2 +- src/styles/theme/themes/light.ts | 2 +- tests/perf-test/SearchPage.perf-test.tsx | 2 +- 10 files changed, 18 insertions(+), 49 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index b3c2012e90d2..7b653da0ea29 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -98,9 +98,6 @@ const SCREENS = { SEARCH: 'Search', WORKSPACE_SWITCHER: 'WorkspaceSwitcher', }, - WORKSPACE_SWITCHER: { - ROOT: 'WorkspaceSwitcher_Root', - }, RIGHT_MODAL: { SETTINGS: 'Settings', NEW_CHAT: 'NewChat', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index e8a5f5d17cb5..94298d24f37e 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -22,14 +22,12 @@ import type { ReportSettingsNavigatorParamList, RoomInviteNavigatorParamList, RoomMembersNavigatorParamList, - SearchNavigatorParamList, SettingsNavigatorParamList, SignInNavigatorParamList, SplitDetailsNavigatorParamList, TaskDetailsNavigatorParamList, TeachersUniteNavigatorParamList, WalletStatementNavigatorParamList, - WorkspaceSwitcherNavigatorParamList, } from '@navigation/types'; import type {ThemeStyles} from '@styles/index'; import type {Screen} from '@src/SCREENS'; @@ -142,10 +140,6 @@ const RoomInviteModalStackNavigator = createModalStackNavigator require('../../../../pages/RoomInvitePage').default as React.ComponentType, }); -const SearchModalStackNavigator = createModalStackNavigator({ - [SCREENS.SEARCH_ROOT]: () => require('../../../../pages/SearchPage').default as React.ComponentType, -}); - const NewChatModalStackNavigator = createModalStackNavigator({ [SCREENS.NEW_CHAT.ROOT]: () => require('../../../../pages/NewChatSelectorPage').default as React.ComponentType, [SCREENS.NEW_CHAT.NEW_CHAT_CONFIRM]: () => require('../../../../pages/NewChatConfirmPage').default as React.ComponentType, @@ -173,10 +167,6 @@ const NewTeachersUniteNavigator = createModalStackNavigator require('../../../../pages/TeachersUnite/ImTeacherPage').default as React.ComponentType, }); -const WorkspaceSwitcherModalStackNavigator = createModalStackNavigator({ - [SCREENS.WORKSPACE_SWITCHER.ROOT]: () => require('../../../../pages/WorkspaceSwitcherPage').default as React.ComponentType, -}); - const SettingsModalStackNavigator = createModalStackNavigator({ [SCREENS.SETTINGS.SHARE_CODE]: () => require('../../../../pages/ShareCodePage').default as React.ComponentType, [SCREENS.SETTINGS.PROFILE.PRONOUNS]: () => require('../../../../pages/settings/Profile/PronounsPage').default as React.ComponentType, @@ -318,7 +308,6 @@ const ProcessMoneyRequestHoldStackNavigator = createModalStackNavigator({ export { AddPersonalBankAccountModalStackNavigator, DetailsModalStackNavigator, - OnboardEngagementModalStackNavigator, EditRequestStackNavigator, EnablePaymentsStackNavigator, FlagCommentStackNavigator, @@ -326,22 +315,21 @@ export { NewChatModalStackNavigator, NewTaskModalStackNavigator, NewTeachersUniteNavigator, + OnboardEngagementModalStackNavigator, PrivateNotesModalStackNavigator, + ProcessMoneyRequestHoldStackNavigator, ProfileModalStackNavigator, ReferralModalStackNavigator, - WorkspaceSwitcherModalStackNavigator, ReimbursementAccountModalStackNavigator, + ReportDescriptionModalStackNavigator, ReportDetailsModalStackNavigator, ReportParticipantsModalStackNavigator, ReportSettingsModalStackNavigator, - ReportDescriptionModalStackNavigator, RoomInviteModalStackNavigator, RoomMembersModalStackNavigator, - SearchModalStackNavigator, SettingsModalStackNavigator, SignInModalStackNavigator, SplitDetailsModalStackNavigator, TaskModalStackNavigator, WalletStatementStackNavigator, - ProcessMoneyRequestHoldStackNavigator, }; diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index 3b2d64db9778..f6fdba422fae 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -5,9 +5,9 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import createCustomFullScreenNavigator from '@libs/Navigation/AppNavigator/createCustomFullScreenNavigator'; import getRootNavigatorScreenOptions from '@libs/Navigation/AppNavigator/getRootNavigatorScreenOptions'; +import useModalScreenOptions from '@libs/Navigation/AppNavigator/ModalStackNavigators/useModalScreenOptions'; import type {FullScreenNavigatorParamList} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; -import useModalScreenOptions from '@libs/Navigation/AppNavigator/ModalStackNavigators/useModalScreenOptions'; const loadWorkspaceInitialPage = () => require('../../../../pages/workspace/WorkspaceInitialPage').default as React.ComponentType; diff --git a/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx index 8f76d8fbdd7b..f83f0d7f0d59 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/LeftModalNavigator.tsx @@ -6,7 +6,6 @@ import NoDropZone from '@components/DragAndDrop/NoDropZone'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import ModalNavigatorScreenOptions from '@libs/Navigation/AppNavigator/ModalNavigatorScreenOptions'; -import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackNavigators'; import type {AuthScreensParamList, LeftModalNavigatorParamList} from '@libs/Navigation/types'; import type NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; @@ -14,6 +13,9 @@ import Overlay from './Overlay'; type LeftModalNavigatorProps = StackScreenProps; +const loadSearchPage = () => require('../../../../pages/SearchPage').default as React.ComponentType; +const loadWorkspaceSwitcherPage = () => require('../../../../pages/WorkspaceSwitcherPage').default as React.ComponentType; + const Stack = createStackNavigator(); function LeftModalNavigator({navigation}: LeftModalNavigatorProps) { @@ -33,11 +35,11 @@ function LeftModalNavigator({navigation}: LeftModalNavigatorProps) { diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 468a5ce8c3d9..3e14d0f01ac1 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -67,17 +67,9 @@ const config: LinkingOptions['config'] = { [SCREENS.NOT_FOUND]: '*', [NAVIGATORS.LEFT_MODAL_NAVIGATOR]: { screens: { - [SCREENS.LEFT_MODAL.SEARCH]: { - screens: { - [SCREENS.SEARCH_ROOT]: ROUTES.SEARCH, - }, - }, + [SCREENS.LEFT_MODAL.SEARCH]: ROUTES.SEARCH, [SCREENS.LEFT_MODAL.WORKSPACE_SWITCHER]: { - screens: { - [SCREENS.WORKSPACE_SWITCHER.ROOT]: { - path: ROUTES.WORKSPACE_SWITCHER, - }, - }, + path: ROUTES.WORKSPACE_SWITCHER, }, }, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index c51be87b4191..c8587b2b84c6 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -62,10 +62,6 @@ type CentralPaneNavigatorParamList = { [SCREENS.SETTINGS.SAVE_THE_WORLD]: undefined; }; -type WorkspaceSwitcherNavigatorParamList = { - [SCREENS.WORKSPACE_SWITCHER.ROOT]: undefined; -}; - type BackToParams = { backTo?: Routes; }; @@ -294,10 +290,6 @@ type NewChatNavigatorParamList = { [SCREENS.NEW_CHAT.ROOT]: undefined; }; -type SearchNavigatorParamList = { - [SCREENS.SEARCH_ROOT]: undefined; -}; - type DetailsNavigatorParamList = { [SCREENS.DETAILS_ROOT]: { login: string; @@ -568,8 +560,8 @@ type PrivateNotesNavigatorParamList = { }; type LeftModalNavigatorParamList = { - [SCREENS.LEFT_MODAL.SEARCH]: NavigatorScreenParams; - [SCREENS.LEFT_MODAL.WORKSPACE_SWITCHER]: NavigatorScreenParams; + [SCREENS.LEFT_MODAL.SEARCH]: undefined; + [SCREENS.LEFT_MODAL.WORKSPACE_SWITCHER]: undefined; }; type RightModalNavigatorParamList = { @@ -798,7 +790,7 @@ type AuthScreensParamList = SharedScreensParamList & { }; }; -type RootStackParamList = PublicScreensParamList & AuthScreensParamList & SearchNavigatorParamList; +type RootStackParamList = PublicScreensParamList & AuthScreensParamList & LeftModalNavigatorParamList; type BottomTabName = keyof BottomTabNavigatorParamList; @@ -842,7 +834,6 @@ export type { ParticipantsNavigatorParamList, RoomMembersNavigatorParamList, RoomInviteNavigatorParamList, - SearchNavigatorParamList, NewChatNavigatorParamList, NewTaskNavigatorParamList, TeachersUniteNavigatorParamList, @@ -857,7 +848,6 @@ export type { ReferralDetailsNavigatorParamList, ReimbursementAccountNavigatorParamList, State, - WorkspaceSwitcherNavigatorParamList, OnboardEngagementNavigatorParamList, SwitchPolicyIDParams, FullScreenNavigatorParamList, diff --git a/src/pages/SearchPage/index.tsx b/src/pages/SearchPage/index.tsx index 7d2a5bfecbb8..99c2b084aec0 100644 --- a/src/pages/SearchPage/index.tsx +++ b/src/pages/SearchPage/index.tsx @@ -35,7 +35,7 @@ type SearchPageOnyxProps = { isSearchingForReports: OnyxEntry; }; -type SearchPageProps = SearchPageOnyxProps & StackScreenProps; +type SearchPageProps = SearchPageOnyxProps & StackScreenProps; type Options = OptionsListUtils.Options & {headerMessage: string}; diff --git a/src/styles/theme/themes/dark.ts b/src/styles/theme/themes/dark.ts index e43341f3e8a9..2c3e36a584a2 100644 --- a/src/styles/theme/themes/dark.ts +++ b/src/styles/theme/themes/dark.ts @@ -128,7 +128,7 @@ const darkTheme = { backgroundColor: colors.productDark100, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, - [SCREENS.WORKSPACE_SWITCHER.ROOT]: { + [SCREENS.LEFT_MODAL.WORKSPACE_SWITCHER]: { backgroundColor: colors.productDark100, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, diff --git a/src/styles/theme/themes/light.ts b/src/styles/theme/themes/light.ts index 6444cb9d4073..716deb17893c 100644 --- a/src/styles/theme/themes/light.ts +++ b/src/styles/theme/themes/light.ts @@ -128,7 +128,7 @@ const lightTheme = { backgroundColor: colors.productLight100, statusBarStyle: CONST.STATUS_BAR_STYLE.DARK_CONTENT, }, - [SCREENS.WORKSPACE_SWITCHER.ROOT]: { + [SCREENS.LEFT_MODAL.WORKSPACE_SWITCHER]: { backgroundColor: colors.productLight100, statusBarStyle: CONST.STATUS_BAR_STYLE.DARK_CONTENT, }, diff --git a/tests/perf-test/SearchPage.perf-test.tsx b/tests/perf-test/SearchPage.perf-test.tsx index ea759a1201b2..29bb016230e7 100644 --- a/tests/perf-test/SearchPage.perf-test.tsx +++ b/tests/perf-test/SearchPage.perf-test.tsx @@ -116,7 +116,7 @@ afterEach(() => { PusherHelper.teardown(); }); -type SearchPageProps = StackScreenProps & { +type SearchPageProps = StackScreenProps & { betas: OnyxEntry; reports: OnyxCollection; isSearchingForReports: OnyxEntry; From 46cfbc08a1cf231553d42bc3652cc883f768ca74 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 10 May 2024 12:04:49 +0200 Subject: [PATCH 6/8] Fix transition between pages on small screens --- .../AppNavigator/Navigators/FullScreenNavigator.tsx | 4 +--- .../AppNavigator/getRootNavigatorScreenOptions.ts | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index 10e77def74d1..fa304ed7b0ea 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -5,7 +5,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import createCustomFullScreenNavigator from '@libs/Navigation/AppNavigator/createCustomFullScreenNavigator'; import getRootNavigatorScreenOptions from '@libs/Navigation/AppNavigator/getRootNavigatorScreenOptions'; -import useModalScreenOptions from '@libs/Navigation/AppNavigator/ModalStackNavigators/useModalScreenOptions'; import type {FullScreenNavigatorParamList} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; @@ -37,11 +36,10 @@ function FullScreenNavigator() { const StyleUtils = useStyleUtils(); const {isSmallScreenWidth} = useWindowDimensions(); const screenOptions = getRootNavigatorScreenOptions(isSmallScreenWidth, styles, StyleUtils); - const workspaceScreenOptions = useModalScreenOptions((screenStyles) => ({cardStyle: screenStyles.navigationScreenCardStyle, headerShown: false})); return ( - + modalCardStyleInterpolator(isSmallScreenWidth, true, false, props), + cardStyle: StyleUtils.getNavigationModalCardStyle(), + }, centralPaneNavigator: { title: CONFIG.SITE_TITLE, From 135b28d732a2a305f7fee7cb60bbfcefefa1820b Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Mon, 13 May 2024 10:48:57 +0200 Subject: [PATCH 7/8] Refactor LHP and FullScreenNavigator --- src/SCREENS.ts | 1 - .../AppNavigator/Navigators/FullScreenNavigator.tsx | 2 +- .../AppNavigator/Navigators/LeftModalNavigator.tsx | 4 ++-- .../AppNavigator/getRootNavigatorScreenOptions.ts | 7 ------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 9a6dc515a2c5..a0cce7339732 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -27,7 +27,6 @@ const SCREENS = { MY_TRIPS: 'Travel_MyTrips', TCS: 'Travel_TCS', }, - WORKSPACES_CENTRAL_PANE: 'WorkspacesCentralPane', SEARCH: { CENTRAL_PANE: 'Search_Central_Pane', REPORT_RHP: 'Search_Report_RHP', diff --git a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx index fa304ed7b0ea..1745e350c62d 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/FullScreenNavigator.tsx @@ -39,7 +39,7 @@ function FullScreenNavigator() { return ( - + ; +const loadChatFinder = () => require('../../../../pages/ChatFinderPage').default as React.ComponentType; const loadWorkspaceSwitcherPage = () => require('../../../../pages/WorkspaceSwitcherPage').default as React.ComponentType; const Stack = createStackNavigator(); @@ -35,7 +35,7 @@ function LeftModalNavigator({navigation}: LeftModalNavigatorProps) { modalCardStyleInterpolator(isSmallScreenWidth, true, false, props), - cardStyle: StyleUtils.getNavigationModalCardStyle(), - }, centralPaneNavigator: { title: CONFIG.SITE_TITLE, From e42e4d3f898b4158bdf97fac6e094751dda702a6 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Tue, 14 May 2024 09:35:29 +0200 Subject: [PATCH 8/8] Remove CHAT_FINDER_ROOT from SCREENS --- src/SCREENS.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index a0cce7339732..b59cf7263880 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -352,7 +352,6 @@ const SCREENS = { }, ROOM_MEMBERS_ROOT: 'RoomMembers_Root', ROOM_INVITE_ROOT: 'RoomInvite_Root', - CHAT_FINDER_ROOT: 'ChatFinder_Root', FLAG_COMMENT_ROOT: 'FlagComment_Root', REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount', GET_ASSISTANCE: 'GetAssistance',