From 0f65cb2b79175669f22f6aaf8b590d2676242b56 Mon Sep 17 00:00:00 2001 From: carl bergquist Date: Thu, 10 Dec 2015 17:01:29 +0100 Subject: [PATCH] feat(elasticsearch): update pipeline aggs if type change make it possible to switch between different pipeline aggregates without causing problms in the ui --- public/app/plugins/datasource/elasticsearch/metric_agg.js | 1 + public/app/plugins/datasource/elasticsearch/query_builder.js | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/elasticsearch/metric_agg.js b/public/app/plugins/datasource/elasticsearch/metric_agg.js index 6f52dc4f28d..9ac70580e51 100644 --- a/public/app/plugins/datasource/elasticsearch/metric_agg.js +++ b/public/app/plugins/datasource/elasticsearch/metric_agg.js @@ -91,6 +91,7 @@ function (angular, _, queryDef) { $scope.agg.settings = {}; $scope.agg.meta = {}; $scope.showOptions = false; + $scope.updatePipelineAggOptions(); $scope.onChange(); }; diff --git a/public/app/plugins/datasource/elasticsearch/query_builder.js b/public/app/plugins/datasource/elasticsearch/query_builder.js index c68827df853..5e6335e032e 100644 --- a/public/app/plugins/datasource/elasticsearch/query_builder.js +++ b/public/app/plugins/datasource/elasticsearch/query_builder.js @@ -173,9 +173,7 @@ function (queryDef) { if (queryDef.isPipelineAgg(metric)) { if (metric.pipelineAgg && /^\d*$/.test(metric.pipelineAgg)) { - metricAgg = { - buckets_path: metric.pipelineAgg, - }; + metricAgg = { buckets_path: metric.pipelineAgg }; } else { continue; }