瀏覽代碼

HUE-3515 [stats] Don't show the view more link in stats from metastore

Johan Ahlen 9 年之前
父節點
當前提交
3416c2a

+ 4 - 2
apps/metastore/src/metastore/templates/metastore.mako

@@ -116,7 +116,8 @@ ${ assist.assistPanel() }
               tableName: table.name,
               columnName: name,
               fieldType: type,
-              assistHelper: table.assistHelper
+              assistHelper: table.assistHelper,
+              showViewMore: false
             } }"></span>
           </td>
   ##         <td class="pointer" data-bind="click: function() { favourite(!favourite()) }"><i style="color: #338bb8" class="fa" data-bind="css: {'fa-star': favourite, 'fa-star-o': !favourite() }"></i></td>
@@ -469,7 +470,8 @@ ${ assist.assistPanel() }
                   databaseName: database.name,
                   tableName: name,
                   fieldType: type,
-                  assistHelper: assistHelper
+                  assistHelper: assistHelper,
+                  showViewMore: false
                 } }"></span></td>
               <td>
                 <a class="tableLink" href="javascript:void(0);" data-bind="text: name, click: function() { $parent.setTable($data, function(){ huePubSub.publish('metastore.url.change'); }) }"></a>

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

@@ -46,6 +46,7 @@
     self.column = options.columnName || null;
     self.assistHelper = options.assistHelper;
     self.type = options.type;
+    self.showViewMore = options.showViewMore;
     self.isComplexType = /^(map|array|struct)/i.test(options.type);
     self.isView = /view/i.test(options.type);
 

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

@@ -95,7 +95,7 @@ from desktop.views import _ko
           <li data-bind="click: function () { activeTab('analysis'); }, css: { 'active' : activeTab() === 'analysis' }, visible: showAnalysis">
             <a class="inactive-action" href="#analysisTab" data-toggle="tab"><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>${_('Analysis')} </a>
           </li>
-          <!-- ko if: sourceType === 'hive' || sourceType === 'impala' -->
+          <!-- ko if: showViewMore && (sourceType === 'hive' || sourceType === 'impala') -->
           <li class="pull-right">
             <a class="more-link" target="_blank" data-bind="attr: { 'href': '/metastore/table/' + database + '/' + table }">
               <span class="fa fa-external-link" ></span> ${ _('View more...') }
@@ -247,6 +247,7 @@ from desktop.views import _ko
               tableName: self.params.tableName,
               columnName: self.params.columnName,
               assistHelper: self.params.assistHelper,
+              showViewMore: typeof self.params.showViewMore === 'undefined' || self.params.showViewMore,
               type: self.params.fieldType
             }));