diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index 32cc58783a1..3ba7500d4da 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -343,7 +343,10 @@ const AdminDefinition: AdminDefinitionType = { id: 'WorkspaceOptimizationDashboard', component: WorkspaceOptimizationDashboard, }, - isHidden: it.not(it.userHasReadPermissionOnResource(RESOURCE_KEYS.REPORTING.SITE_STATISTICS)), + isHidden: it.any( + it.not(it.userHasReadPermissionOnResource(RESOURCE_KEYS.REPORTING.SITE_STATISTICS)), + it.licensedForFeature('Cloud'), + ), isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.REPORTING.SITE_STATISTICS)), }, system_analytics: { diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx index de149577905..0bf8b1baa2c 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx @@ -12,7 +12,7 @@ import AdminSidebar from 'components/admin_console/admin_sidebar/admin_sidebar'; import type {Props as OriginalProps} from 'components/admin_console/admin_sidebar/admin_sidebar'; import {samplePlugin1} from 'tests/helpers/admin_console_plugin_index_sample_pluings'; -import {renderWithContext, userEvent} from 'tests/react_testing_utils'; +import {renderWithContext, screen, userEvent} from 'tests/react_testing_utils'; import {generateIndex} from 'utils/admin_console_index'; jest.mock('utils/utils', () => { @@ -129,6 +129,18 @@ describe('components/AdminSidebar', () => { expect(container).toMatchSnapshot(); }); + test('should not show Workspace Optimization when Cloud license feature is enabled', () => { + const props = { + ...defaultProps, + license: { + IsLicensed: 'true', + Cloud: 'true', + }, + }; + renderWithContext(); + expect(screen.queryByText('Workspace Optimization')).not.toBeInTheDocument(); + }); + test('should match snapshot, no access', () => { const props = { ...defaultProps,