mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: Clear current dashboard when moving away from dashboard (#66538)
This commit is contained in:
parent
380843de36
commit
3cb14074a9
@ -50,14 +50,11 @@ export class DashboardSrv {
|
||||
return new DashboardModel(dashboard, meta);
|
||||
}
|
||||
|
||||
setCurrent(dashboard: DashboardModel) {
|
||||
setCurrent(dashboard: DashboardModel | undefined) {
|
||||
this.dashboard = dashboard;
|
||||
}
|
||||
|
||||
getCurrent(): DashboardModel | undefined {
|
||||
if (!this.dashboard) {
|
||||
console.warn('Calling getDashboardSrv().getCurrent() without calling getDashboardSrv().setCurrent() first.');
|
||||
}
|
||||
return this.dashboard;
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import { DashboardAcl, DashboardAclUpdateDTO, NewDashboardAclItem, PermissionLev
|
||||
|
||||
import { loadPluginDashboards } from '../../plugins/admin/state/actions';
|
||||
import { cancelVariables } from '../../variables/state/actions';
|
||||
import { getDashboardSrv } from '../services/DashboardSrv';
|
||||
import { getTimeSrv } from '../services/TimeSrv';
|
||||
|
||||
import { cleanUpDashboard, loadDashboardPermissions } from './reducers';
|
||||
@ -124,10 +125,12 @@ export const cleanUpDashboardAndVariables = (): ThunkResult<void> => (dispatch,
|
||||
}
|
||||
|
||||
getTimeSrv().stopAutoRefresh();
|
||||
|
||||
dispatch(cleanUpDashboard());
|
||||
dispatch(removeAllPanels());
|
||||
|
||||
dashboardWatcher.leave();
|
||||
|
||||
getDashboardSrv().setCurrent(undefined);
|
||||
};
|
||||
|
||||
export const updateTimeZoneDashboard =
|
||||
|
Loading…
Reference in New Issue
Block a user