aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
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? %>