From 453774634e92f2fce10611d0ec4480b19bb38b1f Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 28 Nov 2012 17:41:50 +0100 Subject: [PATCH] SONAR-1352 add period select on alerts quality profiles page --- .../resources/org/sonar/l10n/core.properties | 1 + .../WEB-INF/app/helpers/alerts_helper.rb | 10 ++++ .../WEB-INF/app/views/alerts/_edit.html.erb | 8 ++++ .../WEB-INF/app/views/alerts/_new.html.erb | 47 ++++++++++++------- 4 files changed, 48 insertions(+), 18 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 8ab87ede62f..95436a19e3b 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 @@ -220,6 +220,7 @@ since_version_detailed=since version {0} ({1}) since_previous_version=since previous version since_previous_version_detailed=since previous version ({0}) time_changes=Time changes +absolute_value=Absolute value #------------------------------------------------------------------------------ # diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb index 87355bd7c94..d94f56c2d0e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb @@ -88,4 +88,14 @@ module AlertsHelper end end + def period_select_options(alert, index) + if index + selected = (alert.period == index ? 'selected' : '') + "" + else + selected = (alert.period ? 'selected' : '') + "" + end + end + end \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_edit.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_edit.html.erb index 273f8c23a7d..c539bdc0c8f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_edit.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_edit.html.erb @@ -4,6 +4,14 @@ <%= h alert.name %> + + + - - <% Metric.domains.each do |domain| %> - - <%# 'new_' metrics excluded due to SONAR-2396 %> - <% Metric.by_domain(domain).select{ |m| m.alertable? && !m.name.start_with?("new_") }.each do |metric| %> - - <% end %> - - <% end %> - + + + + + -- 2.39.5