add current value to dropdown if its not in resultset

This commit is contained in:
Sven Klemm
2018-07-09 14:27:10 +02:00
parent 6a981d39d8
commit 2d951ba611
@@ -105,6 +105,12 @@ export function sqlPartEditorDirective($compile, templateSrv) {
var dynamicOptions = _.map(result, function(op) {
return op.value;
});
// add current value to dropdown if its not in dynamicOptions
if (_.indexOf(dynamicOptions, part.params[paramIndex]) === -1) {
dynamicOptions.unshift(part.params[paramIndex]);
}
callback(dynamicOptions);
});
});