From bc52925e37e10729da0208644fffbb13d1060a33 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 6 Sep 2024 14:58:14 -0600 Subject: [PATCH] Merge pull request #48739 from Expensify/marcaaron-addBetaForDefaultCategories [CP Staging] Put Default categories behind beta (cherry picked from commit 34ae114c025251200605e59ecdabfd04150dedd3) (CP triggered by marcaaron) --- .../workspace/categories/WorkspaceCategoriesSettingsPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx index b84a28f00a24..2afb56c54834 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesSettingsPage.tsx @@ -7,6 +7,7 @@ import ScrollView from '@components/ScrollView'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; +import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; @@ -25,6 +26,7 @@ type WorkspaceCategoriesSettingsPageProps = WithPolicyConnectionsProps; function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSettingsPageProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); + const {canUseWorkspaceRules} = usePermissions(); const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0; const policyID = route.params.policyID ?? '-1'; const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`); @@ -92,7 +94,7 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet shouldPlaceSubtitleBelowSwitch /> - {!!currentPolicy && listItems && ( + {!!currentPolicy && listItems && canUseWorkspaceRules && ( <> {translate('workspace.categories.defaultSpendCategories')}