Эх сурвалжийг харах

HUE-3513 [assist] Show sample values in column stats popover

Johan Ahlen 9 жил өмнө
parent
commit
b2ddee5684

+ 3 - 6
desktop/core/src/desktop/static/desktop/js/assist/tableStats.js

@@ -59,7 +59,7 @@
     self.termsTabActive = ko.observable(false);
     self.prefixFilter = ko.observable().extend({'throttle': 500});
 
-    self.activeTab = ko.observable(self.column === null ? 'sample' : 'analysis');
+    self.activeTab = ko.observable('sample');
     self.loadingSamples = ko.observable(false);
     self.samples = ko.observable(null);
 
@@ -79,11 +79,7 @@
       }
     });
 
-    if (typeof self.column === 'undefined' || self.column === null) {
-      self.fetchSamples();
-    } else {
-      self.fetchData();
-    }
+    self.fetchSamples();
   }
 
   TableStats.prototype.fetchData = function () {
@@ -207,6 +203,7 @@
       sourceType: self.sourceType,
       databaseName: ko.isObservable(self.database) ? self.database() : self.database,
       tableName: ko.isObservable(self.table) ? self.table() : self.table,
+      columnName: ko.isObservable(self.column) ? self.column() : self.column,
       successCallback: function(data) {
         if (! data.rows) {
           data.rows = [];

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

@@ -89,7 +89,7 @@ from desktop.views import _ko
       </h3>
       <div class="popover-content">
         <ul class="nav nav-tabs">
-          <li data-bind="click: function () { activeTab('sample'); }, css: { 'active' : activeTab() === 'sample' }, visible: column === null">
+          <li data-bind="click: function () { activeTab('sample'); }, css: { 'active' : activeTab() === 'sample' }">
             <a class="inactive-action" href="#sampleTab" data-toggle="tab">${_('Sample')}</a>
           </li>
           <li data-bind="click: function () { activeTab('analysis'); }, css: { 'active' : activeTab() === 'analysis' }">