浏览代码

HUE-3973 [core] Show or hide configuration based on the config flag

Johan Ahlen 9 年之前
父节点
当前提交
473893216e

+ 6 - 3
apps/useradmin/src/useradmin/templates/layout.mako

@@ -15,6 +15,7 @@
 ## limitations under the License.
 
 <%!
+from desktop import conf
 from django.utils.translation import ugettext as _
 
 def is_selected(section, matcher):
@@ -58,9 +59,11 @@ def is_selected(section, matcher):
               </li>
               %if user.is_superuser:
               <li class="${is_selected(section, 'users')}"><a href="/useradmin/users">${_('Users')}</a></li>
-				      <li class="${is_selected(section, 'groups')}"><a href="/useradmin/groups">${_('Groups')}</a></li>
-				      <li class="${is_selected(section, 'permissions')}"><a href="/useradmin/permissions">${_('Permissions')}</a></li>
-##               <li class="${is_selected(section, 'configurations')}"><a href="/useradmin/configurations">${_('Configurations')}</a></li>
+              <li class="${is_selected(section, 'groups')}"><a href="/useradmin/groups">${_('Groups')}</a></li>
+              <li class="${is_selected(section, 'permissions')}"><a href="/useradmin/permissions">${_('Permissions')}</a></li>
+              %if conf.USE_DEFAULT_CONFIGURATION.get():
+              <li class="${is_selected(section, 'configurations')}"><a href="/useradmin/configurations">${_('Configurations')}</a></li>
+              %endif
               %endif
             </ul>
           </div>

+ 1 - 1
desktop/conf.dist/hue.ini

@@ -144,7 +144,7 @@
   ## use_new_editor=true
 
   # Enable saved default configurations for Hive, Impala, Spark, and Oozie.
-  ## use_default_configurations=false
+  ## use_default_configuration=false
 
   # The directory where to store the auditing logs. Auditing is disable if the value is empty.
   # e.g. /var/log/hue/audit.log

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

@@ -148,7 +148,7 @@
   ## use_new_editor=true
 
   # Enable saved default configurations for Hive, Impala, Spark, and Oozie.
-  ## use_default_configurations=false
+  ## use_default_configuration=false
 
   # The directory where to store the auditing logs. Auditing is disable if the value is empty.
   # e.g. /var/log/hue/audit.log

+ 3 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1830,7 +1830,9 @@ ${ hueIcons.symbols() }
             <div class="session-actions">
               <a class="inactive-action pointer" title="${ _('Recreate session') }" rel="tooltip" data-bind="click: function() { $root.selectedNotebook().restartSession($data) }"><i class="fa fa-refresh" data-bind="css: { 'fa-spin': restarting }"></i> ${ _('Recreate') }</a>
               <a class="inactive-action pointer margin-left-10" title="${ _('Close session') }" rel="tooltip" data-bind="click: function() { $root.selectedNotebook().closeAndRemoveSession($data) }"><i class="fa fa-times"></i> ${ _('Close') }</a>
-##               <a class="inactive-action pointer margin-left-10" title="${ _('Save session settings as default') }" rel="tooltip" data-bind="click: function() { $root.selectedNotebook().saveDefaultUserProperties($data) }"><i class="fa fa-save"></i> ${ _('Set as default settings') }</a>
+              %if conf.USE_DEFAULT_CONFIGURATION.get():
+              <a class="inactive-action pointer margin-left-10" title="${ _('Save session settings as default') }" rel="tooltip" data-bind="click: function() { $root.selectedNotebook().saveDefaultUserProperties($data) }"><i class="fa fa-save"></i> ${ _('Set as default settings') }</a>
+              %endif
               <!-- ko if: type()== 'impala' && typeof http_addr != 'undefined' -->
               <a class="margin-left-10" data-bind="attr: {'href': window.location.protocol + '//' + http_addr().replace(/^(https?):\/\//, '')}" target="_blank"><i class="fa fa-external-link"></i> <span data-bind="text: http_addr().replace(/^(https?):\/\//, '')"></span></a>
               <!-- /ko -->