diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-23 16:22:16 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-03-23 16:22:16 +0100 |
commit | 34f989f6f9da2aba60b5d4a6cb71ce6cb597d271 (patch) | |
tree | f805f7c34ec83fa38b2c4201a814d8d7d5bc3fce /plugins | |
parent | 45b4fc44842d66987859f19975a5057930cf8a25 (diff) | |
download | sonarqube-34f989f6f9da2aba60b5d4a6cb71ce6cb597d271.tar.gz sonarqube-34f989f6f9da2aba60b5d4a6cb71ce6cb597d271.zip |
SONAR-3353 TimeMachine widget not correctly displayed
This happens if for all the metrics that must be displayed, each one
of them has only 1 snapshot with a non-null value. In this case, the
sparkline can't be displayed, so there's a layout problem in the
<table> element.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb index d89d4d60535..91526be032b 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb @@ -61,7 +61,14 @@ end # Should display the sparkline? - display_sparkline = snapshot_by_id.size > 1 && widget_properties["displaySparkLine"] + sparkline_urls_by_row = {} + if widget_properties["displaySparkLine"] + rows.each do |row| + sparkline_url = row.sparkline_url + sparkline_urls_by_row[row] = sparkline_url if sparkline_url + end + end + display_sparkline = !sparkline_urls_by_row.empty? %> <div style="overflow: auto;font-size: 12px;padding: 1px;"> @@ -101,8 +108,8 @@ <td width="1%" nowrap="nowrap" class="right"><%= format_measure(measure, :skip_span_id => true) %></td> <% end %> <% - sparkline_url=row.sparkline_url - if display_sparkline && sparkline_url + if display_sparkline + sparkline_url = sparkline_urls_by_row[row] %> <td width="1%"> <%= image_tag(sparkline_url) %> |