mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Fixes issue where kiosk mode was not being exited (#68021)
This commit is contained in:
parent
29801a5ec0
commit
d0adcd7d5b
@ -8,6 +8,13 @@ describe('AppChromeService', () => {
|
||||
expect(chromeService.state.getValue().chromeless).toBe(true);
|
||||
});
|
||||
|
||||
it('onToggleSearchBar should clear kiosk mode', () => {
|
||||
const chromeService = new AppChromeService();
|
||||
chromeService.onToggleKioskMode();
|
||||
chromeService.onToggleSearchBar();
|
||||
expect(chromeService.state.getValue().kioskMode).toBeFalsy();
|
||||
});
|
||||
|
||||
it('Ignore state updates when sectionNav and pageNav have new instance but same text, url or active child', () => {
|
||||
const chromeService = new AppChromeService();
|
||||
let stateChanges = 0;
|
||||
|
@ -104,9 +104,15 @@ export class AppChromeService {
|
||||
};
|
||||
|
||||
onToggleSearchBar = () => {
|
||||
const searchBarHidden = !this.state.getValue().searchBarHidden;
|
||||
store.set(this.searchBarStorageKey, searchBarHidden);
|
||||
this.update({ searchBarHidden });
|
||||
const { searchBarHidden, kioskMode } = this.state.getValue();
|
||||
const newSearchBarHidden = !searchBarHidden;
|
||||
store.set(this.searchBarStorageKey, newSearchBarHidden);
|
||||
|
||||
if (kioskMode) {
|
||||
locationService.partial({ kiosk: null });
|
||||
}
|
||||
|
||||
this.update({ searchBarHidden: newSearchBarHidden, kioskMode: null });
|
||||
};
|
||||
|
||||
onToggleKioskMode = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user