From 8732e4464039578c070bd28b8a74b25c71a087fd Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Tue, 8 Apr 2014 15:47:20 +0200 Subject: [PATCH] SONAR-5003 Make options behave as described in WidgetProperty Javadoc (logical or => logical and) --- .../src/main/webapp/WEB-INF/app/helpers/properties_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb index b800be80d62..34fd3326d7e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb @@ -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 -- 2.39.5