TopNav: KioskMode rewrite move to AppChrome responsibility and make it a global feature (#55149)

* Initial progress

* Moving keybindingSrv to context

* Simplfy KioskMode

* Removed unused logic

* Make kiosk=tv behave as before but when topnav is enabled

* Minor fix

* Fixing tests

* Fixing bug with notice when entering kiosk mode

* Fixed test
This commit is contained in:
Torkel Ödegaard
2022-09-15 14:04:58 +02:00
committed by GitHub
parent 7352c181c2
commit b8e72d6173
24 changed files with 216 additions and 143 deletions

View File

@@ -4,7 +4,7 @@ import { notifyApp } from 'app/core/actions';
import appEvents from 'app/core/app_events';
import { createErrorNotification } from 'app/core/copy/appNotification';
import { backendSrv } from 'app/core/services/backend_srv';
import { keybindingSrv } from 'app/core/services/keybindingSrv';
import { KeybindingSrv } from 'app/core/services/keybindingSrv';
import store from 'app/core/store';
import { dashboardLoaderSrv } from 'app/features/dashboard/services/DashboardLoaderSrv';
import { DashboardSrv, getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
@@ -32,6 +32,7 @@ export interface InitDashboardArgs {
accessToken?: string;
routeName?: string;
fixUrl: boolean;
keybindingSrv: KeybindingSrv;
}
async function fetchDashboard(
@@ -213,7 +214,7 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
dashboard.autoFitPanels(window.innerHeight, queryParams.kiosk);
}
keybindingSrv.setupDashboardBindings(dashboard);
args.keybindingSrv.setupDashboardBindings(dashboard);
} catch (err) {
if (err instanceof Error) {
dispatch(notifyApp(createErrorNotification('Dashboard init failed', err)));