Эх сурвалжийг харах

HUE-7394 [frontend] Use the dev flag instead of debug_mode to prevent caching of resources

This also moves the dev flag out of the LDAP section in the config to the root.
Johan Ahlen 8 жил өмнө
parent
commit
0ca4918

+ 3 - 3
desktop/conf/pseudo-distributed.ini.tmpl

@@ -44,6 +44,9 @@
   # Enable or disable Django debug mode.
   ## django_debug_mode=true
 
+  # Enable development mode, where notably static files are not cached.
+  ## dev=false
+
   # Enable or disable database debug mode.
   ## database_logging=false
 
@@ -440,9 +443,6 @@
     # 2 for logging the method calls with arguments and the complete results and 9 for also logging the traceback of method calls.
     ## trace_level=0
 
-    # Enable development mode, where notably static files are not cached.
-    dev=true
-
     [[[users]]]
 
       # Base filter for searching for users

+ 6 - 5
desktop/core/src/desktop/conf.py

@@ -999,11 +999,6 @@ LDAP = ConfigSection(
       type=int,
       help=_("Possible values for trace_level are 0 for no logging, 1 for only logging the method calls with arguments,"
              "2 for logging the method calls with arguments and the complete results and 9 for also logging the traceback of method calls.")),
-    DEV = Config("dev",
-      type=coerce_bool,
-      default=False,
-      help=_("Enable development mode, where notably static files are not cached.")),
-
     LDAP_SERVERS = UnspecifiedConfigSection(
       key="ldap_servers",
       help=_("LDAP server record."),
@@ -1273,6 +1268,12 @@ DJANGO_DEBUG_MODE = Config(
   default=True
 )
 
+DEV = Config("dev",
+   type=coerce_bool,
+   default=False,
+   help=_("Enable development mode, where notably static files are not cached.")
+)
+
 HTTP_500_DEBUG_MODE = Config(
   key='http_500_debug_mode',
   help=_('Enable or disable debugging information in the 500 internal server error response. '

+ 1 - 1
desktop/core/src/desktop/templates/ace_sql_location_worker.mako

@@ -18,7 +18,7 @@
   from desktop import conf
 %>
 
-% if conf.DJANGO_DEBUG_MODE.get():
+% if conf.DEV.get():
 importScripts('${ static('desktop/js/autocomplete/sqlParseSupport.js') }' + '?' + Math.random());
 importScripts('${ static('desktop/js/autocomplete/sqlAutocompleteParser.js') }' + '?' + Math.random());
 importScripts('${ static('desktop/js/sqlFunctions.js') }' + '?' + Math.random());

+ 1 - 1
desktop/core/src/desktop/templates/ace_sql_syntax_worker.mako

@@ -18,7 +18,7 @@
   from desktop import conf
 %>
 
-% if conf.DJANGO_DEBUG_MODE.get():
+% if conf.DEV.get():
 importScripts('${ static('desktop/js/autocomplete/sqlParseSupport.js') }' + '?' + Math.random());
 importScripts('${ static('desktop/js/autocomplete/sqlSyntaxParser.js') }' + '?' + Math.random());
 % else:

+ 1 - 1
desktop/core/src/desktop/templates/common_header.mako

@@ -121,7 +121,7 @@ if USE_NEW_EDITOR.get():
 
   ${ commonHeaderFooterComponents.header_i18n_redirection(user, is_s3_enabled, apps) }
 
-  % if not conf.DJANGO_DEBUG_MODE.get():
+  % if not conf.DEV.get():
   <script src="${ static('desktop/js/hue.errorcatcher.js') }"></script>
   % endif
 

+ 2 - 2
desktop/core/src/desktop/templates/hue.mako

@@ -60,7 +60,7 @@
 
   ${ commonHeaderFooterComponents.header_i18n_redirection(user, is_s3_enabled, apps) }
 
-  % if not conf.DJANGO_DEBUG_MODE.get():
+  % if not conf.DEV.get():
   <script src="${ static('desktop/js/hue.errorcatcher.js') }"></script>
   % endif
   <script src="${ static('desktop/js/hue4.utils.js') }"></script>
@@ -738,7 +738,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
         // Only load CSS and JS files that are not loaded before
         self.processHeaders = function(response){
           var r = $('<span>').html(response);
-          % if conf.DJANGO_DEBUG_MODE.get():
+          % if conf.DEV.get():
           r.find('link').each(function () {
             $(this).attr('href', $(this).attr('href') + '?' + Math.random())
           });