From 94666ba39152718952ac644f0a9cd2d97902774c Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 26 Jul 2011 10:07:49 +0200 Subject: SONAR-75 support alert thresholds --- .../src/main/resources/org/sonar/i18n/core.properties | 7 +++++-- sonar-server/src/main/webapp/WEB-INF/app/helpers/alerts_helper.rb | 8 ++++---- .../src/main/webapp/WEB-INF/app/views/alerts/_edit.html.erb | 4 ++-- .../src/main/webapp/WEB-INF/app/views/alerts/_new.html.erb | 4 ++-- .../src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties index 6606e70133d..600ce82f3c4 100644 --- a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties +++ b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties @@ -259,7 +259,7 @@ sidebar.system=System #------------------------------------------------------------------------------ # -# PAGES, sorted alphabetically +# PAGE TITLES, sorted alphabetically # #------------------------------------------------------------------------------ @@ -653,7 +653,10 @@ alert.error_tooltip=An error is triggered when this value is reached. alert.alert_created=Alert is created. alert.alert_updated=Alert is updated. alert.alert_deleted=Alert is deleted. - +alert.operator.<=is less than +alert.operator.>=is greater than +alert.operator.\==equals +alert.operator.!\==is not #------------------------------------------------------------------------------ # 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 3d2cb09006b..1b626ddf09b 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 @@ -18,10 +18,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 # module AlertsHelper - NUMERIC_THRESOLD_OPERATORS = {'is less than' => '<', 'is greater than' => '>', 'equals' => '=', 'is not' => '!=' } - BOOLEAN_THRESOLD_OPERATORS = {'is' => '='} - STRING_THRESOLD_OPERATORS = {'equals' => '=', 'is not' => '!=', 'is greater than' => '>', 'is less than' => '<'} - LEVEL_THRESOLD_OPERATORS = {'is' => '=', 'is not' => '!='} + NUMERIC_THRESOLD_OPERATORS = ['<', '>', '=', '!='] + BOOLEAN_THRESOLD_OPERATORS = ['='] + STRING_THRESOLD_OPERATORS = ['=', '!=', '>', '<'] + LEVEL_THRESOLD_OPERATORS = ['=', '!='] def operators_for_select(alert) if alert.metric.nil? 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 1e044177e8a..419fbf2b5ce 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 @@ -6,8 +6,8 @@ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_new.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_new.html.erb index 555ae12c738..572127c5ad8 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_new.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_new.html.erb @@ -28,8 +28,8 @@ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb index d118a985b31..f03e9edea33 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/alerts/_show.html.erb @@ -4,7 +4,7 @@ <%= h alert.name %> - <%= operators_for_select(alert).invert[alert.operator] %> + <%= message("alert.operator.#{alert.operator}") -%> <% if alert.metric && !alert.value_warning.blank? %> -- cgit v1.2.3