Эх сурвалжийг харах

[notebook] Add a flag to show the latest editors

Currently do not hide the older ones.

[beeswax]
 use_new_editor=true
Romain Rigaux 10 жил өмнө
parent
commit
b1ed816

+ 6 - 0
apps/beeswax/src/beeswax/conf.py

@@ -114,6 +114,12 @@ THRIFT_VERSION = Config(
   default=7
 )
 
+USE_NEW_EDITOR = Config( # To remove in Hue 3.10
+  key='use_new_editor',
+  default=False,
+  type=coerce_bool,
+  help=_t('Choose whether to show the new editors for beta testing.')
+)
 
 SSL = ConfigSection(
   key='ssl',

+ 7 - 0
desktop/core/src/desktop/templates/common_header.mako

@@ -411,12 +411,19 @@ from django.utils.translation import ugettext as _
          <a title="${_('Query data')}" rel="navigator-tooltip" href="#" data-toggle="dropdown" class="dropdown-toggle">Query Editors <b class="caret"></b></a>
          <ul role="menu" class="dropdown-menu">
            % if 'beeswax' in apps:
+             <%
+               from beeswax.conf import USE_NEW_EDITOR
+             %>
              <li><a href="/${apps['beeswax'].display_name}"><img src="${ static(apps['beeswax'].icon_path) }" class="app-icon"/> ${_('Hive')}</a></li>
+             % if USE_NEW_EDITOR.get():
              <li><a href="${ url('notebook:editor') }?type=hive"><img src="${ static(apps['beeswax'].icon_path) }" class="app-icon"/> ${_('New Hive')}</a></li>
+             % endif
            % endif
            % if 'impala' in apps:
              <li><a href="/${apps['impala'].display_name}"><img src="${ static(apps['impala'].icon_path) }" class="app-icon"/> ${_('Impala')}</a></li>
+             % if USE_NEW_EDITOR.get(): # impala requies beeswax anyway
              <li><a href="${ url('notebook:editor') }?type=impala"><img src="${ static(apps['impala'].icon_path) }" class="app-icon"/> ${_('New Impala')}</a></li>
+             % endif
            % endif
            % if 'rdbms' in apps:
             <li><a href="/${apps['rdbms'].display_name}"><img src="${ static(apps['rdbms'].icon_path) }" class="app-icon"/> ${_('DB Query')}</a></li>