From: simonbrandhof Date: Thu, 5 May 2011 19:50:53 +0000 (+0200) Subject: Fix 2 issues on drilldown pages X-Git-Tag: 2.8~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=be8c67c1396c03bf71cc2fb7770668c54e903e32;p=sonarqube.git 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 --- 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]