From 0a167ab00bf8209605255390165b4eca1a3d7513 Mon Sep 17 00:00:00 2001 From: Laura Benz <48948963+L-M-K-B@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:50:18 +0100 Subject: [PATCH] refactor: add response state to condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Piotr Jamróz --- public/app/features/correlations/Forms/QueryEditorField.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/correlations/Forms/QueryEditorField.tsx b/public/app/features/correlations/Forms/QueryEditorField.tsx index a6bd902b3a5..bb199d6bb04 100644 --- a/public/app/features/correlations/Forms/QueryEditorField.tsx +++ b/public/app/features/correlations/Forms/QueryEditorField.tsx @@ -81,7 +81,11 @@ export const QueryEditorField = ({ dsUid, invalid, error, name }: Props) => { if (datasource) { runRequest(datasource, transaction.request).subscribe((panelData) => { - if (!panelData || panelData.state === 'Error' || panelData.series.length === 0) { +if ( + !panelData || + panelData.state === 'Error' || + (panelData.state === 'Done' && panelData.series.length === 0) + ) { setIsValidQuery(false); } else if ( panelData.state === 'Done' &&