Sfoglia il codice sorgente

HUE-6791 [search] Protect against pivot facets conflicting with nested facets

Romain Rigaux 8 anni fa
parent
commit
c414c67b81

+ 2 - 2
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -718,7 +718,7 @@ var Collection = function (vm, collection) {
     }
     if (typeof facet.properties.facets != 'undefined') {
       $.each(facet.properties.facets(), function (index, pivotFacet) {
-        if (pivotFacet.aggregate) {
+        if (pivotFacet.aggregate && pivotFacet.aggregate.function) {
           pivotFacet.aggregate.function.subscribe(function () {
             vm.search();
           });
@@ -2359,7 +2359,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       }
       if (typeof facet.properties.facets != 'undefined') {
         $.each(facet.properties.facets(), function (index, pivotFacet) {
-          if (pivotFacet.aggregate) {
+          if (pivotFacet.aggregate && pivotFacet.aggregate.function) {
             pivotFacet.aggregate.function.subscribe(function () {
               vm.search();
             });