Commit 1896828b by Ryan McKinley Committed by GitHub

QueryEditor: preserve the datasource attribute if when chaning queries (#24350)

parent d747fcf9
......@@ -57,8 +57,13 @@ export class QueryEditorRows extends PureComponent<Props> {
onChangeQuery(query: DataQuery, index: number) {
const { queries, onChangeQueries } = this.props;
// ensure refId is maintained
query.refId = queries[index].refId;
const old = queries[index];
// ensure refId & datasource are maintained
query.refId = old.refId;
if (old.datasource) {
query.datasource = old.datasource;
}
// update query in array
onChangeQueries(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment