From c78b1fb30462445c4ea5e926720038075091b278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Mon, 23 May 2022 08:33:05 +0200 Subject: [PATCH] Skip Angular error handling when Angular support is disabled (#49311) --- public/app/features/explore/state/query.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/features/explore/state/query.ts b/public/app/features/explore/state/query.ts index 0180f1499d5..6a192bfcda5 100644 --- a/public/app/features/explore/state/query.ts +++ b/public/app/features/explore/state/query.ts @@ -19,6 +19,7 @@ import { QueryFixAction, toLegacyResponseData, } from '@grafana/data'; +import { config } from '@grafana/runtime'; import { buildQueryTransaction, ensureQueries, @@ -834,7 +835,8 @@ export const processQueryResponse = ( } // Send error to Angular editors - if (state.datasourceInstance?.components?.QueryCtrl) { + // When angularSupportEnabled is removed we can remove this code and all references to eventBridge + if (config.angularSupportEnabled && state.datasourceInstance?.components?.QueryCtrl) { state.eventBridge.emit(PanelEvents.dataError, error); } } @@ -844,7 +846,8 @@ export const processQueryResponse = ( } // Send legacy data to Angular editors - if (state.datasourceInstance?.components?.QueryCtrl) { + // When angularSupportEnabled is removed we can remove this code and all references to eventBridge + if (config.angularSupportEnabled && state.datasourceInstance?.components?.QueryCtrl) { const legacy = series.map((v) => toLegacyResponseData(v)); state.eventBridge.emit(PanelEvents.dataReceived, legacy); }