diff --git a/src/CONST.ts b/src/CONST.ts index c485268b55e2..46016e407b04 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -361,8 +361,6 @@ const CONST = { P2P_DISTANCE_REQUESTS: 'p2pDistanceRequests', WORKFLOWS_DELAYED_SUBMISSION: 'workflowsDelayedSubmission', SPOTNANA_TRAVEL: 'spotnanaTravel', - ACCOUNTING_ON_NEW_EXPENSIFY: 'accountingOnNewExpensify', - XERO_ON_NEW_EXPENSIFY: 'xeroOnNewExpensify', NETSUITE_ON_NEW_EXPENSIFY: 'netsuiteOnNewExpensify', REPORT_FIELDS_FEATURE: 'reportFieldsFeature', }, diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 7a9db9f4fbbd..632c86387f70 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -40,14 +40,6 @@ function canUseSpotnanaTravel(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.SPOTNANA_TRAVEL) || canUseAllBetas(betas); } -function canUseAccountingIntegrations(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.ACCOUNTING_ON_NEW_EXPENSIFY) || canUseAllBetas(betas); -} - -function canUseXeroIntegration(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.XERO_ON_NEW_EXPENSIFY) || canUseAllBetas(betas); -} - function canUseNetSuiteIntegration(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.NETSUITE_ON_NEW_EXPENSIFY) || canUseAllBetas(betas); } @@ -73,8 +65,6 @@ export default { canUseP2PDistanceRequests, canUseWorkflowsDelayedSubmission, canUseSpotnanaTravel, - canUseAccountingIntegrations, - canUseXeroIntegration, canUseNetSuiteIntegration, canUseReportFieldsFeature, }; diff --git a/src/pages/workspace/WorkspaceInitialPage.tsx b/src/pages/workspace/WorkspaceInitialPage.tsx index a346461694a5..783f53afcf51 100644 --- a/src/pages/workspace/WorkspaceInitialPage.tsx +++ b/src/pages/workspace/WorkspaceInitialPage.tsx @@ -16,7 +16,6 @@ import ScrollView from '@components/ScrollView'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import usePermissions from '@hooks/usePermissions'; import usePrevious from '@hooks/usePrevious'; import useSingleExecution from '@hooks/useSingleExecution'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -95,7 +94,6 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, reimbursementAcc const {singleExecution, isExecuting} = useSingleExecution(); const activeRoute = useNavigationState(getTopmostRouteName); const {translate} = useLocalize(); - const {canUseAccountingIntegrations} = usePermissions(); const {isOffline} = useNetwork(); const prevPendingFields = usePrevious(policy?.pendingFields); @@ -258,7 +256,7 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, reimbursementAcc }); } - if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED] && canUseAccountingIntegrations) { + if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED]) { protectedCollectPolicyMenuItems.push({ translationKey: 'workspace.common.accounting', icon: Expensicons.Sync, diff --git a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx index 1ea2872c9513..1499f3a0c0b3 100644 --- a/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx +++ b/src/pages/workspace/WorkspaceMoreFeaturesPage.tsx @@ -56,7 +56,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro const styles = useThemeStyles(); const {isSmallScreenWidth} = useWindowDimensions(); const {translate} = useLocalize(); - const {canUseAccountingIntegrations, canUseReportFieldsFeature} = usePermissions(); + const {canUseReportFieldsFeature} = usePermissions(); const hasAccountingConnection = !!policy?.areConnectionsEnabled && !isEmptyObject(policy?.connections); const isSyncTaxEnabled = !!policy?.connections?.quickbooksOnline?.config?.syncTax || !!policy?.connections?.xero?.config?.importTaxRates; const policyID = policy?.id ?? ''; @@ -189,15 +189,12 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro subtitleTranslationKey: 'workspace.moreFeatures.organizeSection.subtitle', items: organizeItems, }, - ]; - - if (canUseAccountingIntegrations) { - sections.push({ + { titleTranslationKey: 'workspace.moreFeatures.integrateSection.title', subtitleTranslationKey: 'workspace.moreFeatures.integrateSection.subtitle', items: integrateItems, - }); - } + }, + ]; const renderItem = useCallback( (item: Item) => ( diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index f2e3744f92e4..c8d0eac3ca44 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -110,7 +110,7 @@ function PolicyAccountingPage({policy, connectionSyncProgress}: PolicyAccounting const styles = useThemeStyles(); const {translate} = useLocalize(); const {isOffline} = useNetwork(); - const {canUseXeroIntegration, canUseNetSuiteIntegration} = usePermissions(); + const {canUseNetSuiteIntegration} = usePermissions(); const {isSmallScreenWidth, windowWidth} = useWindowDimensions(); const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0}); const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); @@ -124,9 +124,7 @@ function PolicyAccountingPage({policy, connectionSyncProgress}: PolicyAccounting isValid(lastSyncProgressDate) && differenceInMinutes(new Date(), lastSyncProgressDate) < CONST.POLICY.CONNECTIONS.SYNC_STAGE_TIMEOUT_MINUTES; - const accountingIntegrations = Object.values(CONST.POLICY.CONNECTIONS.NAME).filter( - (name) => !(name === CONST.POLICY.CONNECTIONS.NAME.XERO && !canUseXeroIntegration) && !(name === CONST.POLICY.CONNECTIONS.NAME.NETSUITE && !canUseNetSuiteIntegration), - ); + const accountingIntegrations = Object.values(CONST.POLICY.CONNECTIONS.NAME).filter((name) => !(name === CONST.POLICY.CONNECTIONS.NAME.NETSUITE && !canUseNetSuiteIntegration)); const connectedIntegration = accountingIntegrations.find((integration) => !!policy?.connections?.[integration]) ?? connectionSyncProgress?.connectionName; const policyID = policy?.id ?? '-1'; const successfulDate = policy?.connections?.quickbooksOnline?.lastSync?.successfulDate;