diff --git a/public/app/features/alerting/unified/components/rule-editor/QueryRows.tsx b/public/app/features/alerting/unified/components/rule-editor/QueryRows.tsx index e142b24ebf2..d6377747a12 100644 --- a/public/app/features/alerting/unified/components/rule-editor/QueryRows.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/QueryRows.tsx @@ -3,6 +3,7 @@ import { DragDropContext, Droppable, DropResult } from 'react-beautiful-dnd'; import { DataQuery, DataSourceInstanceSettings, + LoadingState, PanelData, RelativeTimeRange, ThresholdsConfig, @@ -230,13 +231,15 @@ export class QueryRows extends PureComponent { return (
{queries.map((query, index) => { - const data = this.props.data ? this.props.data[query.refId] : ({} as PanelData); + const data: PanelData = this.props.data?.[query.refId] ?? { + series: [], + state: LoadingState.NotStarted, + }; const dsSettings = this.getDataSourceSettings(query); if (!dsSettings) { return null; } - return ( = ({ queries={queries} renderHeaderExtras={() => renderTimePicker(query, index)} visualization={ - data ? ( + data.state !== LoadingState.NotStarted ? (