mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix rule form crashing when extra query editor actions are provided (#40319)
This commit is contained in:
parent
9fb6dfe11d
commit
b1f56b4863
@ -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<Props, State> {
|
||||
return (
|
||||
<div ref={provided.innerRef} {...provided.droppableProps}>
|
||||
{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 (
|
||||
<QueryWrapper
|
||||
index={index}
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
DataSourceInstanceSettings,
|
||||
getDefaultRelativeTimeRange,
|
||||
GrafanaTheme2,
|
||||
LoadingState,
|
||||
PanelData,
|
||||
RelativeTimeRange,
|
||||
ThresholdsConfig,
|
||||
@ -83,7 +84,7 @@ export const QueryWrapper: FC<Props> = ({
|
||||
queries={queries}
|
||||
renderHeaderExtras={() => renderTimePicker(query, index)}
|
||||
visualization={
|
||||
data ? (
|
||||
data.state !== LoadingState.NotStarted ? (
|
||||
<VizWrapper
|
||||
data={data}
|
||||
changePanel={changePluginId}
|
||||
|
Loading…
Reference in New Issue
Block a user