浏览代码

HUE-7684 [assist] Add context menu to the collections title in left and right assist

Enrico Berti 8 年之前
父节点
当前提交
b02c2e3e04
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      desktop/core/src/desktop/templates/assist.mako

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

@@ -79,6 +79,10 @@ from desktop.views import _ko
     </div>
     </div>
   </script>
   </script>
 
 
+  <script type="text/html" id="collection-title-context-items">
+    <li><a href="javascript:void(0);" data-bind="hueLink: '/indexer'"><i class="fa fa-fw fa-table"></i> ${ _('Open in Browser') }</a></li>
+  </script>
+
   <script type="text/html" id="sql-context-items">
   <script type="text/html" id="sql-context-items">
     <!-- ko if: typeof definition !== 'undefined' -->
     <!-- ko if: typeof definition !== 'undefined' -->
       <!-- ko if: sourceType === 'solr' -->
       <!-- ko if: sourceType === 'solr' -->
@@ -883,7 +887,7 @@ from desktop.views import _ko
         ${_('Tables')}
         ${_('Tables')}
         <!-- /ko -->
         <!-- /ko -->
         <!-- ko if: sourceType === 'solr' -->
         <!-- ko if: sourceType === 'solr' -->
-        ${_('Collections')}
+        <div data-bind="appAwareTemplateContextMenu: { template: 'collection-title-context-items', scrollContainer: '.assist-db-scrollable' }">${_('Collections')}</div>
         <!-- /ko -->
         <!-- /ko -->
         <!-- ko template: 'assist-db-header-actions' --><!-- /ko -->
         <!-- ko template: 'assist-db-header-actions' --><!-- /ko -->
       </div>
       </div>
@@ -2240,7 +2244,7 @@ from desktop.views import _ko
         <div class="assist-flex-header">
         <div class="assist-flex-header">
           <div class="assist-inner-header">
           <div class="assist-inner-header">
             <!-- ko if: isSolr -->
             <!-- ko if: isSolr -->
-            ${ _('Collections') }
+            <div data-bind="appAwareTemplateContextMenu: { template: 'collection-title-context-items', scrollContainer: '.assist-db-scrollable' }">${_('Collections')}</div>
             <!-- /ko -->
             <!-- /ko -->
             <!-- ko ifnot: isSolr  -->
             <!-- ko ifnot: isSolr  -->
             ${ _('Tables') }
             ${ _('Tables') }