]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2074 Fix wrong path to Ruby template
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 24 Aug 2011 13:22:41 +0000 (15:22 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 24 Aug 2011 13:22:41 +0000 (15:22 +0200)
+ rename "widgetHeight" into "chartHeight"

plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TimelineWidget.java
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb

index 0569f5ff6d5f1b6faee507087eff57beab346f1f..7483f0018ccccef4d4b49c21af59881b0173b40b 100644 (file)
@@ -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
index 0979c233583cb97f80ea1910844a447bd16eb3f3..274eeda8f2e261d3d8b7f7b7907d289a1b94f51e 100644 (file)
@@ -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"] %>
          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)