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:
David Kaltschmidt
2018-07-06 15:32:08 +02:00
parent f2980bb978
commit 7ddcaf22d5
2 changed files with 35 additions and 18 deletions

View File

@@ -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,
});
}
}