construct the datasource for the example query if not added (#57936)

This commit is contained in:
Kristina 2022-11-02 09:50:10 -05:00 committed by GitHub
parent 3a5ddbfbdf
commit 5a99aff7b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,6 +318,10 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
};
onClickExample = (query: TQuery) => {
if (query.datasource === undefined) {
query.datasource = { type: this.props.dataSource.type, uid: this.props.dataSource.uid };
}
this.props.onChange({
...query,
refId: this.props.query.refId,