From 88195bbe5d8864fbb3ddd6d62718206075be6f4b Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 24 Aug 2011 15:22:41 +0200 Subject: [PATCH] SONAR-2074 Fix wrong path to Ruby template + rename "widgetHeight" into "chartHeight" --- .../org/sonar/plugins/core/widgets/TimelineWidget.java | 8 ++++---- .../org/sonar/plugins/core/widgets/timeline.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java index 0569f5ff6d5..7483f0018cc 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java @@ -28,11 +28,11 @@ import org.sonar.api.web.WidgetPropertyType; @WidgetProperties( { @WidgetProperty(key = "chartTitle", type = WidgetPropertyType.STRING), - @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC), + @WidgetProperty(key = "metric1", type = WidgetPropertyType.METRIC, defaultValue = "ncloc"), @WidgetProperty(key = "metric2", type = WidgetPropertyType.METRIC), @WidgetProperty(key = "metric3", type = WidgetPropertyType.METRIC), @WidgetProperty(key = "displayEvents", type = WidgetPropertyType.BOOLEAN), - @WidgetProperty(key = "widgetHeight", type = WidgetPropertyType.INTEGER) + @WidgetProperty(key = "chartHeight", type = WidgetPropertyType.INTEGER) } ) public class TimelineWidget extends AbstractRubyTemplate implements RubyRailsWidget { @@ -46,7 +46,7 @@ public class TimelineWidget extends AbstractRubyTemplate implements RubyRailsWid @Override protected String getTemplatePath() { - //return "/org/sonar/plugins/core/widgets/timeline.html.erb"; - return "/Users/fbellingard/Documents/Sonar/repos/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb"; + return "/org/sonar/plugins/core/widgets/timeline.html.erb"; + //return "/Users/fbellingard/Documents/Sonar/repos/sonar/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb"; } } \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb index 0979c233583..274eeda8f2e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb @@ -94,7 +94,7 @@ js_translations += "}" # Check if the widget height was specified - widgetHeight = widget_properties["widgetHeight"].to_i == 0 ? "null" : widget_properties["widgetHeight"] + chartHeight = widget_properties["chartHeight"].to_i == 0 ? "null" : widget_properties["chartHeight"] %> <% if widget_properties["chartTitle"] %> @@ -119,7 +119,7 @@ var translations = <%= js_translations -%>; var events = <%= js_events ? js_events : "null" -%>; var timeline = new SonarWidgets.Timeline('timeline-chart-<%= widget.id -%>') - .height(<%= widgetHeight -%>) + .height(<%= chartHeight -%>) .data(data) .snapshots(snapshots) .metrics(metrics) -- 2.39.5