diff --git a/public/app/features/admin/ServerStats.test.tsx b/public/app/features/admin/ServerStats.test.tsx index 4c1d85d189c..b658800f12b 100644 --- a/public/app/features/admin/ServerStats.test.tsx +++ b/public/app/features/admin/ServerStats.test.tsx @@ -52,6 +52,7 @@ describe('ServerStats', () => { it('Should render page with anonymous stats', async () => { config.featureToggles.displayAnonymousStats = true; + config.anonymousEnabled = true; config.anonymousDeviceLimit = 10; render(); expect(await screen.findByRole('heading', { name: /instance statistics/i })).toBeInTheDocument(); diff --git a/public/app/features/admin/ServerStats.tsx b/public/app/features/admin/ServerStats.tsx index d0752d46204..1fca8285162 100644 --- a/public/app/features/admin/ServerStats.tsx +++ b/public/app/features/admin/ServerStats.tsx @@ -102,7 +102,7 @@ export const ServerStats = () => { }; const getAnonymousStatsContent = (stats: ServerStat | null, config: GrafanaBootConfig) => { - if (!config.featureToggles.displayAnonymousStats || !stats?.activeDevices) { + if (!config.anonymousEnabled || !config.featureToggles.displayAnonymousStats || !stats?.activeDevices) { return []; } if (!config.anonymousDeviceLimit) { diff --git a/public/app/features/admin/UserListPage.tsx b/public/app/features/admin/UserListPage.tsx index 918a78c99d8..1f1eb6ad311 100644 --- a/public/app/features/admin/UserListPage.tsx +++ b/public/app/features/admin/UserListPage.tsx @@ -77,7 +77,7 @@ export default function UserListPage() { onChangeTab={() => setView(TabView.ORG)} data-testid={selectors.tabs.orgUsers} /> - {config.featureToggles.displayAnonymousStats && ( + {config.anonymousEnabled && config.featureToggles.displayAnonymousStats && (