From: Jean-Baptiste Vilain Date: Mon, 22 Jul 2013 13:47:34 +0000 (+0200) Subject: SONAR-3392 Fixed case-sensitive sorting when listing permission templates X-Git-Tag: 3.7~33 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3b9845b59f219ee650890577bf64b6c65f14acc0;p=sonarqube.git SONAR-3392 Fixed case-sensitive sorting when listing permission templates --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb index 1457c3c0fe3..5b4b517a7a4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb @@ -184,7 +184,7 @@ class PermissionTemplatesController < ApplicationController def default_templates_form all_templates = Internal.permission_templates.selectAllPermissionTemplates - @permission_templates_options = all_templates.sort_by {|t| t.name}.collect {|t| [t.name, t.key]} + @permission_templates_options = all_templates.sort_by {|t| t.name.downcase}.collect {|t| [t.name, t.key]} @root_qualifiers = get_root_qualifiers @default_templates = get_default_templates_per_qualifier(@root_qualifiers) @@ -228,7 +228,7 @@ class PermissionTemplatesController < ApplicationController templates_names.each do |template_name| permission_templates << Internal.permission_templates.selectPermissionTemplate(template_name) end - permission_templates.sort_by {|t| t.name} + permission_templates.sort_by {|t| t.name.downcase} end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb index 126d77112ae..c9db2eba7bb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb @@ -77,7 +77,7 @@ class RolesController < ApplicationController # GET /roles/apply_template_form?projects=&qualifier= def apply_template_form - @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().sort_by {|t| t.name}.collect {|pt| [pt.name, pt.key]} + @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().sort_by {|t| t.name.downcase}.collect {|pt| [pt.name, pt.key]} render :partial => 'apply_template_form', :locals => {:components => params[:projects], :project_name => params[:project_name], :qualifier => params[:qualifier] || 'TRK'} end