TimeSrv: Refactor service to have no dependency on angular (#32562)

* TimeSrv: Refactor service to have no dependency on angular

* Fixing reference to function that does not exist

* fixing tests

* Worked around the strange error
This commit is contained in:
Torkel Ödegaard
2021-04-01 06:33:11 +02:00
committed by GitHub
parent 1399b49c16
commit 6fa7c6b206
18 changed files with 93 additions and 112 deletions

View File

@@ -15,6 +15,7 @@ import { loadPanelPlugin } from 'app/features/plugins/state/actions';
import { DashboardAcl, DashboardAclUpdateDTO, NewDashboardAclItem, PermissionLevel, ThunkResult } from 'app/types';
import { PanelModel } from './PanelModel';
import { cancelVariables } from '../../variables/state/actions';
import { getTimeSrv } from '../services/TimeSrv';
export function getDashboardPermissions(id: number): ThunkResult<void> {
return async (dispatch) => {
@@ -168,6 +169,8 @@ export const cleanUpDashboardAndVariables = (): ThunkResult<void> => (dispatch,
dashboard.destroy();
}
getTimeSrv().stopAutoRefresh();
dispatch(cleanUpDashboard());
dispatch(cancelVariables());
};