From eec991d9be4d671035c35579d845071a9b76aa04 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 16 Sep 2024 18:51:39 +0200 Subject: [PATCH] Remove workspace feeds beta --- src/CONST.ts | 1 - src/libs/Permissions.ts | 5 ----- src/pages/workspace/WorkspaceMoreFeaturesPage.tsx | 12 ++++-------- .../workspace/accounting/PolicyAccountingPage.tsx | 4 +--- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 86cbd4c28fc9..daf32cdde4fd 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -467,7 +467,6 @@ const CONST = { P2P_DISTANCE_REQUESTS: 'p2pDistanceRequests', SPOTNANA_TRAVEL: 'spotnanaTravel', REPORT_FIELDS_FEATURE: 'reportFieldsFeature', - WORKSPACE_FEEDS: 'workspaceFeeds', COMPANY_CARD_FEEDS: 'companyCardFeeds', NETSUITE_USA_TAX: 'netsuiteUsaTax', NEW_DOT_COPILOT: 'newDotCopilot', diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 8c47100e465b..368068c48b93 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -24,10 +24,6 @@ function canUseSpotnanaTravel(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.SPOTNANA_TRAVEL) || canUseAllBetas(betas); } -function canUseWorkspaceFeeds(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.WORKSPACE_FEEDS) || canUseAllBetas(betas); -} - function canUseCompanyCardFeeds(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.COMPANY_CARD_FEEDS) || canUseAllBetas(betas); } @@ -62,7 +58,6 @@ export default { canUseDupeDetection, canUseP2PDistanceRequests, canUseSpotnanaTravel, - canUseWorkspaceFeeds, canUseCompanyCardFeeds, canUseNetSuiteUSATax, canUseNewDotCopilot, diff --git a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx index bd6f9ce158f3..8d8473175333 100644 --- a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx +++ b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx @@ -63,7 +63,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro const styles = useThemeStyles(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const {translate} = useLocalize(); - const {canUseWorkspaceFeeds, canUseWorkspaceRules, canUseCompanyCardFeeds} = usePermissions(); + const {canUseWorkspaceRules, canUseCompanyCardFeeds} = usePermissions(); const hasAccountingConnection = !isEmptyObject(policy?.connections); const isAccountingEnabled = !!policy?.areConnectionsEnabled || !isEmptyObject(policy?.connections); const isSyncTaxEnabled = @@ -100,11 +100,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro DistanceRate.enablePolicyDistanceRates(policyID, isEnabled); }, }, - ]; - - // TODO remove this when feature will be fully done, and move spend item inside spendItems array - if (canUseWorkspaceFeeds) { - spendItems.push({ + { icon: Illustrations.HandCard, titleTranslationKey: 'workspace.moreFeatures.expensifyCard.title', subtitleTranslationKey: 'workspace.moreFeatures.expensifyCard.subtitle', @@ -120,8 +116,8 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro disabledAction: () => { setIsDisableExpensifyCardWarningModalOpen(true); }, - }); - } + }, + ]; if (canUseCompanyCardFeeds) { spendItems.push({ diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 264b9b1b720a..e70250031b5f 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -67,7 +67,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); const [datetimeToRelative, setDateTimeToRelative] = useState(''); const threeDotsMenuContainerRef = useRef(null); - const {canUseWorkspaceFeeds} = usePermissions(); const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext(); const route = useRoute(); @@ -301,7 +300,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { }, ]; - if (!canUseWorkspaceFeeds || !policy?.areExpensifyCardsEnabled) { + if (!policy?.areExpensifyCardsEnabled) { configurationOptions.splice(2, 1); } @@ -356,7 +355,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { styles.pb0, styles.mt5, styles.popoverMenuIcon, - canUseWorkspaceFeeds, styles.justifyContentCenter, connectionSyncProgress?.stageInProgress, datetimeToRelative,