Datasources: Emit event on dashboard load with queries info (#52052)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Andres Martinez <andres.martinez@grafana.com>
This commit is contained in:
Yaelle Chaudy
2022-08-11 09:30:14 +02:00
committed by GitHub
co-authored by Levente Balogh Andres Martinez
parent d7556bd189
commit dfe33a63fb
5 changed files with 256 additions and 2 deletions
@@ -40,3 +40,17 @@ export class DataSelectEvent extends BusEventWithPayload<DataHoverPayload> {
export class AnnotationChangeEvent extends BusEventWithPayload<Partial<AnnotationEvent>> {
static type = 'annotation-event';
}
// Loaded the first time a dashboard is loaded (not on every render)
export type DashboardLoadedEventPayload<T> = {
dashboardId: string;
orgId?: number;
userId?: number;
grafanaVersion?: string;
queries: Record<string, T[]>;
};
/** @alpha */
export class DashboardLoadedEvent<T> extends BusEventWithPayload<DashboardLoadedEventPayload<T>> {
static type = 'dashboard-loaded';
}