mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Analytics: Send event when opening a dashboard (#22921)
* Analytics: add open dashboard event * Analytics: move code to analyticsProcessor * Dashboard: fix init tests * Analytics: remove open event for new dashboard * Analytics: rename analyticsProcessor functions
This commit is contained in:
@@ -25,6 +25,7 @@ import { DataQuery } from '@grafana/data';
|
||||
import { getConfig } from '../../../core/config';
|
||||
import { initDashboardTemplating, processVariables } from '../../variables/state/actions';
|
||||
import { variableAdapters } from '../../variables/adapters';
|
||||
import { emitDashboardViewEvent } from './analyticsProcessor';
|
||||
|
||||
export interface InitDashboardArgs {
|
||||
$injector: any;
|
||||
@@ -223,6 +224,11 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
|
||||
// legacy srv state
|
||||
dashboardSrv.setCurrent(dashboard);
|
||||
|
||||
// send open dashboard event
|
||||
if (args.routeInfo !== DashboardRouteInfo.New) {
|
||||
emitDashboardViewEvent(dashboard);
|
||||
}
|
||||
|
||||
// yay we are done
|
||||
dispatch(dashboardInitCompleted(dashboard));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user