From 7c73cd1f39a71f1f9b319a60b05481480f49d8e5 Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Sat, 26 Oct 2024 12:19:28 +0530 Subject: [PATCH 1/5] added Workspace_Downgrade route --- src/ROUTES.ts | 4 +++ src/SCREENS.ts | 1 + src/languages/en.ts | 1 + src/languages/es.ts | 1 + .../ModalStackNavigators/index.tsx | 1 + src/libs/Navigation/linkingConfig/config.ts | 3 ++ src/libs/Navigation/types.ts | 3 ++ .../downgrade/WorkspaceDowngradePage.tsx | 28 +++++++++++++++++++ 8 files changed, 42 insertions(+) create mode 100644 src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx diff --git a/src/ROUTES.ts b/src/ROUTES.ts index c346da6cadcb..00d90063bef1 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -950,6 +950,10 @@ const ROUTES = { getRoute: (policyID: string, featureName: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/upgrade/${encodeURIComponent(featureName)}` as const, backTo), }, + WORKSPACE_DOWNGRADE: { + route: 'settings/workspaces/:policyID/downgrade/', + getRoute: (policyID: string) => `settings/workspaces/${policyID}/downgrade/` as const, + }, WORKSPACE_CATEGORIES_SETTINGS: { route: 'settings/workspaces/:policyID/categories/settings', getRoute: (policyID: string) => `settings/workspaces/${policyID}/categories/settings` as const, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 2e44c5ed5695..7f744c0a6561 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -531,6 +531,7 @@ const SCREENS = { DISTANCE_RATE_TAX_RECLAIMABLE_ON_EDIT: 'Distance_Rate_Tax_Reclaimable_On_Edit', DISTANCE_RATE_TAX_RATE_EDIT: 'Distance_Rate_Tax_Rate_Edit', UPGRADE: 'Workspace_Upgrade', + DOWNGRADE: 'Workspace_Downgrade', RULES: 'Policy_Rules', RULES_CUSTOM_NAME: 'Rules_Custom_Name', RULES_AUTO_APPROVE_REPORTS_UNDER: 'Rules_Auto_Approve_Reports_Under', diff --git a/src/languages/en.ts b/src/languages/en.ts index 5daecbc98e5f..aa59f1144c5c 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -442,6 +442,7 @@ const translations = { drafts: 'Drafts', finished: 'Finished', upgrade: 'Upgrade', + downgrade: 'Downgrade', companyID: 'Company ID', userID: 'User ID', disable: 'Disable', diff --git a/src/languages/es.ts b/src/languages/es.ts index c38e9052bd60..47196385ea17 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -433,6 +433,7 @@ const translations = { drafts: 'Borradores', finished: 'Finalizados', upgrade: 'Mejora', + downgrade: 'Degradar', companyID: 'Empresa ID', userID: 'Usuario ID', disable: 'Deshabilitar', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 35f67e0253c6..b86571f12505 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -272,6 +272,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/categories/ImportCategoriesPage').default, [SCREENS.WORKSPACE.CATEGORIES_IMPORTED]: () => require('../../../../pages/workspace/categories/ImportedCategoriesPage').default, [SCREENS.WORKSPACE.UPGRADE]: () => require('../../../../pages/workspace/upgrade/WorkspaceUpgradePage').default, + [SCREENS.WORKSPACE.DOWNGRADE]: () => require('../../../../pages/workspace/downgrade/WorkspaceDowngradePage').default, [SCREENS.WORKSPACE.MEMBER_DETAILS]: () => require('../../../../pages/workspace/members/WorkspaceMemberDetailsPage').default, [SCREENS.WORKSPACE.MEMBER_NEW_CARD]: () => require('../../../../pages/workspace/members/WorkspaceMemberNewCardPage').default, [SCREENS.WORKSPACE.OWNER_CHANGE_CHECK]: () => require('@pages/workspace/members/WorkspaceOwnerChangeWrapperPage').default, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 6f551d7cc41c..11fadb15901c 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -658,6 +658,9 @@ const config: LinkingOptions['config'] = { featureName: (featureName: string) => decodeURIComponent(featureName), }, }, + [SCREENS.WORKSPACE.DOWNGRADE]: { + path: ROUTES.WORKSPACE_DOWNGRADE.route, + }, [SCREENS.WORKSPACE.CATEGORIES_SETTINGS]: { path: ROUTES.WORKSPACE_CATEGORIES_SETTINGS.route, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 3de07f2c801f..3eae46ac2855 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -248,6 +248,9 @@ type SettingsNavigatorParamList = { featureName: string; backTo?: Routes; }; + [SCREENS.WORKSPACE.DOWNGRADE]: { + policyID: string; + }; [SCREENS.WORKSPACE.CATEGORIES_SETTINGS]: { policyID: string; backTo?: Routes; diff --git a/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx b/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx new file mode 100644 index 000000000000..fb76a80cc0a6 --- /dev/null +++ b/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import ScreenWrapper from '@components/ScreenWrapper'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import Navigation from '@libs/Navigation/Navigation'; + +function WorkspaceDowngradePage() { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + + return ( + + { + Navigation.goBack(); + }} + /> + + ); +} + +export default WorkspaceDowngradePage; From a167c209e563633ee66ce6bc29593d2050131295 Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Mon, 28 Oct 2024 14:30:47 +0530 Subject: [PATCH 2/5] updated workspace downgrade title --- src/languages/en.ts | 4 +++- src/languages/es.ts | 4 +++- src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index dd281a613d3b..a4126a0b1cb5 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -442,7 +442,6 @@ const translations = { drafts: 'Drafts', finished: 'Finished', upgrade: 'Upgrade', - downgrade: 'Downgrade', companyID: 'Company ID', userID: 'User ID', disable: 'Disable', @@ -4058,6 +4057,9 @@ const translations = { gotIt: 'Got it, thanks', }, }, + downgrade: { + title: 'Downgrade your workspace', + }, restrictedAction: { restricted: 'Restricted', actionsAreCurrentlyRestricted: ({workspaceName}: ActionsAreCurrentlyRestricted) => `Actions on the ${workspaceName} workspace are currently restricted`, diff --git a/src/languages/es.ts b/src/languages/es.ts index c857fb6e171c..c3295b6061af 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -433,7 +433,6 @@ const translations = { drafts: 'Borradores', finished: 'Finalizados', upgrade: 'Mejora', - downgrade: 'Degradar', companyID: 'Empresa ID', userID: 'Usuario ID', disable: 'Deshabilitar', @@ -4104,6 +4103,9 @@ const translations = { gotIt: 'Entendido, gracias.', }, }, + downgrade: { + title: 'Bajar de nivel tu espacio de trabajo', + }, restrictedAction: { restricted: 'Restringido', actionsAreCurrentlyRestricted: ({workspaceName}: ActionsAreCurrentlyRestricted) => `Las acciones en el espacio de trabajo ${workspaceName} están actualmente restringidas`, diff --git a/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx b/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx index fb76a80cc0a6..efa7eb63b22b 100644 --- a/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx +++ b/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx @@ -16,7 +16,7 @@ function WorkspaceDowngradePage() { offlineIndicatorStyle={styles.mtAuto} > { Navigation.goBack(); }} From b1eee9d109c10c92c236aee38af3a6db320f067c Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Tue, 29 Oct 2024 09:44:42 +0530 Subject: [PATCH 3/5] added workspace downgrade to workspace profile RHP mapping --- .../linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts index 60cb6f53f697..d282bab770c6 100755 --- a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts @@ -2,7 +2,14 @@ import type {FullScreenName} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; const FULL_SCREEN_TO_RHP_MAPPING: Partial> = { - [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.ADDRESS, SCREENS.WORKSPACE.CURRENCY, SCREENS.WORKSPACE.DESCRIPTION, SCREENS.WORKSPACE.SHARE], + [SCREENS.WORKSPACE.PROFILE]: [ + SCREENS.WORKSPACE.NAME, + SCREENS.WORKSPACE.ADDRESS, + SCREENS.WORKSPACE.CURRENCY, + SCREENS.WORKSPACE.DESCRIPTION, + SCREENS.WORKSPACE.SHARE, + SCREENS.WORKSPACE.DOWNGRADE, + ], [SCREENS.WORKSPACE.MEMBERS]: [ SCREENS.WORKSPACE.INVITE, SCREENS.WORKSPACE.INVITE_MESSAGE, From 5b7010d7e12ea4ea8bd5548d9a2ffc8ab430f0c1 Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Wed, 30 Oct 2024 01:35:11 +0530 Subject: [PATCH 4/5] updated spanish copy for downgrade title --- src/languages/es.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 46236df2cbdd..e834e504f7bc 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -4109,7 +4109,7 @@ const translations = { }, }, downgrade: { - title: 'Bajar de nivel tu espacio de trabajo', + title: 'Desmejora tu espacio de trabajo', }, restrictedAction: { restricted: 'Restringido', From 5bb4ab18751f9c33169c8dfc5e8a03a3568437bd Mon Sep 17 00:00:00 2001 From: jayeshmangwani Date: Wed, 30 Oct 2024 21:17:13 +0530 Subject: [PATCH 5/5] removed downgrade page this PR --- src/languages/en.ts | 3 -- src/languages/es.ts | 3 -- .../ModalStackNavigators/index.tsx | 1 - .../downgrade/WorkspaceDowngradePage.tsx | 28 ------------------- 4 files changed, 35 deletions(-) delete mode 100644 src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx diff --git a/src/languages/en.ts b/src/languages/en.ts index af4719e61dd1..0d261c5f84eb 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -4065,9 +4065,6 @@ const translations = { gotIt: 'Got it, thanks', }, }, - downgrade: { - title: 'Downgrade your workspace', - }, restrictedAction: { restricted: 'Restricted', actionsAreCurrentlyRestricted: ({workspaceName}: ActionsAreCurrentlyRestricted) => `Actions on the ${workspaceName} workspace are currently restricted`, diff --git a/src/languages/es.ts b/src/languages/es.ts index 50a4bafa354c..186ef67580d6 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -4111,9 +4111,6 @@ const translations = { gotIt: 'Entendido, gracias.', }, }, - downgrade: { - title: 'Desmejora tu espacio de trabajo', - }, restrictedAction: { restricted: 'Restringido', actionsAreCurrentlyRestricted: ({workspaceName}: ActionsAreCurrentlyRestricted) => `Las acciones en el espacio de trabajo ${workspaceName} están actualmente restringidas`, diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 6fe1ea14582e..8a64424c8f7d 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -273,7 +273,6 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/workspace/categories/ImportCategoriesPage').default, [SCREENS.WORKSPACE.CATEGORIES_IMPORTED]: () => require('../../../../pages/workspace/categories/ImportedCategoriesPage').default, [SCREENS.WORKSPACE.UPGRADE]: () => require('../../../../pages/workspace/upgrade/WorkspaceUpgradePage').default, - [SCREENS.WORKSPACE.DOWNGRADE]: () => require('../../../../pages/workspace/downgrade/WorkspaceDowngradePage').default, [SCREENS.WORKSPACE.MEMBER_DETAILS]: () => require('../../../../pages/workspace/members/WorkspaceMemberDetailsPage').default, [SCREENS.WORKSPACE.MEMBER_NEW_CARD]: () => require('../../../../pages/workspace/members/WorkspaceMemberNewCardPage').default, [SCREENS.WORKSPACE.OWNER_CHANGE_CHECK]: () => require('@pages/workspace/members/WorkspaceOwnerChangeWrapperPage').default, diff --git a/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx b/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx deleted file mode 100644 index efa7eb63b22b..000000000000 --- a/src/pages/workspace/downgrade/WorkspaceDowngradePage.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; - -function WorkspaceDowngradePage() { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - - return ( - - { - Navigation.goBack(); - }} - /> - - ); -} - -export default WorkspaceDowngradePage;