Quellcode durchsuchen

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

Romain Rigaux vor 9 Jahren
Ursprung
Commit
9854358124
1 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  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
 )