diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-04 22:56:36 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-04 22:56:36 +0100 |
commit | a95eb1f87bfb7505d46b3d49f33d5b9a7eed3262 (patch) | |
tree | b1a5306cb043d828ed0f46e78cf498ef8777a50c /plugins/sonar-core-plugin | |
parent | 42b7491b63b25cdeb3fa208bcf51dfebb4ab20dd (diff) | |
download | sonarqube-a95eb1f87bfb7505d46b3d49f33d5b9a7eed3262.tar.gz sonarqube-a95eb1f87bfb7505d46b3d49f33d5b9a7eed3262.zip |
SONAR-3825 fix the existing treemap widget
Diffstat (limited to 'plugins/sonar-core-plugin')
2 files changed, 12 insertions, 9 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java index 79d44b52137..05774d5c705 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TreemapWidget.java @@ -23,7 +23,6 @@ import org.sonar.api.measures.CoreMetrics; import org.sonar.api.web.*; @WidgetProperties({ - @WidgetProperty(key = "heightInPercents", type= WidgetPropertyType.INTEGER, defaultValue = "50", description = "Height in percents of width"), @WidgetProperty(key = "sizeMetric", type= WidgetPropertyType.METRIC, defaultValue = CoreMetrics.NCLOC_KEY, description = "Default metric for size"), @WidgetProperty(key = "colorMetric", type= WidgetPropertyType.METRIC, defaultValue = CoreMetrics.VIOLATIONS_DENSITY_KEY, description = "Default metric for color") }) 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 ac08223ba83..75f765a35b1 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 @@ -1,8 +1,12 @@ -<%= render :partial => 'treemap/treemap_container', :locals => { - :treemap_id => widget.id, - :size_metric => widget_properties['sizeMetric'], - :color_metric => widget_properties['colorMetric'], - :height_in_percents => widget_properties['heightInPercents'], - :context_type => 'resource', - :context_id => @resource.id - } -%>
\ No newline at end of file +<% + size_metric = widget_properties['sizeMetric'] + color_metric = widget_properties['colorMetric'] + + filter = MeasureFilter.new + filter.set_criteria_value('baseId', @resource.id) + filter.set_criteria_value('display', 'treemap') + filter.set_criteria_value('tmSize', size_metric.key) if size_metric + filter.set_criteria_value('tmColor', color_metric.key) if color_metric + filter.execute(self, :user => current_user) +%> +<%= render :partial => "measures/display_treemap", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %> |