Explorar o código

[assist] Disable stat refresh for table views

Johan Ahlen %!s(int64=10) %!d(string=hai) anos
pai
achega
0d9544e

+ 1 - 0
desktop/core/src/desktop/static/desktop/js/assist/tableStats.js

@@ -47,6 +47,7 @@
     self.assistHelper = options.assistHelper;
     self.type = options.type;
     self.isComplexType = /^(map|array|struct)/i.test(options.type);
+    self.isView = /view/i.test(options.type);
 
     self.loading = ko.observable(false);
     self.hasError = ko.observable(false);

+ 2 - 2
desktop/core/src/desktop/templates/table_stats.mako

@@ -72,8 +72,8 @@ from desktop.views import _ko
       <div class="arrow" data-bind="style: { 'top': $parent.popoverArrowTop() + 'px'}"></div>
       <h3 class="popover-title" style="text-align: left">
         <a class="pull-right pointer close-popover" style="margin-left: 8px" data-bind="click: $parent.toggleStats"><i class="fa fa-times"></i></a>
-        <a class="pull-right pointer stats-refresh" style="margin-left: 8px" data-bind="visible: !isComplexType, click: refresh"><i class="fa fa-refresh" data-bind="css: { 'fa-spin' : refreshing }"></i></a>
-        <span class="pull-right stats-warning muted" data-bind="visible: inaccurate() && column == null" rel="tooltip" data-placement="top" title="${ _('The column stats for this table are not accurate') }" style="margin-left: 8px"><i class="fa fa-exclamation-triangle"></i></span>
+        <a class="pull-right pointer stats-refresh" style="margin-left: 8px" data-bind="visible: !isComplexType && !isView, click: refresh"><i class="fa fa-refresh" data-bind="css: { 'fa-spin' : refreshing }"></i></a>
+        <span class="pull-right stats-warning muted" data-bind="visible: inaccurate() && column == null && !isComplexType && !isView" rel="tooltip" data-placement="top" title="${ _('The column stats for this table are not accurate') }" style="margin-left: 8px"><i class="fa fa-exclamation-triangle"></i></span>
         <i data-bind="visible: loading" class='fa fa-spinner fa-spin'></i>
         <!-- ko if: column == null -->
         <strong class="table-name" data-bind="text: table"></strong> ${ _(' table analysis') }