diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-07 12:30:45 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-10-07 12:30:45 +0200 |
commit | d92dc2e1e899f599abae88a7791926ce9c18005b (patch) | |
tree | 675734f95dbf39ca21b94e246f0bc31de71d4b6f /plugins | |
parent | 46d6f0d94f528184f02d8a7de268a49364ffaec7 (diff) | |
download | sonarqube-d92dc2e1e899f599abae88a7791926ce9c18005b.tar.gz sonarqube-d92dc2e1e899f599abae88a7791926ce9c18005b.zip |
SONAR-2456 Fails to display the component treemap when sonar.core.treemap.colormetric or sonar.core.treemap.sizemetric properties point to a removed metric
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb | 9 |
1 files changed, 7 insertions, 2 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 -%>', |