From be8c67c1396c03bf71cc2fb7770668c54e903e32 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Thu, 5 May 2011 21:50:53 +0200 Subject: [PATCH] Fix 2 issues on drilldown pages SONAR-2411 Filter out best values for packages and modules in drilldown SONAR-2413 Empty variations in measure drilldown pages --- .../main/webapp/WEB-INF/app/models/drilldown.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb index 62148d4e8bd..dc527ee5340 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb @@ -61,12 +61,7 @@ class DrilldownColumn order += ' DESC' end - conditions='snapshots.root_snapshot_id=:root_sid AND snapshots.islast=:islast AND snapshots.scope=:scope AND snapshots.path LIKE :path AND project_measures.metric_id=:metric_id' - - if options[:exclude_zero_value] - conditions += " AND project_measures.#{value_column}<>0" - end - + conditions="snapshots.root_snapshot_id=:root_sid AND snapshots.islast=:islast AND snapshots.scope=:scope AND snapshots.path LIKE :path AND project_measures.metric_id=:metric_id AND project_measures.#{value_column} IS NOT NULL" condition_values={ :root_sid => (snapshot.root_snapshot_id || snapshot.id), :islast=>true, @@ -74,6 +69,15 @@ class DrilldownColumn :metric_id=>metric.id, :path => "#{snapshot.path}#{snapshot.id}.%"} + if value_column=='value' && metric.best_value + conditions<<' AND project_measures.value<>:best_value' + condition_values[:best_value]=metric.best_value + end + + if options[:exclude_zero_value] + conditions += " AND project_measures.#{value_column}<>0" + end + if options[:rule_id] conditions += ' AND project_measures.rule_id=:rule' condition_values[:rule]=options[:rule_id] -- 2.39.5