QueryEditorRow: filter data on mount (#54260)

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.
This commit is contained in:
Adam Simpson 2022-08-29 09:49:58 -04:00 committed by GitHub
parent d574a5d98f
commit 87375f570d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}