mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DatasourceRef: keep uid/type ref when using template variables (#41785)
This commit is contained in:
@@ -114,6 +114,7 @@ function describeQueryRunnerScenario(
|
||||
ctx.queryCalledWith = options;
|
||||
return Promise.resolve(response);
|
||||
},
|
||||
getRef: () => ({ type: 'test', uid: 'TestDB-uid' }),
|
||||
testDatasource: jest.fn(),
|
||||
};
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ export class PanelQueryRunner {
|
||||
// Attach the data source name to each query
|
||||
request.targets = request.targets.map((query) => {
|
||||
if (!query.datasource) {
|
||||
query.datasource = { uid: ds.uid };
|
||||
query.datasource = ds.getRef();
|
||||
}
|
||||
return query;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user