[v10.2.x] Anonymous: Fix anonymous access needs anonymousEnabled in config to show in UI (#79747)
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
(cherry picked from commit ae3cb8231b)
Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
co-authored by
Eric Leijonmarck
parent
b27bbadce7
commit
d1bb2b6efb
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 && (
|
||||
<Tab
|
||||
label="Anonymous devices"
|
||||
active={view === TabView.ANON}
|
||||
|
||||
Reference in New Issue
Block a user