Commit faf6a5fd by Torkel Ödegaard

fixed issue in metric segment and option lookup, #6912

parent 38d8ba8f
...@@ -23,6 +23,9 @@ function (angular, _, coreModule) { ...@@ -23,6 +23,9 @@ function (angular, _, coreModule) {
return; return;
} }
// temp hack to work around legacy inconsistency in segment model
this.text = options.value;
this.cssClass = options.cssClass; this.cssClass = options.cssClass;
this.custom = options.custom; this.custom = options.custom;
this.type = options.type; this.type = options.type;
...@@ -79,7 +82,7 @@ function (angular, _, coreModule) { ...@@ -79,7 +82,7 @@ function (angular, _, coreModule) {
this.transformToSegments = function(addTemplateVars, variableTypeFilter) { this.transformToSegments = function(addTemplateVars, variableTypeFilter) {
return function(results) { return function(results) {
var segments = _.map(results, function(segment) { var segments = _.map(results, function(segment) {
return self.newSegment({ value: segment.text, expandable: segment.expandable }); return self.newSegment({value: segment.text, expandable: segment.expandable});
}); });
if (addTemplateVars) { if (addTemplateVars) {
......
...@@ -161,7 +161,7 @@ export class GraphiteQueryCtrl extends QueryCtrl { ...@@ -161,7 +161,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
return this.datasource.metricFindQuery(query).then(segments => { return this.datasource.metricFindQuery(query).then(segments => {
var altSegments = _.map(segments, segment => { var altSegments = _.map(segments, segment => {
return this.uiSegmentSrv.newSegment({ value: segment.text, expandable: segment.expandable }); return this.uiSegmentSrv.newSegment({value: segment.text, expandable: segment.expandable});
}); });
if (altSegments.length === 0) { return altSegments; } if (altSegments.length === 0) { return altSegments; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment