diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-26 12:01:17 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-26 12:01:17 +0200 |
commit | e5d8c474f9e3eb542a6a06e95a1ff06a84cea022 (patch) | |
tree | f49c82692a90944b5ce6e0edede0e0f21212dd85 /plugins | |
parent | 133212f106d8032370e18d4b6f16a52bf5e92206 (diff) | |
download | sonarqube-e5d8c474f9e3eb542a6a06e95a1ff06a84cea022.tar.gz sonarqube-e5d8c474f9e3eb542a6a06e95a1ff06a84cea022.zip |
SONAR-2701 Adjustments on TimeMachine widget
- Display only latest snapshot if number_of_versions set to 1
- Fix bug and actually always display oldest snapshot of the selected
time frame
- Improve CSS rendering
- Do not display last column if no sparkline
- Do not display metric domain if selected metrics all belong to the
same domain (= if there's only one domain to display)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/time_machine.html.erb | 16 |
1 files changed, 12 insertions, 4 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 e1d0aee470f..5ebeab3724f 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 @@ -49,6 +49,12 @@ end end + domains = [] + rows.select{|row| row.metric.val_type != Metric::VALUE_TYPE_DISTRIB}.each do |row| + domains << row.domain + end + display_domains = domains.uniq.size > 1 + rows.sort! %> @@ -70,7 +76,9 @@ <% end %> </th> <% end %> + <% if displaySparkLine %> <th> </th> + <% end %> </tr> </thead> @@ -78,10 +86,10 @@ <% previous_domain='' rows.select{|row| row.metric.val_type != Metric::VALUE_TYPE_DISTRIB}.each do |row| - if previous_domain != row.domain + if display_domains && previous_domain != row.domain %> <tr> - <td class="title" colspan="<%= snapshots.size + 2 -%>"><%= row.domain %></td> + <td class="title" colspan="<%= snapshots.size + (displaySparkLine ? 2 : 1) -%>"><%= row.domain %></td> </tr> <% end @@ -97,14 +105,14 @@ %> <td align="right" width="1%" nowrap="nowrap"><%= format_measure(measure, :skip_span_id => true) %></td> <% end %> - <td> <% sparkline_url=row.sparkline_url if displaySparkLine && sparkline_url %> + <td width="1%" > <%= image_tag(sparkline_url) %> - <% end %> </td> + <% end %> </tr> <% end %> </tbody> |