소스 검색

HUE-7743 [frontend] Hide table browser links in embedded mode

Johan Ahlen 7 년 전
부모
커밋
acf18ad
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      desktop/core/src/desktop/templates/assist.mako
  2. 3 0
      desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

+ 3 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -26,7 +26,7 @@ from dashboard.conf import HAS_SQL_ENABLED
 
 from desktop import appmanager
 from desktop import conf
-from desktop.conf import USE_NEW_SIDE_PANELS, VCS
+from desktop.conf import IS_EMBEDDED, USE_NEW_SIDE_PANELS, VCS
 from desktop.lib.i18n import smart_unicode
 from desktop.views import _ko
 %>
@@ -101,9 +101,11 @@ from desktop.views import _ko
         <!-- ko if: !definition.isDatabase && $currentApp() === 'editor' -->
         <li><a href="javascript:void(0);" data-bind="click: dblClick"><i class="fa fa-fw fa-paste"></i> ${ _('Insert at cursor') }</a></li>
         <!-- /ko -->
+        % if not IS_EMBEDDED.get():
         <!-- ko if: definition.isView || definition.isTable || definition.isDatabase -->
         <li><a href="javascript:void(0);" data-bind="click: openInMetastore"><i class="fa fa-fw fa-table"></i> ${ _('Open in Browser') }</a></li>
         <!-- /ko -->
+        % endif
         <!-- ko if: definition.isView || definition.isTable -->
         <li>
           <a href="javascript:void(0);" data-bind="click: function() { huePubSub.publish('query.and.watch', {'url': '/notebook/browse/' + databaseName + '/' + tableName + '/', sourceType: sourceType}); }">

+ 3 - 0
desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

@@ -19,6 +19,7 @@ from django.utils.translation import ugettext as _
 
 from dashboard.conf import HAS_SQL_ENABLED
 from desktop import conf
+from desktop.conf import IS_EMBEDDED
 from desktop.lib.i18n import smart_unicode
 from desktop.views import _ko
 
@@ -37,11 +38,13 @@ from metadata.conf import has_navigator
           <i style="font-size: 11px;" title="${ _("Open in Dashboard...") }" class="fa fa-external-link"></i> ${ _("Dashboard") }
         </a>
         % endif
+        % if not IS_EMBEDDED.get():
         <!-- ko if: typeof sourceType === 'undefined' || sourceType !== 'solr' -->
         <a class="inactive-action pointer" data-bind="visible: openInTableBrowserEnabled, click: function() { huePubSub.publish('context.popover.open.in.metastore', isTable || isView ? 'table' : 'db') }">
           <i style="font-size: 11px;" title="${ _("Open in Table Browser...") }" class="fa fa-external-link"></i> ${ _("Table Browser") }
         </a>
         <!-- /ko -->
+        % endif
         <a class="inactive-action pointer" data-bind="visible: replaceEditorContentEnabled, click: function() { huePubSub.publish('context.popover.replace.in.editor') }">
           <i style="font-size: 11px;" title="${ _("Replace the editor content...") }" class="fa fa-pencil"></i> ${ _("Insert in the editor") }
         </a>