mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix datasource sorting with template variables
- fixes sorting when template variables are present - simplified existing test cases - added test to cover variable usage in datasource service
This commit is contained in:
@@ -142,10 +142,12 @@ export class DatasourceSrv {
|
||||
var ds = config.datasources[first];
|
||||
|
||||
if (ds) {
|
||||
const key = `$${variable.name}`;
|
||||
list.push({
|
||||
name: '$' + variable.name,
|
||||
value: '$' + variable.name,
|
||||
name: key,
|
||||
value: key,
|
||||
meta: ds.meta,
|
||||
sort: key,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user