From 0c4f2bbafbe616e95d73b983c3e7b5be29644720 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 5 Jul 2012 17:13:08 +0200 Subject: [PATCH] SONAR-3432 Add feedback on rule property validation --- .../app/controllers/rules_configuration_controller.rb | 2 +- .../app/views/rules_configuration/_rule_param.html.erb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb index 160e31a981c..e2a4843aece 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb @@ -299,7 +299,7 @@ class RulesConfigurationController < ApplicationController active_param = ActiveRuleParameter.new(:rules_parameter => rule_param, :active_rule => active_rule ) if active_param.nil? old_value = active_param.value active_param.value = value - if active_param.save && active_param.valid? + if active_param.save! && active_param.valid? active_param.reload java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, value, current_user.name) end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb index 1078ed98dc4..b7410b1ecd8 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb @@ -13,10 +13,11 @@ <%= parameter.name -%> - <%= form_remote_tag :url => {:action => 'update_param', :id => active_param_id, :profile_id => profile.id, :param_id => parameter.id, :active_rule_id => active_rule_id}, - :update => "rule_#{rule.id}", + <%= form_remote_tag :url => {:action => :update_param, :id => active_param_id, :profile_id => profile.id, :param_id => parameter.id, :active_rule_id => active_rule_id}, + :update => {:success => "rule_#{rule.id}", :failure => "error_#{rule.id}"}, :loading => "$('param_loading_#{parameter.id}').show();", :complete => "$('desc_#{rule.id}').show();", + :failure => "$('error_#{rule.id}').show();$('param_loading_#{parameter.id}').hide();", :html => {:name => "form-#{u parameter.name}"} %> <% @@ -31,6 +32,7 @@ textfield += "
" end %> + <%= textfield -%> <% if !read_only %> -- 2.39.5