]> source.dussan.org Git - sonarqube.git/commitdiff
FIX sort projects by name in widget configuration
authorDavid Gageot <david@gageot.net>
Mon, 4 Jun 2012 09:17:42 +0000 (11:17 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 4 Jun 2012 09:17:42 +0000 (11:17 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb

index dc5ccd3b85800585df81e1da53f76bd242bb571c..54b23ff922fd0ba6f3c56fbc74769fd42b99af18 100644 (file)
@@ -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)