mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Runtime: remove updateLocation from window context (#42857)
This commit is contained in:
parent
fb05f253d4
commit
e9d2b25db3
@ -1,7 +1,6 @@
|
|||||||
import { UrlQueryMap, PanelData } from '@grafana/data';
|
import { PanelData } from '@grafana/data';
|
||||||
import { getLocationSrv } from '@grafana/runtime';
|
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||||
import { getDashboardSrv } from '../dashboard/services/DashboardSrv';
|
import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||||
import { getTimeSrv } from '../dashboard/services/TimeSrv';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This will setup features that are accessible through the root window location
|
* This will setup features that are accessible through the root window location
|
||||||
@ -12,19 +11,6 @@ import { getTimeSrv } from '../dashboard/services/TimeSrv';
|
|||||||
*/
|
*/
|
||||||
export function initWindowRuntime() {
|
export function initWindowRuntime() {
|
||||||
(window as any).grafanaRuntime = {
|
(window as any).grafanaRuntime = {
|
||||||
/** Navigate the page within the currently loaded application */
|
|
||||||
updateLocation: (path: string, query?: UrlQueryMap) => {
|
|
||||||
if (query?.theme) {
|
|
||||||
throw new Error(`chaning theme requires full page refresh`);
|
|
||||||
}
|
|
||||||
getLocationSrv().update({
|
|
||||||
path,
|
|
||||||
query,
|
|
||||||
replace: true,
|
|
||||||
partial: false,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Get info for the current dashboard. This will include the migrated dashboard JSON */
|
/** Get info for the current dashboard. This will include the migrated dashboard JSON */
|
||||||
getDashboardSaveModel: () => {
|
getDashboardSaveModel: () => {
|
||||||
const d = getDashboardSrv().getCurrent();
|
const d = getDashboardSrv().getCurrent();
|
||||||
|
Loading…
Reference in New Issue
Block a user