From 30f8e5da79825d1aabb5a4f725739021937fff45 Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Thu, 8 Feb 2024 16:14:10 +0200 Subject: [PATCH] Update workspace naming from Overview to Profile --- src/CONST.ts | 2 +- src/ROUTES.ts | 18 +++++++++--------- src/SCREENS.ts | 6 +++--- src/components/IFrame.tsx | 2 +- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- .../AppNavigator/ModalStackNavigators.tsx | 2 +- .../BaseCentralPaneNavigator.tsx | 2 +- .../AppNavigator/getPartialStateDiff.ts | 6 +++--- .../CENTRAL_PANE_TO_RHP_MAPPING.ts | 2 +- .../TAB_TO_CENTRAL_PANE_MAPPING.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 6 +++--- src/libs/Navigation/switchPolicyID.ts | 6 +++--- src/libs/Navigation/types.ts | 2 +- src/pages/workspace/WorkspaceInitialPage.js | 6 +++--- ...Page.js => WorkspaceProfileCurrencyPage.js} | 0 ...OverviewPage.js => WorkspaceProfilePage.js} | 18 +++++++++--------- 17 files changed, 42 insertions(+), 42 deletions(-) rename src/pages/workspace/{WorkspaceOverviewCurrencyPage.js => WorkspaceProfileCurrencyPage.js} (100%) rename src/pages/workspace/{WorkspaceOverviewPage.js => WorkspaceProfilePage.js} (93%) diff --git a/src/CONST.ts b/src/CONST.ts index d086eed45a13..2721beff459b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1508,7 +1508,7 @@ const CONST = { GUIDES_CALL_TASK_IDS: { CONCIERGE_DM: 'NewExpensifyConciergeDM', WORKSPACE_INITIAL: 'WorkspaceHome', - WORKSPACE_OVERVIEW: 'WorkspaceOverview', + WORKSPACE_PROFILE: 'WorkspaceProfile', WORKSPACE_CARD: 'WorkspaceCorporateCards', WORKSPACE_REIMBURSE: 'WorkspaceReimburseReceipts', WORKSPACE_BILLS: 'WorkspacePayBills', diff --git a/src/ROUTES.ts b/src/ROUTES.ts index e3a78cbff39d..5a2ab8cfc7de 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -436,17 +436,17 @@ const ROUTES = { route: 'workspace/:policyID/invite-message', getRoute: (policyID: string) => `workspace/${policyID}/invite-message` as const, }, - WORKSPACE_OVERVIEW: { - route: 'workspace/:policyID/overview', - getRoute: (policyID: string) => `workspace/${policyID}/overview` as const, + WORKSPACE_PROFILE: { + route: 'workspace/:policyID/profile', + getRoute: (policyID: string) => `workspace/${policyID}/profile` as const, }, - WORKSPACE_OVERVIEW_CURRENCY: { - route: 'workspace/:policyID/overview/currency', - getRoute: (policyID: string) => `workspace/${policyID}/overview/currency` as const, + WORKSPACE_PROFILE_CURRENCY: { + route: 'workspace/:policyID/profile/currency', + getRoute: (policyID: string) => `workspace/${policyID}/profile/currency` as const, }, - WORKSPACE_OVERVIEW_NAME: { - route: 'workspace/:policyID/overview/name', - getRoute: (policyID: string) => `workspace/${policyID}/overview/name` as const, + WORKSPACE_PROFILE_NAME: { + route: 'workspace/:policyID/profile/name', + getRoute: (policyID: string) => `workspace/${policyID}/profile/name` as const, }, WORKSPACE_AVATAR: { route: 'workspace/:policyID/avatar', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index cd80937a3864..1d7c77bf129c 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -194,7 +194,7 @@ const SCREENS = { WORKSPACE: { INITIAL: 'Workspace_Initial', - OVERVIEW: 'Workspace_Overview', + PROFILE: 'Workspace_Profile', CARD: 'Workspace_Card', REIMBURSE: 'Workspace_Reimburse', RATE_AND_UNIT: 'Workspace_RateAndUnit', @@ -204,8 +204,8 @@ const SCREENS = { MEMBERS: 'Workspace_Members', INVITE: 'Workspace_Invite', INVITE_MESSAGE: 'Workspace_Invite_Message', - CURRENCY: 'Workspace_Overview_Currency', - NAME: 'Workspace_Overview_Name', + CURRENCY: 'Workspace_Profile_Currency', + NAME: 'Workspace_Profile_Name', }, EDIT_REQUEST: { diff --git a/src/components/IFrame.tsx b/src/components/IFrame.tsx index ab27597aeebd..05da3a1edb9c 100644 --- a/src/components/IFrame.tsx +++ b/src/components/IFrame.tsx @@ -37,7 +37,7 @@ function getNewDotURL(url: string): string { if (pathname === 'policy') { const workspaceID = params.policyID || ''; - const section = urlObj.hash.slice(1) || 'overview'; + const section = urlObj.hash.slice(1) || 'profile'; return `workspace/${workspaceID}/${section}`; } diff --git a/src/languages/en.ts b/src/languages/en.ts index 0781bb6b19f3..6c51cc681ed3 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1539,7 +1539,7 @@ export default { travel: 'Travel', members: 'Members', plan: 'Plan', - overview: 'Overview', + profile: 'Profile', bankAccount: 'Bank account', connectBankAccount: 'Connect bank account', testTransactions: 'Test transactions', diff --git a/src/languages/es.ts b/src/languages/es.ts index f31bc4c367fc..465bc46c8c0b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1561,7 +1561,7 @@ export default { travel: 'Viajes', members: 'Miembros', plan: 'Plan', - overview: 'DescripciĆ³n', + profile: 'Perfil', bankAccount: 'Cuenta bancaria', connectBankAccount: 'Conectar cuenta bancaria', testTransactions: 'Transacciones de prueba', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index c7be135e8b57..b0ec6d1f3a94 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -242,7 +242,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/workspace/WorkspaceInvitePage').default as React.ComponentType, [SCREENS.WORKSPACE.INVITE_MESSAGE]: () => require('../../../pages/workspace/WorkspaceInviteMessagePage').default as React.ComponentType, [SCREENS.WORKSPACE.NAME]: () => require('../../../pages/workspace/WorkspaceNamePage').default as React.ComponentType, - [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceOverviewCurrencyPage').default as React.ComponentType, + [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceProfileCurrencyPage').default as React.ComponentType, [SCREENS.REIMBURSEMENT_ACCOUNT]: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default as React.ComponentType, [SCREENS.GET_ASSISTANCE]: () => require('../../../pages/GetAssistancePage').default as React.ComponentType, [SCREENS.SETTINGS.TWO_FACTOR_AUTH]: () => require('../../../pages/settings/Security/TwoFactorAuth/TwoFactorAuthPage').default as React.ComponentType, diff --git a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx index 53928b71be4e..087e963b3892 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx @@ -15,7 +15,7 @@ type Screens = Partial React.C const workspaceSettingsScreens = { [SCREENS.SETTINGS.WORKSPACES]: () => require('../../../../../pages/workspace/WorkspacesListPage').default as React.ComponentType, - [SCREENS.WORKSPACE.OVERVIEW]: () => require('../../../../../pages/workspace/WorkspaceOverviewPage').default as React.ComponentType, + [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.REIMBURSE]: () => require('../../../../../pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType, [SCREENS.WORKSPACE.BILLS]: () => require('../../../../../pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType, diff --git a/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts b/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts index a22185422a11..b0825b4b2991 100644 --- a/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts +++ b/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts @@ -26,9 +26,9 @@ type GetPartialStateDiffReturnType = { * This function returns partial additive diff between the two states. * * Example: Let's start with state A on route /r/123. If the screen is wide we will have a HOME opened on bottom tab and REPORT on central pane. - * Now let's say we want to navigate to /workspace/345/overview. We will generate state B from this path. - * State B will have WORKSPACE_INITIAL on the bottom tab and WORKSPACE_OVERVIEW on the central pane. - * Now we will generate partial diff between state A and state B. The diff will tell us that we need to push WORKSPACE_INITIAL on the bottom tab and WORKSPACE_OVERVIEW on the central pane. + * Now let's say we want to navigate to /workspace/345/profile. We will generate state B from this path. + * State B will have WORKSPACE_INITIAL on the bottom tab and WORKSPACE_PROFILE on the central pane. + * Now we will generate partial diff between state A and state B. The diff will tell us that we need to push WORKSPACE_INITIAL on the bottom tab and WORKSPACE_PROFILE on the central pane. * * Then we can generate actions from this diff and dispatch them to the linkTo function. * diff --git a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts index d61b36871434..d96ad416832d 100755 --- a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts @@ -2,7 +2,7 @@ import type {CentralPaneName} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; const CENTRAL_PANE_TO_RHP_MAPPING: Partial> = { - [SCREENS.WORKSPACE.OVERVIEW]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY], + [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY], [SCREENS.WORKSPACE.REIMBURSE]: [SCREENS.WORKSPACE.RATE_AND_UNIT], [SCREENS.WORKSPACE.MEMBERS]: [SCREENS.WORKSPACE.INVITE, SCREENS.WORKSPACE.INVITE_MESSAGE], }; diff --git a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts index 3344cffe94ae..446fb479ea09 100755 --- a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts @@ -5,7 +5,7 @@ const TAB_TO_CENTRAL_PANE_MAPPING: Record = { [SCREENS.HOME]: [SCREENS.REPORT], [SCREENS.ALL_SETTINGS]: [SCREENS.SETTINGS.WORKSPACES], [SCREENS.WORKSPACE.INITIAL]: [ - SCREENS.WORKSPACE.OVERVIEW, + SCREENS.WORKSPACE.PROFILE, SCREENS.WORKSPACE.CARD, SCREENS.WORKSPACE.REIMBURSE, SCREENS.WORKSPACE.BILLS, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 12577e360784..ab218adc3879 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -42,7 +42,7 @@ const config: LinkingOptions['config'] = { [SCREENS.REPORT]: ROUTES.REPORT_WITH_ID.route, [SCREENS.SETTINGS.WORKSPACES]: ROUTES.SETTINGS_WORKSPACES, - [SCREENS.WORKSPACE.OVERVIEW]: ROUTES.WORKSPACE_OVERVIEW.route, + [SCREENS.WORKSPACE.PROFILE]: ROUTES.WORKSPACE_PROFILE.route, [SCREENS.WORKSPACE.CARD]: { path: ROUTES.WORKSPACE_CARD.route, }, @@ -224,7 +224,7 @@ const config: LinkingOptions['config'] = { path: ROUTES.SETTINGS_STATUS_CLEAR_AFTER_TIME, }, [SCREENS.WORKSPACE.CURRENCY]: { - path: ROUTES.WORKSPACE_OVERVIEW_CURRENCY.route, + path: ROUTES.WORKSPACE_PROFILE_CURRENCY.route, }, [SCREENS.WORKSPACE.RATE_AND_UNIT]: { path: ROUTES.WORKSPACE_RATE_AND_UNIT.route, @@ -245,7 +245,7 @@ const config: LinkingOptions['config'] = { [SCREENS.KEYBOARD_SHORTCUTS]: { path: ROUTES.KEYBOARD_SHORTCUTS, }, - [SCREENS.WORKSPACE.NAME]: ROUTES.WORKSPACE_OVERVIEW_NAME.route, + [SCREENS.WORKSPACE.NAME]: ROUTES.WORKSPACE_PROFILE_NAME.route, }, }, [SCREENS.RIGHT_MODAL.PRIVATE_NOTES]: { diff --git a/src/libs/Navigation/switchPolicyID.ts b/src/libs/Navigation/switchPolicyID.ts index 4b9259c76ad7..02c52c09d0cf 100644 --- a/src/libs/Navigation/switchPolicyID.ts +++ b/src/libs/Navigation/switchPolicyID.ts @@ -122,9 +122,9 @@ export default function switchPolicyID(navigation: NavigationContainerRef Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW.getRoute(policy.id)))), + action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE.getRoute(policy.id)))), brickRoadIndicator: hasGeneralSettingsError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '', - routeName: SCREENS.WORKSPACE.OVERVIEW, + routeName: SCREENS.WORKSPACE.PROFILE, }, ].concat(shouldShowProtectedItems ? protectedMenuItems : []); diff --git a/src/pages/workspace/WorkspaceOverviewCurrencyPage.js b/src/pages/workspace/WorkspaceProfileCurrencyPage.js similarity index 100% rename from src/pages/workspace/WorkspaceOverviewCurrencyPage.js rename to src/pages/workspace/WorkspaceProfileCurrencyPage.js diff --git a/src/pages/workspace/WorkspaceOverviewPage.js b/src/pages/workspace/WorkspaceProfilePage.js similarity index 93% rename from src/pages/workspace/WorkspaceOverviewPage.js rename to src/pages/workspace/WorkspaceProfilePage.js index dd3945136c47..990ad3c717ae 100644 --- a/src/pages/workspace/WorkspaceOverviewPage.js +++ b/src/pages/workspace/WorkspaceProfilePage.js @@ -50,23 +50,23 @@ const defaultProps = { ...policyDefaultProps, }; -function WorkspaceOverviewPage({policy, currencyList, route}) { +function WorkspaceProfilePage({policy, currencyList, route}) { const styles = useThemeStyles(); const {translate} = useLocalize(); const formattedCurrency = !_.isEmpty(policy) && !_.isEmpty(currencyList) ? `${policy.outputCurrency} - ${currencyList[policy.outputCurrency].symbol}` : ''; - const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW_CURRENCY.getRoute(policy.id)), [policy.id]); - const onPressName = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW_NAME.getRoute(policy.id)), [policy.id]); + const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy.id)), [policy.id]); + const onPressName = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_NAME.getRoute(policy.id)), [policy.id]); const policyName = lodashGet(policy, 'name', ''); const readOnly = !PolicyUtils.isPolicyAdmin(policy); return (