فهرست منبع

HUE-7050 [assist] Add a feature flag for the new generic context popover

Johan Ahlen 8 سال پیش
والد
کامیت
378b69f
3فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 3 0
      desktop/conf.dist/hue.ini
  2. 7 0
      desktop/core/src/desktop/conf.py
  3. 5 0
      desktop/core/src/desktop/templates/assist.mako

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -175,6 +175,9 @@
   # Choose whether to enable the new global search or not.
   ## use_new_global_search=false
 
+  # Choose whether to enable the new generic context popover or not.
+  ## use_new_context_popover=false
+
   # Choose whether to enable SQL syntax check or not
   ## enable_sql_syntax_check=false
 

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

@@ -1320,6 +1320,13 @@ USE_NEW_GLOBAL_SEARCH = Config( # To remove when the new global search is ready
   help=_('Choose whether to use the new global search or not.')
 )
 
+USE_NEW_CONTEXT_POPOVER = Config( # To remove when the new context popover is ready
+  key='use_new_context_popover',
+  default=False,
+  type=coerce_bool,
+  help=_('Choose whether to use the new context popover or not.')
+)
+
 USE_NEW_AUTOCOMPLETER = Config( # This now refers to the new autocomplete dropdown
   key='use_new_autocompleter',
   default=True,

+ 5 - 0
desktop/core/src/desktop/templates/assist.mako

@@ -55,10 +55,15 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, get_ord
 
   <%namespace name="assistSearch" file="assist_search.mako" />
   <%namespace name="sqlContextPopover" file="/sql_context_popover.mako" />
+  <%namespace name="contextPopover" file="/context_popover.mako" />
   <%namespace name="nav_components" file="/nav_components.mako" />
 
   ${ assistSearch.assistSearch() }
+  % if conf.USE_NEW_CONTEXT_POPOVER.get():
+  ${ contextPopover.contextPopover() }
+  % else:
   ${ sqlContextPopover.sqlContextPopover() }
+  %endif
   ${ nav_components.nav_tags(readOnly=not user.has_hue_permission(action="write", app="metadata")) }
 
   <script type="text/html" id="assist-no-database-entries">