Browse Source

HUE-6002 [assist] Don’t show the tag editor for other sources than Hive and Impala

Johan Ahlen 8 năm trước cách đây
mục cha
commit
d984e5a

+ 2 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -73,7 +73,9 @@ from notebook.conf import ENABLE_QUERY_BUILDER
   <script type="text/html" id="assist-database-actions">
     <div class="assist-actions database-actions" style="opacity: 0">
       %if has_navigator(user):
+      <!-- ko if: sourceType === 'hive' || sourceType === 'impala' -->
       <a class="inactive-action" href="javascript:void(0)" data-bind="visible: navigationSettings.showStats, click: function (data, event) { showContextPopover(data, event); }, css: { 'blue': statsVisible }"><i class="fa fa-fw fa-info" title="${_('Show details')}"></i></a>
+      <!-- /ko -->
       %endif
       <a class="inactive-action" href="javascript:void(0)" data-bind="visible: navigationSettings.openItem, click: openItem"><i class="fa fa-long-arrow-right" title="${_('Open')}"></i></a>
     </div>

+ 6 - 2
desktop/core/src/desktop/templates/sql_context_popover.mako

@@ -198,8 +198,10 @@ from metadata.conf import has_navigator
       <div style="margin-left: 15px; font-style: italic;" data-bind="text: comment"></div>
       <!-- /ko -->
       %if has_navigator(user):
+        <!-- ko if: $parent.sourceType === 'hive' || $parent.sourceType === 'impala' -->
         <div style="margin: 10px; font-size: 15px; font-weight: 300;">${ _("Tags") }</div>
         <div style="margin-left: 15px;" data-bind="component: { name: 'nav-tags', params: $parent } "></div>
+        <!-- /ko -->
       %endif
     </div>
     <!-- /ko -->
@@ -208,14 +210,16 @@ from metadata.conf import has_navigator
   <script type="text/html" id="sql-context-column-details">
     <div class="sql-context-flex-fill" data-bind="with: fetchedData, nicescroll">
       <div style="margin: 15px;">
-        <a class="pointer" data-bind="text: name, attr: { title: name }, click: function() { huePubSub.publish('sql.context.popover.scroll.to.column', name); }"></a> (<span data-bind="text: type.indexOf('<') !== -1 ? type.substring(0, type.indexOf('<')) : type, attr: { title: type }"></span>)
+        <a class="pointer" data-bind="text: name, attr: { title: name }, click: function() { huePubSub.publish('sql.context.popover.scroll.to.column', name); }"></a> <!-- ko if: typeof type !== 'undefined' -->(<span data-bind="text: type.indexOf('<') !== -1 ? type.substring(0, type.indexOf('<')) : type, attr: { title: type }"></span>)<!-- /ko -->
         <!-- ko if: typeof comment !== 'undefined' && comment !== '' && comment !== null -->
         <div style="margin-top: 10px; font-size: 15px; font-weight: 300;">${ _("Comment") }</div>
         <div data-bind="text: comment"></div>
         <!-- /ko -->
         %if has_navigator(user):
+          <!-- ko if: $parent.sourceType === 'hive' || $parent.sourceType === 'impala' -->
           <div style="margin-top: 10px; font-size: 15px; font-weight: 300;">${ _("Tags") }</div>
           <div style="margin: 10px" data-bind="component: { name: 'nav-tags', params: $parent } "></div>
+          <!-- /ko -->
         %endif
       </div>
     </div>
@@ -225,7 +229,7 @@ from metadata.conf import has_navigator
     <div class="sql-context-flex-fill" data-bind="with: fetchedData, nicescroll">
       <div style="margin: 15px;">
         <a class="pointer" data-bind="visible: typeof sample !== 'undefined', text: name || $parents[2].title, attr: { title: name || $parents[2].title }, click: function() { huePubSub.publish('sql.context.popover.scroll.to.column', name || $parents[2].title); }"></a>
-        <span data-bind="visible: typeof sample === 'undefined', text: name || $parents[2].title, attr: { title: name || $parents[2].title }"></span> (<span data-bind="text: type.indexOf('<') !== -1 ? type.substring(0, type.indexOf('<')) : type, attr: { title: type }"></span>)
+        <span data-bind="visible: typeof sample === 'undefined', text: name || $parents[2].title, attr: { title: name || $parents[2].title }"></span> <!-- ko if: typeof type !== 'undefined' -->(<span data-bind="text: type.indexOf('<') !== -1 ? type.substring(0, type.indexOf('<')) : type, attr: { title: type }"></span>)<!-- /ko -->
       </div>
     </div>
   </script>