]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2855 Metrics are not sorted in the configuration panel of widgets
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Oct 2011 08:37:59 +0000 (10:37 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Oct 2011 08:37:59 +0000 (10:37 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb

index c5c358ee8b87a15744b9fb0956d64cbc1dd1b2d2..dfe9f84c012af653c2fbc58a7170062002aa4953 100644 (file)
@@ -31,7 +31,7 @@ module WidgetPropertiesHelper
       check_box_tag definition.key(), "true", val=='true'
 
     elsif definition.type.name()==WidgetProperty::TYPE_METRIC
-      select_tag definition.key(), options_grouped_by_domain(Metric.all.select{|m| m.display?}, val, :include_empty => true)
+      select_tag definition.key(), options_grouped_by_domain(Metric.all.select{|m| m.display?}.sort_by{|m| m.short_name}, val, :include_empty => true)
 
     elsif definition.type.name()==WidgetProperty::TYPE_STRING
       text_field_tag definition.key(), val, :size => 10