aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-18 10:53:21 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-18 10:53:21 +0100
commit84701fd752cba8d48aa98a63c171c574d599622d (patch)
tree77536d2ebd163ac4b46dce7fa2a6eec0cb0e202f /sonar-server
parent46385881103f7b54c3be4d11fccfb3b3e7a4cf7a (diff)
downloadsonarqube-84701fd752cba8d48aa98a63c171c574d599622d.tar.gz
sonarqube-84701fd752cba8d48aa98a63c171c574d599622d.zip
Filters page : change the rendering of coverage on new code
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/metric.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb2
2 files changed, 9 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/metric.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/metric.rb
index d4bb9b2f58e..43411eb8b8d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/metric.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/metric.rb
@@ -202,6 +202,14 @@ class Metric < ActiveRecord::Base
enabled && !hidden && numeric? && !domain.blank?
end
+ # temporary method since 2.7. Will replace it by a field in database.
+ def on_new_code?
+ @on_new_code ||=
+ begin
+ key.start_with?('new_')
+ end
+ end
+
def to_xml(options={})
xml = Builder::XmlMarkup.new
xml.metric do
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
index 0534200ef9b..a09b2851798 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb
@@ -100,7 +100,7 @@
measure = @filter_context.measure(snapshot, column.metric)
%>
<% if column.variation %>
- <%= format_variation(measure, :index => @filter_context.period_index, :style => 'light') -%>
+ <%= format_variation(measure, :index => @filter_context.period_index, :style => (column.metric.on_new_code? ? 'none' : 'light')) -%>
<% else %>
<%= format_measure(measure) -%>
<% if @filter_context.selected_period? %>