]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5003 Make options behave as described in WidgetProperty Javadoc (logical or...
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Apr 2014 13:47:20 +0000 (15:47 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Apr 2014 13:47:20 +0000 (15:47 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb

index b800be80d62c2bef87f9ff8bad1a364c3d528606..34fd3326d7e9adc187d0739dbe76d2f6e5636589 100644 (file)
@@ -123,7 +123,7 @@ module PropertiesHelper
 
   def metrics_filtered_by(options)
     Metric.all.select(&:display?).sort_by(&:short_name).select do |metric|
-      options.blank? || options.any? { |option| metric_matches(metric, option) }
+      options.blank? || options.all? { |option| metric_matches(metric, option) }
     end
   end
 
@@ -133,7 +133,6 @@ module PropertiesHelper
     elsif /domain:(.*)/.match(option)
       Regexp.new(Regexp.last_match(1)).match(metric.domain)
     elsif /type:(.*)/.match(option)
-      false
       Regexp.last_match(1).split(',').any? { |type| (type == metric.value_type) || ((type == 'NUMERIC') && metric.numeric?) }
     else
       false