From: Fabrice Bellingard Date: Fri, 20 Jan 2012 10:44:54 +0000 (+0100) Subject: SONAR-3081 "Violations" widget shows the number of "new violations" X-Git-Tag: 2.14~264 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=23e59123b93c3f478d3b8e0f3fbd134c93b565ea;p=sonarqube.git SONAR-3081 "Violations" widget shows the number of "new violations" And links it to the drilldown service using the correct metric to easily find new violations. --- diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb index 8db7c377ff8..e0a4b23d8c6 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb @@ -2,22 +2,30 @@ violations=@snapshot.measure('violations') density=@snapshot.measure('violations_density') blocker_violations = @snapshot.measure('blocker_violations') - critical_violations = @snapshot.measure('critical_violations') - major_violations = @snapshot.measure('major_violations') - minor_violations = @snapshot.measure('minor_violations') - info_violations = @snapshot.measure('info_violations') + critical_violations = @snapshot.measure('critical_violations') + major_violations = @snapshot.measure('major_violations') + minor_violations = @snapshot.measure('minor_violations') + info_violations = @snapshot.measure('info_violations') + new_violations=@snapshot.measure('new_violations') %> + + +
-
-

<%= message('widget.rules.violations') -%>

-
- - <%= format_measure(violations, :url => url_for(:controller => 'drilldown', :action => 'violations', :id => @project.key)) -%> - - <%= dashboard_configuration.selected_period? ? format_variation(violations) : trend_icon(violations) -%> -
+
+

<%= message('widget.rules.violations') -%>

+
+ + <%= format_measure(violations, :url => url_for(:controller => 'drilldown', :action => 'violations', :id => @project.key)) -%> + + <%= dashboard_configuration.selected_period? ? format_variation(violations) : trend_icon(violations) -%> + <% if @dashboard_configuration.selected_period? %> +
+ + <%= message('widget.rules.on_new_code') -%> + <%= format_variation(new_violations, :style => 'none', :default => '-') -%> + + <% end %> +

<%= message('widget.rules.rules_compliance') -%>

@@ -25,8 +33,9 @@ <%= dashboard_configuration.selected_period? ? format_variation(density) : trend_icon(density) -%>
-
-
<% values=[blocker_violations,critical_violations,major_violations,minor_violations,info_violations] diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 00435931bb2..c6363a34c7a 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -639,6 +639,7 @@ widget.rules.name=Rules Compliance widget.rules.description=Reports violations and compliance index on coding standards. widget.rules.violations=Violations widget.rules.rules_compliance=Rules compliance +widget.rules.on_new_code=On new code: widget.size.name=Size metrics widget.size.description=Reports general metrics on the size of the project.