diff options
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb | 17 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/filters/_widget.html.erb | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb index e4e23281cde..4eb23b5b17f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb @@ -1,3 +1,18 @@ +<% + def treemap_metrics(filter) + metrics=filter.measure_columns.map{|col| col.metric} + size_metric=(metrics.size>=1 ? metrics[0] : Metric.by_key('ncloc')) + color_metric=nil + if metrics.size>=2 + color_metric=metrics[1] + end + if color_metric.nil? || !color_metric.treemap_color? + color_metric=Metric.by_key('violations_density') + end + [size_metric, color_metric] + end +%> + <% if @filter.period? %> <%= message('filters.treemap_not_supported_for_period_selection') -%> @@ -13,4 +28,4 @@ :context_type => 'filter', :context_id => @filter.id } -%> -<% end %>
\ No newline at end of file +<% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_widget.html.erb index 62cd8c0d34c..2022ed58ee3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_widget.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_widget.html.erb @@ -3,7 +3,7 @@ ['A','B','C','D'] end - @filter=::Filter.find(1) + @filter=::Filter.find(2) @filter_context=Filters.execute(@filter, self, params) %> |