From: Jean-Baptiste Lievremont Date: Mon, 7 Apr 2014 15:50:36 +0000 (+0200) Subject: SONAR-5140 Allow selection of RATING metrics for color in treemap widget X-Git-Tag: 4.3~113 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b2745787f1cf99e238e4825cf8e01cc0b5394211;p=sonarqube.git SONAR-5140 Allow selection of RATING metrics for color in treemap widget --- 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 45c4b43f7c3..5cd3a3aa680 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 @@ -26,7 +26,7 @@ import org.sonar.api.web.WidgetPropertyType; @WidgetProperties({ @WidgetProperty(key = "sizeMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.NCLOC_KEY), - @WidgetProperty(key = "colorMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.VIOLATIONS_DENSITY_KEY, options = "type:PERCENT"), + @WidgetProperty(key = "colorMetric", type = WidgetPropertyType.METRIC, defaultValue = CoreMetrics.VIOLATIONS_DENSITY_KEY, options = "type:PERCENT,RATING"), @WidgetProperty(key = "heightInPercents", type = WidgetPropertyType.INTEGER, optional = true, defaultValue = "55") }) public class TreemapWidget extends CoreWidget { diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/measures/MeasureFilterTreemapWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/measures/MeasureFilterTreemapWidget.java index f14802d615d..4b0bbb545a8 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/measures/MeasureFilterTreemapWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/measures/MeasureFilterTreemapWidget.java @@ -29,7 +29,7 @@ import static org.sonar.api.web.WidgetScope.GLOBAL; @WidgetProperties({ @WidgetProperty(key = MeasureFilterTreemapWidget.FILTER_PROPERTY, type = WidgetPropertyType.FILTER, optional = false), @WidgetProperty(key = MeasureFilterTreemapWidget.SIZE_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true), - @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true, options = "type:PERCENT"), + @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true, options = "type:PERCENT,RATING"), @WidgetProperty(key = MeasureFilterTreemapWidget.HEIGHT_PERCENTS_PROPERTY, type = WidgetPropertyType.INTEGER, optional = true, defaultValue = "55", description = "Height in percents of width"), @WidgetProperty(key = MeasureFilterListWidget.DISPLAY_FILTER_DESCRIPTION, type = WidgetPropertyType.BOOLEAN, defaultValue = "false") diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb index e1114603021..c42b6acbf0c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb @@ -1,5 +1,5 @@ <% -if metric && metric.worst_value && metric.best_value +if metric && metric.worst_value && metric.best_value && (metric.val_type != Metric::VALUE_TYPE_RATING) if metric.worst_value<%= metric.suffix -%> <% end -%> \ No newline at end of file +%>