diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-18 11:55:58 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-10-18 11:55:58 +0200 |
commit | adacc6073e309ab22991f0185ccd4055bceb6b2f (patch) | |
tree | b693e5cfcde553812cceb063e523d8c3d2d6f047 | |
parent | 5f5c2ec04cce8e225e4bb8c564defe88b6a8ca73 (diff) | |
download | sonarqube-adacc6073e309ab22991f0185ccd4055bceb6b2f.tar.gz sonarqube-adacc6073e309ab22991f0185ccd4055bceb6b2f.zip |
Fix configuration of the widgets that need selection of metrics
See http://sonar.15.n6.nabble.com/Release-Candidate-of-Sonar-3-3-tp5004192p5004199.html
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index f5c9a89d69c..eb887f649f5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -713,7 +713,12 @@ module ApplicationHelper select_tag_prompt='' end - metrics_by_domain=metrics.sort_by(&:short_name).inject({}) { |h, metric| h[metric.domain]||=[]; h[metric.domain]<<[metric.short_name, metric.key]; h } + metrics_by_domain=metrics.sort_by(&:short_name).inject({}) do |h, metric| + domain=metric.domain||'' + h[domain]||=[] + h[domain]<<[metric.short_name, metric.key] + h + end html = select_tag(name, grouped_options_for_select(metrics_by_domain, options[:selected_key], select_tag_prompt), :multiple => options[:multiple], |