diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-26 10:07:49 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-26 10:07:49 +0200 |
commit | 94666ba39152718952ac644f0a9cd2d97902774c (patch) | |
tree | 3cee782be4dc5ee9effc7863d51d6be825c7a7c7 /sonar-server | |
parent | 16e8d04a3d2d7d2ffc199c0b60f0c571ba3fe0d1 (diff) | |
download | sonarqube-94666ba39152718952ac644f0a9cd2d97902774c.tar.gz sonarqube-94666ba39152718952ac644f0a9cd2d97902774c.zip |
SONAR-75 support alert thresholds
Diffstat (limited to 'sonar-server')
4 files changed, 9 insertions, 9 deletions
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 @@ </td> <td width="10%" nowrap> <select id="alert_operator" name="alert[operator]"> - <% operators_for_select(alert).each_pair do |name, key| %> - <option value="<%= key -%>" <%= 'selected' if alert.operator==key -%>><%= name -%></option> + <% operators_for_select(alert).each do |key| %> + <option value="<%= key -%>" <%= 'selected' if alert.operator==key -%>><%= message("alert.operator.#{key}") -%></option> <% end %> </select> </td> 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 @@ <select id="alert_operator" name="alert[operator]"> <% default_op=default_operator(@alert) - operators_for_select(@alert).each_pair do |name, key| %> - <option value="<%= key -%>" <%= 'selected' if default_op==key -%>><%= name -%></option> + operators_for_select(@alert).each do |key| %> + <option value="<%= key -%>" <%= 'selected' if default_op==key -%>><%= message("alert.operator.#{key}") -%></option> <% end %> </select> </td> 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 %> </td> <td width="10%"> - <%= operators_for_select(alert).invert[alert.operator] %> + <%= message("alert.operator.#{alert.operator}") -%> </td> <td width="20%"> <% if alert.metric && !alert.value_warning.blank? %> |