浏览代码

HUE-8090 [assist] Move the context popover attributes for a column to the title

Johan Ahlen 7 年之前
父节点
当前提交
f568120

文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 6 - 0
desktop/core/src/desktop/static/desktop/less/components/hue-popover.less

@@ -130,6 +130,12 @@
 
   .hue-popover-title-text {
     padding-left: 4px;
+    font-size: 0;
+
+    div {
+      display: inline-block;
+      font-size: 14px;
+    }
   }
 
   .hue-popover-title-actions {

+ 14 - 17
desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

@@ -297,7 +297,19 @@ from metadata.conf import has_navigator
   <script type="text/html" id="context-catalog-entry-title">
     <div class="hue-popover-title">
       <i class="hue-popover-title-icon fa muted" data-bind="css: catalogEntry() && catalogEntry().isView() ? 'fa-eye' : 'fa-table'"></i>
-      <span class="hue-popover-title-text" data-bind="foreach: breadCrumbs"><!-- ko ifnot: isActive --><a href="javascript: void(0);" data-bind="click: makeActive, text: name"></a>.<!-- /ko --><!-- ko if: isActive --><span data-bind="text: name"></span><!-- /ko --></span>
+      <span class="hue-popover-title-text" data-bind="foreach: breadCrumbs">
+        <!-- ko ifnot: isActive --><div><a href="javascript: void(0);" data-bind="click: makeActive, text: name"></a>.</div><!-- /ko -->
+        <!-- ko if: isActive -->
+        <div>
+          <span data-bind="text: name"></span>
+          <!-- ko with: catalogEntry -->
+          <!-- ko if: isField() -->
+          (<span data-bind="text: getType()"></span>) <i class="fa fa-key" data-bind="visible: definition.primary_key === 'true'"></i>
+          <!-- /ko -->
+          <!-- /ko -->
+        </div>
+        <!-- /ko -->
+      </span>
       <div class="hue-popover-title-actions">
         <!-- ko hueSpinner: { spin: loading, inline: true } --><!-- /ko -->
         <a class="pointer inactive-action" title="${ _('Refresh') }" data-bind="visible: !loading(), click: refresh"><i class="fa fa-fw fa-refresh"></i></a>
@@ -328,22 +340,6 @@ from metadata.conf import has_navigator
             <!-- /ko -->
           %endif
 
-          <!-- ko if: isField() -->
-          <div class="context-popover-attributes">
-            <div class="context-popover-attribute"><div>${ _('Type') }</div> <div data-bind="text: getType(), attr: { 'title': getRawType() }"></div></div>
-            <!-- ko with: analysis -->
-            <!-- ko with: stats -->
-            <!-- ko if: typeof distinct_count !== 'undefined' -->
-            <div class="context-popover-attribute"><div>${ _('Distinct') }</div> <div data-bind="text: distinct_count"></div></div>
-            <!-- /ko -->
-            <!-- /ko -->
-            <!-- /ko -->
-            <!-- ko if: definition.primary_key === 'true' -->
-            <div class="context-popover-attribute"><div>${ _('Primary Key') }</div></div>
-            <!-- /ko -->
-          </div>
-          <!-- /ko -->
-
           <!-- ko if: isView() && $parent.viewSql() -->
           <a href="javascript:void(0);" style="text-align: right; margin-bottom: 5px;" data-bind="toggle: $parent.viewSqlVisible, text: $parent.viewSqlVisible() ? '${ _ko('Show columns')}' : '${ _ko('Show view SQL')}'"></a>
           <!-- /ko -->
@@ -426,6 +422,7 @@ from metadata.conf import has_navigator
                 name: catalogEntry.path[i],
                 isActive: i === catalogEntry.path.length - 1,
                 path: catalogEntry.path.slice(0, i + 1),
+                catalogEntry: self.catalogEntry,
                 makeActive: function () {
                   self.catalogEntry().dataCatalog.getEntry({ path: this.path }).done(self.catalogEntry);
                 }

部分文件因为文件数量过多而无法显示