فهرست منبع

HUE-8125 [dashboard] Prevent JS error on hit widget delete

Enrico Berti 7 سال پیش
والد
کامیت
4a5f8b3f05
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

+ 4 - 2
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -1564,7 +1564,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
 
 
         <!-- ko if: widgetType() == 'hit-widget' -->
         <!-- ko if: widgetType() == 'hit-widget' -->
           <!-- ko with: $parent -->
           <!-- ko with: $parent -->
-            <!-- ko if: counts().length > 0 -->
+            <!-- ko if: counts().length > 0 && $root.collection.getFacetById($parent.id()) -->
               <span class="big-counter" data-bind="template: { name: 'counter-form', data: {counts: counts(), properties: $root.collection.getFacetById($parent.id()).properties }}"></span>
               <span class="big-counter" data-bind="template: { name: 'counter-form', data: {counts: counts(), properties: $root.collection.getFacetById($parent.id()).properties }}"></span>
             <!-- /ko -->
             <!-- /ko -->
           <!-- /ko -->
           <!-- /ko -->
@@ -2042,7 +2042,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
 
 
 
 
 <script type="text/html" id="hit-widget">
 <script type="text/html" id="hit-widget">
-  <div class="widget-spinner" data-bind="visible: ! $root.hasRetrievedResults()">
+  <div class="widget-spinner" data-bind="visible: !$root.hasRetrievedResults()">
     <i class="fa fa-spinner fa-spin"></i>
     <i class="fa fa-spinner fa-spin"></i>
   </div>
   </div>
 
 
@@ -2059,7 +2059,9 @@ ${ dashboard.layout_skeleton(suffix='search') }
       % endif
       % endif
     </div>
     </div>
 
 
+    <!-- ko if: $root.collection.getFacetById($parent.id()) -->
     <span class="big-counter" data-bind="template: { name: 'counter-form', data: {counts: counts(), properties: $root.collection.getFacetById($parent.id()).properties }}"></span>
     <span class="big-counter" data-bind="template: { name: 'counter-form', data: {counts: counts(), properties: $root.collection.getFacetById($parent.id()).properties }}"></span>
+    <!-- /ko -->
   </div>
   </div>
   <!-- /ko -->
   <!-- /ko -->
 </script>
 </script>