Преглед изворни кода

HUE-8926 [frontend] Add config flag to enable the app switcher

Johan Ahlen пре 6 година
родитељ
комит
33bd18297c

+ 7 - 0
desktop/core/src/desktop/conf.py

@@ -1510,6 +1510,13 @@ DEV_EMBEDDED = Config("dev_embedded",
    help=_("Enable embedded development mode, where the page will be rendered inside a container div element.")
 )
 
+DISPLAY_APP_SWITCHER = Config(
+  key='display_app_switcher',
+  help=_('Enable or disable the upper left app switcher menu.'),
+  type=coerce_bool,
+  default=False
+)
+
 HTTP_500_DEBUG_MODE = Config(
   key='http_500_debug_mode',
   help=_('Enable or disable debugging information in the 500 internal server error response. '

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

@@ -18,7 +18,7 @@
   from django.utils.translation import ugettext as _
 
   from desktop import conf
-  from desktop.conf import IS_EMBEDDED, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, USE_NEW_SIDE_PANELS, VCS
+  from desktop.conf import DISPLAY_APP_SWITCHER, IS_EMBEDDED, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, USE_NEW_SIDE_PANELS, VCS
   from desktop.models import hue_version, _get_apps, get_cluster_config
 
   from beeswax.conf import LIST_PARTITIONS_LIMIT
@@ -50,6 +50,8 @@
     window.CSRF_TOKEN = '';
   %endif
 
+  window.DISPLAY_APP_SWITCHER = '${ DISPLAY_APP_SWITCHER.get() }' === 'True';
+
   window.KNOX_BASE_PATH_HUE = '/KNOX_BASE_PATH_HUE';
   window._KNOX_BASE_PATH = '/KNOX_BASE_PATH_KNOX';
   window._KNOX_BASE_URL = '/KNOX_BASE_URL';