diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-09-09 10:13:48 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-09-09 10:14:51 +0200 |
commit | 89ed7ca079f1db2c362fbee7fcd835995d68a46d (patch) | |
tree | 55bd51074e8d71f48f4d4e1616ed2177838421cb /plugins | |
parent | eac67dbb9e3060e820491c4b576d7f6bf6b0cfeb (diff) | |
download | sonarqube-89ed7ca079f1db2c362fbee7fcd835995d68a46d.tar.gz sonarqube-89ed7ca079f1db2c362fbee7fcd835995d68a46d.zip |
SONAR-2074 Improve Timeline widget style
- Apply same event style as for the stack area chart
- Fix bug in event display (displays too many events)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb | 9 |
1 files changed, 8 insertions, 1 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 58f6fe9376d..73b0d9a951b 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 @@ -72,7 +72,14 @@ # Prepare also event structure if required unless widget_properties["hideEvents"] events = {} - Event.find(:all, :conditions => {:resource_id => @resource.id}, :order => 'event_date').each() do |event| + unless from_date + # find the oldest date + metric_data_map.values.each() do |metric_data_array| + first_date = Time.parse(metric_data_array[0][:date]) + from_date = first_date if !from_date || from_date > first_date + end + end + Event.find(:all, :conditions => ["resource_id=? AND event_date>=?", @resource.id, from_date], :order => 'event_date').each() do |event| if events[event.event_date] events[event.event_date] << event else |