]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2074 Fix bug if event date slightly differs from snapshot date
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 13:45:17 +0000 (15:45 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 31 Aug 2011 13:45:17 +0000 (15:45 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
sonar-server/src/main/webapp/javascripts/protovis-sonar.js

index 5bdb2b17c57fc2b7c086bc85e807a006d5a2b24b..e8987f98ca467dd3e5775600fab833b108d567d8 100644 (file)
@@ -84,7 +84,9 @@
     js_events = "["
     events.keys().sort.each() do |e_date|
       e_details = events[e_date]
-      js_events += "{\"d\":d("
+      js_events += "{\"sid\":"
+      js_events += e_details[0].snapshot_id.to_s
+      js_events += ",\"d\":d("
       js_events += e_date.year.to_s
       js_events += ","
       # Need to decrease by 1 the month as the JS Date object start months at 0 (= January)
       e_details.each() do |e|
         js_events += "{\"n\":\""
         js_events += e.name
-        js_events +=  "\",\"ld\":\""
-        js_events += l e_date, :format => :long
         js_events += "\"},"
       end 
       js_events += "]},"
index bf717bc08955bc1a6ee113e4be026c0937240944..a2854578fb471e0cca6b2915327730534ed6cd86 100755 (executable)
@@ -129,14 +129,14 @@ SonarWidgets.Timeline.prototype.render = function() {
                .bottom(6)
                .shape("triangle")
                .strokeStyle("grey")
-               .fillStyle(function(e) {return e.l[0].ld == snapshots[idx].d ? eventHoverColor : eventColor})
+               .fillStyle(function(e) {return e.sid == snapshots[idx].sid ? eventHoverColor : eventColor})
                .add(pv.Dot)
                .radius(3)
-               .visible(function(e) { return e.l[0].ld == snapshots[idx].d;})
+               .visible(function(e) { return e.sid == snapshots[idx].sid;})
                .left(w/2+8)
                .top(24)
                .shape("triangle")
-               .fillStyle(function(e) {return e.l[0].ld == snapshots[idx].d ? eventHoverColor : eventColor})
+               .fillStyle(function(e) {return e.sid == snapshots[idx].sid ? eventHoverColor : eventColor})
                .strokeStyle("grey")
                .anchor("right")
                .add(pv.Label)