QueryEditorRow: filter data on mount (#54260) (#54392)

This works correctly on initial dashboard load. However, when an action
is taken that triggers a "re-mount", e.g. opening the options pane on
the right side of the page, the `data` prop becomes undefined.

(cherry picked from commit 87375f570d)

Co-authored-by: Adam Simpson <adam@adamsimpson.net>
This commit is contained in:
Grot (@grafanabot)
2022-08-29 10:03:34 -04:00
committed by GitHub
co-authored by Adam Simpson
parent 565969cfcf
commit b4a8496b06
@@ -82,6 +82,10 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
};
componentDidMount() {
const { data, query } = this.props;
const dataFilteredByRefId = filterPanelDataToQuery(data, query.refId);
this.setState({ data: dataFilteredByRefId });
this.loadDatasource();
}