mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
PanelEdit: making sure the correct datasource query editor is being rendered. (#29500)
* making sure we try to use the selected db in the query row. * fixing so we use || instead of ??.
This commit is contained in:
parent
63c8945db5
commit
863dbc7ba8
@ -88,12 +88,13 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
async loadDatasource() {
|
||||
const { query, panel } = this.props;
|
||||
const { query, panel, dataSourceValue } = this.props;
|
||||
const dataSourceSrv = getDatasourceSrv();
|
||||
let datasource;
|
||||
|
||||
try {
|
||||
datasource = await dataSourceSrv.get(query.datasource || panel.datasource);
|
||||
const datasourceName = dataSourceValue || query.datasource || panel.datasource;
|
||||
datasource = await dataSourceSrv.get(datasourceName);
|
||||
} catch (error) {
|
||||
datasource = await dataSourceSrv.get();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user