mirror of
https://github.com/grafana/grafana.git
synced 2024-12-27 09:21:35 -06:00
Anonymous: Fix anonymous access needs anonymousEnabled in config to show in UI (#79738)
* fix: anonymous access needs anonymousEnabled in config to show * add enabled to tests
This commit is contained in:
parent
524debbe53
commit
ae3cb8231b
@ -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(<ServerStats />);
|
||||
expect(await screen.findByRole('heading', { name: /instance statistics/i })).toBeInTheDocument();
|
||||
|
@ -100,7 +100,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) {
|
||||
|
@ -78,7 +78,7 @@ export default function UserListPage() {
|
||||
onChangeTab={() => setView(TabView.ORG)}
|
||||
data-testid={selectors.tabs.orgUsers}
|
||||
/>
|
||||
{config.featureToggles.displayAnonymousStats && (
|
||||
{config.anonymousEnabled && config.featureToggles.displayAnonymousStats && (
|
||||
<Tab
|
||||
label="Anonymous devices"
|
||||
active={view === TabView.ANON}
|
||||
|
Loading…
Reference in New Issue
Block a user