From fe54c6c721c33638855da5baed61dfc1a9c5cc09 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 31 Aug 2011 15:45:17 +0200 Subject: [PATCH] SONAR-2074 Fix bug if event date slightly differs from snapshot date --- .../org/sonar/plugins/core/widgets/timeline.html.erb | 6 +++--- sonar-server/src/main/webapp/javascripts/protovis-sonar.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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 5bdb2b17c57..e8987f98ca4 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 @@ -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) @@ -101,8 +103,6 @@ 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 += "]}," diff --git a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js index bf717bc0895..a2854578fb4 100755 --- a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js +++ b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js @@ -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) -- 2.39.5