Browse Source

HUE-3228 [dashboard] Automatically enabled in Hue 4 or when search is enabled

Romain Rigaux 8 years ago
parent
commit
9854358124
1 changed files with 9 additions and 1 deletions
  1. 9 1
      desktop/libs/dashboard/src/dashboard/conf.py

+ 9 - 1
desktop/libs/dashboard/src/dashboard/conf.py

@@ -23,10 +23,18 @@ from desktop.appmanager import get_apps_dict
 from notebook.conf import get_ordered_interpreters
 
 
+
+def is_enabled():
+  """Automatic if Hue 4 or when search is enabled."""
+  apps = get_apps_dict()
+  
+  return is_hue4() or 'search' in apps 
+
+
 IS_ENABLED = Config(
   key="is_enabled",
   help=_t("Activate the Dashboard link in the menu."),
-  dynamic_default=is_hue4,
+  dynamic_default=is_enabled,
   type=coerce_bool
 )