mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: Wrong annotations show on a given dashboard. Correct annotations show on page refresh. #37160 (#37496)
This commit is contained in:
parent
cdcccfcc53
commit
d48febee75
@ -287,9 +287,4 @@ describeInitScenario('Initializing previously canceled dashboard initialization'
|
||||
expect(getTimeSrv().init).toBeCalled();
|
||||
expect(getDashboardQueryRunner().run).toBeCalled();
|
||||
});
|
||||
|
||||
it('Should not initialize other services', () => {
|
||||
expect(getDashboardSrv().setCurrent).not.toBeCalled();
|
||||
expect(keybindingSrv.setupDashboardBindings).not.toBeCalled();
|
||||
});
|
||||
});
|
||||
|
@ -151,6 +151,9 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
|
||||
const timeSrv: TimeSrv = getTimeSrv();
|
||||
const dashboardSrv: DashboardSrv = getDashboardSrv();
|
||||
|
||||
// legacy srv state, we need this value updated for built-in annotations
|
||||
dashboardSrv.setCurrent(dashboard);
|
||||
|
||||
timeSrv.init(dashboard);
|
||||
const runner = createDashboardQueryRunner({ dashboard, timeSrv });
|
||||
runner.run({ dashboard, range: timeSrv.timeRange() });
|
||||
@ -194,9 +197,6 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
|
||||
updateQueriesWhenComingFromExplore(dispatch, dashboard, panelId, queries);
|
||||
}
|
||||
|
||||
// legacy srv state
|
||||
dashboardSrv.setCurrent(dashboard);
|
||||
|
||||
// send open dashboard event
|
||||
if (args.routeName !== DashboardRoutes.New) {
|
||||
emitDashboardViewEvent(dashboard);
|
||||
|
Loading…
Reference in New Issue
Block a user