]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3566 Make it clear that issue-related information displayed in widgets is desyn...
authorStas Vilchik <vilchiks@gmail.com>
Fri, 6 Feb 2015 16:41:40 +0000 (17:41 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 6 Feb 2015 16:41:40 +0000 (17:41 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/issues.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 4a4ea3e3341c8a3c4fc3a4543f19979f7e05c9a5..d50c712836a14cd1df2dde7088c40a138f5c75f0 100644 (file)
       is_issue_measure = get_issue_metrics.include? condition_metric.name
       is_not_difference_measure_with_period = !is_difference_measure && !period.blank? && !is_issue_measure
 
+      tooltip = message('widget.as_calculated_on_x', :params => l(@snapshot.created_at))
+
 
       unless level == 'OK' && !widget_properties['show_ok']
       -%>
       <div class="dashbox" style="margin: 10px; vertical-align: baseline">
         <p class="title"><%= condition_metric.short_name -%></p>
         <% if is_not_difference_measure_with_period %>
-          <span class="big"><%= format_measure(actual_measure) -%></span>
+          <span class="big" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom"><%= format_measure(actual_measure) -%></span>
         <% else %>
-          <span class="big"><%= format_measure(actual_measure, :url => drilldown_url) -%></span>
+          <span class="big" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom"><%= format_measure(actual_measure, :url => drilldown_url) -%></span>
         <% end %>
         <% if level == 'WARN' -%><%= operator -%> <%= format_measure(warning_measure) -%><% end -%>
         <% if level == 'ERROR' -%><%= operator -%> <%= format_measure(error_measure) -%><% end -%>
index a2e540c851177d073311be44866be1f07bc16896..b0b8814b20f0580b7de225d7067de25b4948bfcf 100644 (file)
@@ -19,6 +19,8 @@
    if @dashboard_configuration.selected_period?
      period_date = @snapshot.period_datetime(@dashboard_configuration.period_index).strftime('%FT%T%z')
    end
+
+   tooltip = message('widget.as_calculated_on_x', :params => l(@snapshot.created_at))
 %>
 
 <div class="widget-row">
@@ -28,7 +30,8 @@
       <div class="widget-measure-container">
         <div class="widget-measure widget-measure-main">
           <span class="widget-label"><%= message('metric.sqale_index.short_name') -%></span>
-          <a href="<%= url_for_drilldown('sqale_index') -%>" class="widget-link link-<%= widget.key %>-debt">
+          <a href="<%= url_for_drilldown('sqale_index') -%>" class="widget-link link-<%= widget.key %>-debt"
+             title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(technical_debt) -%>
           </a>
           <%= trend_icon(technical_debt) unless dashboard_configuration.selected_period? -%>
@@ -43,7 +46,8 @@
             <p class="small">
               <%= message('widget.rules.added') %>
               <a href="<%= url_for_drilldown('new_technical_debt', :period => @dashboard_configuration.period_index) -%>"
-                 class="varw widget-link widget-link-red link-<%= widget.key %>-new-debt">+<%= format_variation(new_technical_debt, :style => 'none', :default => '-') -%></a>
+                 class="varw widget-link widget-link-red link-<%= widget.key %>-new-debt"
+                 title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_technical_debt, :style => 'none', :default => '-') -%></a>
             </p>
             <% if estimated_cleared_technical_debt && estimated_cleared_technical_debt > 0 %>
               <p class="small">
         <span class="widget-label"><%= message('widget.rules.issues') -%></span>
         <span class="nowrap">
           <span class="link-<%= widget.key %>-issues">
-            <%= format_measure(issues, :url => "#{url_for(:controller => 'component_issues', :action => 'index')}?id=#{url_encode(@project.key)}") -%>
+            <a href="<%= "#{url_for(:controller => 'component_issues', :action => 'index')}?id=#{url_encode(@project.key)}" -%>" class="widget-link link-<%= widget.key %>-debt"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
+              <%= format_measure(issues) -%>
+            </a>
           </span>
           <%= trend_icon(issues) unless @dashboard_configuration.selected_period? -%>
         </span>
@@ -78,7 +85,8 @@
           <p class="small">
             <%= message('widget.rules.added') %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-issues">+<%= format_variation(new_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_issues, :style => 'none', :default => '-') -%></a>
           </p>
           <% if estimated_cleared_issues && estimated_cleared_issues > 0 %>
             <p class="small">
           <%= message('blocker') -%>
         </td>
         <td class="thin right nowrap">
-          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=BLOCKER" class="widget-link drilldown_BLOCKER">
+          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=BLOCKER"
+             class="widget-link drilldown_BLOCKER" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(blocker_issues) -%>
           </a>
         </td>
         <td class="thin nowrap">
           <% if @dashboard_configuration.selected_period? %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=BLOCKER|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-blocker-issues">+<%= format_variation(new_blocker_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-blocker-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_blocker_issues, :style => 'none', :default => '-') -%></a>
           <% else %>
             <%= trend_icon(blocker_issues, :empty => true) -%>
           <% end %>
           <%= message('critical') -%>
         </td>
         <td class="thin right nowrap">
-          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=CRITICAL" class="widget-link drilldown_CRITICAL">
+          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=CRITICAL"
+             class="widget-link drilldown_CRITICAL" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(critical_issues) -%>
           </a>
         </td>
         <td class="thin nowrap">
           <% if @dashboard_configuration.selected_period? %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=CRITICAL|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-critical-issues">+<%= format_variation(new_critical_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-critical-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_critical_issues, :style => 'none', :default => '-') -%></a>
           <% else %>
             <%= trend_icon(critical_issues, :empty => true) -%>
           <% end %>
           <%= message('major') -%>
         </td>
         <td class="thin right nowrap">
-          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MAJOR" class="widget-link drilldown_MAJOR">
+          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MAJOR"
+             class="widget-link drilldown_MAJOR" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(major_issues) -%>
           </a>
         </td>
         <td class="thin nowrap">
           <% if @dashboard_configuration.selected_period? %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MAJOR|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-major-issues">+<%= format_variation(new_major_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-major-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_major_issues, :style => 'none', :default => '-') -%></a>
           <% else %>
             <%= trend_icon(major_issues, :empty => true) -%>
           <% end %>
           <%= message('minor') -%>
         </td>
         <td class="thin right nowrap">
-          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MINOR" class="widget-link drilldown_MINOR">
+          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MINOR"
+             class="widget-link drilldown_MINOR" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(minor_issues) -%>
           </a>
         </td>
         <td class="thin nowrap">
           <% if @dashboard_configuration.selected_period? %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=MINOR|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-minor-issues">+<%= format_variation(new_minor_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-minor-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_minor_issues, :style => 'none', :default => '-') -%></a>
           <% else %>
             <%= trend_icon(minor_issues, :empty => true) -%>
           <% end %>
           <%= message('info') -%>
         </td>
         <td class="thin right nowrap">
-          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=INFO" class="widget-link drilldown_INFO">
+          <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=INFO"
+             class="widget-link drilldown_INFO" title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">
             <%= format_measure(info_issues) -%>
           </a>
         </td>
         <td class="thin nowrap">
           <% if @dashboard_configuration.selected_period? %>
             <a href="<%= url_for(:controller => 'component_issues', :action => 'index') -%>?id=<%= url_encode(@project.key) -%>#resolved=false|severities=INFO|createdAfter=<%= period_date -%>"
-               class="varw widget-link widget-link-red link-<%= widget.key %>-new-info-issues">+<%= format_variation(new_info_issues, :style => 'none', :default => '-') -%></a>
+               class="varw widget-link widget-link-red link-<%= widget.key %>-new-info-issues"
+               title="<%= tooltip -%>" data-toggle="tooltip" data-placement="bottom">+<%= format_variation(new_info_issues, :style => 'none', :default => '-') -%></a>
           <% else %>
             <%= trend_icon(info_issues, :empty => true) -%>
           <% end %>
index 4a470b21ea6853ea02d21b4e3b74c419a94783f9..2f1ea47272ed1602f0a5753b98517728b2cd235b 100644 (file)
@@ -31,4 +31,5 @@
 
 <script>
   jQuery('html').addClass('dashboard-page');
+  jQuery('[data-toggle="tooltip"]').tooltip({ container: '#body' });
 </script>
index 3698bebfe196a26fdd755977d2a638741611ea62..cd2218dda4a2c5e19bbdf8bad6b45aa81725ea9f 100644 (file)
@@ -1088,6 +1088,7 @@ select2.tooShort=Please enter at least {0} characters
 widgets.more=More
 widget.error_occurred_please_read_logs=An error occurred while trying to display the widget "{0}". Please contact the administrator.
 widget.unsupported_browser_warning=Your browser is out of date and does not support this widget.
+widget.as_calculated_on_x=As calculated on {0}
 
 widget.alerts.name=Quality Gate
 widget.alerts.description=Displays the project's quality gate status.