瀏覽代碼

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

Romain Rigaux 9 年之前
父節點
當前提交
9854358124
共有 1 個文件被更改,包括 9 次插入1 次删除
  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
 )