Browse Source

feat(elasticsearch): update pipeline aggs if type change

make it possible to switch between different pipeline
aggregates without causing problms in the ui
carl bergquist 10 years ago
parent
commit
0f65cb2b79

+ 1 - 0
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();
     };
 

+ 1 - 3
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;
         }