fixes console error when selecting a pipeline aggregation (#14148)

This commit is contained in:
Peter Pisljar 2017-10-02 20:21:03 +02:00 committed by GitHub
parent e0dce5ffbb
commit c7d147df89
3 changed files with 3 additions and 10 deletions

View file

@ -30,11 +30,7 @@ module.directive('vislibSeries', function () {
$scope.series = $scope.vis.params.seriesParams;
$scope.$watch(() => {
return $scope.vis.aggs.map(agg => {
try {
return agg.makeLabel();
} catch (e) {
return '';
}
return agg.makeLabel();
}).join();
}, () => {
const schemaTitle = $scope.vis.type.schemas.metrics[0].title;

View file

@ -147,11 +147,7 @@ module.directive('vislibValueAxes', function () {
$scope.$watch(() => {
return $scope.vis.getAggConfig().map(agg => {
try {
return agg.makeLabel();
} catch (e) {
return '';
}
return agg.makeLabel();
}).join();
}, () => {
$scope.updateAxisTitle();

View file

@ -17,6 +17,7 @@ const makeNestedLabel = function (aggConfig, label) {
return metricLabel;
}
const metric = aggConfig.vis.aggs.find(agg => agg.id === aggConfig.params.metricAgg);
if (!metric) return '';
return `${uppercaseLabel} of ${metric.makeLabel()}`;
};