Browse Source

HUE-7859 [dashboard] Remove error message when stats not supported

jdesjean 7 years ago
parent
commit
21203bd851

+ 4 - 8
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -788,17 +788,13 @@ var ApiHelper = (function () {
       timeout: options.timeout,
       success: function (data) {
         if (!data.error && !self.successResponseIsError(data) && data.status === 0) {
-          if (data.status === 0){
-            options.successCallback(data);
-          }
-          else if (data.status === 1) {
+          options.successCallback(data);
+        } else {
+          if (data.status === 1) {
             options.notSupportedCallback(data);
-          }
-          else {
+          } else {
             self.assistErrorCallback(options)(data);
           }
-        } else {
-          self.assistErrorCallback(options)(data);
         }
       }
     })

+ 1 - 1
desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

@@ -230,7 +230,7 @@ from metadata.conf import has_navigator
         <div data-bind="with: stats">
         <!-- ko hueSpinner: { spin:  $parent.loadingStats, center: true, size: 'large' } --><!-- /ko -->
         <div class="alert" data-bind="visible: !$parent.loadingStats() && !$parent.statsSupported()">${ _('This field does not support stats') }</div>
-        <div class="alert" data-bind="visible: !$parent.loadingStats() && $data.data().length == 0">${ _('There are no stats to be shown') }</div>
+        <div class="alert" data-bind="visible: !$parent.loadingStats() && $parent.statsSupported() && $data.data().length == 0">${ _('There are no stats to be shown') }</div>
         <table style="width: 100%" data-bind="visible: !$parent.loadingStats() && $data.data().length > 0" class="table table-condensed">
           <tbody data-bind="foreach: $data.data">
           <tr>