From d4522ab9a01367e34ca027e3f76954845ddfcfd8 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 4 Jun 2012 11:17:42 +0200 Subject: [PATCH] FIX sort projects by name in widget configuration(cherry picked from commit 09711b542dd77597b8f2fb2e0eaa4f0d8f0da86d) --- .../webapp/WEB-INF/app/helpers/widget_properties_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb index dc5ccd3b858..54b23ff922f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb @@ -51,7 +51,10 @@ module WidgetPropertiesHelper end def resource_value_field(value) - select_tag 'resource_id', options_id(value, Project.all(:conditions => {:scope => 'PRJ', :qualifier => 'TRK', :enabled => true})) + projects = Project.all(:conditions => {:scope => 'PRJ', :qualifier => 'TRK', :enabled => true}) + sorted_projects = Api::Utils.insensitive_sort(projects, &:name) + + select_tag 'resource_id', options_id(value, sorted_projects) end def options_id(value, values) -- 2.39.5