From 721aed67ab3b9836ddba358bf25a157fa2f036e4 Mon Sep 17 00:00:00 2001 From: paulnjs Date: Thu, 16 Oct 2025 15:45:05 +0700 Subject: [PATCH 1/7] Don't show New workspace button when the restrict policy creation security group is enabled --- .../FloatingActionButtonAndPopover.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx index a2ca03cbaa3b..9cb30b6847be 100644 --- a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx @@ -179,7 +179,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, ref }, [allPolicies]); const shouldShowCreateReportOption = shouldRedirectToExpensifyClassic || groupPoliciesWithChatEnabled.length > 0; - const shouldShowNewWorkspaceButton = Object.values(allPolicies ?? {}).every((policy) => !shouldShowPolicy(policy as OnyxEntry, !!isOffline, session?.email)); + const shouldShowNewWorkspaceButton = Object.values(allPolicies ?? {}).every((policy) => !shouldShowPolicy(policy as OnyxEntry, !!isOffline, session?.email)) && !isRestrictedToPreferredPolicy; const quickActionAvatars = useMemo(() => { if (isValidReport) { diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index 8f134a1b6daa..bb0d5cb5fa38 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -526,15 +526,20 @@ function WorkspacesListPage() { ); - const getHeaderButton = () => ( -