From b288cca1db46743ed67056b6e962420dd1855d1e Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 10 Oct 2013 16:06:14 +0200 Subject: [PATCH] SONAR-4717 Add technical_debt_density in Technical Debt widget --- .../resources/org/sonar/l10n/core.properties | 1 + .../core/widgets/technical_debt.html.erb | 38 ++++++++++++++----- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index a97a6bbae3f..75fa2f3fc5e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -1160,6 +1160,7 @@ widget.technical_debt.name=Technical Debt widget.technical_debt.description=Displays the technical debt, also known as remediation cost. widget.technical_debt.days=days widget.technical_debt.no_info_available=No information available. +widget.technical_debt.technical_debt_density=Technical Debt Density widget.technical_debt_pyramid.name=Technical Debt Pyramid widget.technical_debt_pyramid.description=Displays the technical debt by characteristics. Characteristics located at the bottom should be addressed before those on top. diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/technical_debt.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/technical_debt.html.erb index 1e5f4b5c447..5bf7dfd312e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/technical_debt.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/technical_debt.html.erb @@ -1,18 +1,36 @@ <% - index = measure('sqale_index') - unless index && index.value + technical_debt = measure('sqale_index') + technical_debt_density = measure('technical_debt_density') + unless technical_debt && technical_debt.value %>

<%= message('widget.technical_debt.name') -%>

<%= message('widget.technical_debt.no_info_available') -%> <% else %> -
-

<%= message('widget.technical_debt.name') -%>

-

- - <%= number_with_precision(index.value, :precision => 1) -%> <%= message('widget.technical_debt.days') -%> - <%= dashboard_configuration.selected_period? ? format_variation(index) : trend_icon(index) -%> -

-
+ + + + + + +
+
+

<%= message('widget.technical_debt.name') -%>

+

+ + <%= number_with_precision(technical_debt.value, :precision => 1) -%> <%= message('widget.technical_debt.days') -%> + <%= dashboard_configuration.selected_period? ? format_variation(technical_debt) : trend_icon(technical_debt) -%> +

+
+
+
+

<%= message('widget.technical_debt.technical_debt_density') -%>

+

+ + <%= number_with_precision(technical_debt_density.value, :precision => 1) -%> + <%= dashboard_configuration.selected_period? ? format_variation(technical_debt_density) : trend_icon(technical_debt_density) -%> +

+
+
<% end %> -- 2.39.5