aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-core-plugin
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-08 10:00:19 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-08 10:00:19 +0200
commitc204a7295375a26ba83c33ccde0ba3121a3d388e (patch)
tree3bf9d23ab76a18aa949adec7a4728dbd16c5209d /plugins/sonar-core-plugin
parentd3a51c25cb09f85ce0bfe636787931229c0d3bb9 (diff)
parent211c40ec4a16dcd07b033aab9063d93d8b6c090f (diff)
downloadsonarqube-c204a7295375a26ba83c33ccde0ba3121a3d388e.tar.gz
sonarqube-c204a7295375a26ba83c33ccde0ba3121a3d388e.zip
Merge from branch 4.5
Diffstat (limited to 'plugins/sonar-core-plugin')
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb9
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb3
2 files changed, 9 insertions, 3 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb
index 771dc43a823..1d843dd911b 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb
@@ -4,6 +4,11 @@
filterId = widget_properties['filter'].to_i
maxItems = widget_properties['maxItems'].to_i
+ # SONAR-2456
+ # When metrics are removed, we have to manually set them to the default ones
+ colorMetric = widget_properties['colorMetric'] || Metric.by_key('coverage')
+ sizeMetric = widget_properties['sizeMetric'] || Metric.by_key('ncloc')
+
filter = MeasureFilter.find_by_id(filterId.to_i)
if filter
@widget_title = link_to h(filter.name), {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'list'}
@@ -23,8 +28,8 @@
<script>
(function () {
var metrics = [
- '<%= widget_properties['colorMetric'].name -%>',
- '<%= widget_properties['sizeMetric'].name -%>'
+ '<%= colorMetric.name -%>',
+ '<%= sizeMetric.name -%>'
],
query = [
'filter=<%= filterId -%>',
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb
index 76c152ec75a..4a5f9612a88 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb
@@ -33,7 +33,8 @@
metrics: {
<%= colorMetric.name -%>: {
name: '<%= colorMetric.short_name -%>',
- direction: <%= colorMetric.direction -%>
+ direction: <%= colorMetric.direction -%>,
+ type: '<%= colorMetric.val_type -%>'
},
<%= sizeMetric.name -%>: {
name: '<%= sizeMetric.short_name -%>'