mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
QueryEditor: preserve the datasource attribute if when chaning queries (#24350)
This commit is contained in:
parent
d747fcf9c3
commit
1896828bd0
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user