aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-08-13 10:15:20 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-08-13 10:15:20 +0200
commit09e31c6fb9d76c6ae24f0defce674205f1e7412f (patch)
treee928d919d41c9f30faea54138b86ad8dbb83ad68
parent71ba082eb96d16a2d96cb6e57bd1a93263da09c5 (diff)
downloadsonarqube-09e31c6fb9d76c6ae24f0defce674205f1e7412f.tar.gz
sonarqube-09e31c6fb9d76c6ae24f0defce674205f1e7412f.zip
SONAR-4568 On a boolean rule parameter, this is not possible to set back the parameter value to 'Default'
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb4
2 files changed, 5 insertions, 4 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 1450440a5b2..b0b9dab8659 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
@@ -307,7 +307,7 @@ class RulesConfigurationController < ApplicationController
def update_param
verify_post_request
access_denied unless has_role?(:profileadmin)
- require_parameters :profile_id, :param_id, :active_rule_id, :value
+ require_parameters :profile_id, :param_id, :active_rule_id
profile = Profile.find(params[:profile_id].to_i)
rule_param = RulesParameter.find(params[:param_id].to_i)
active_rule = ActiveRule.find(params[:active_rule_id].to_i)
@@ -327,7 +327,8 @@ class RulesConfigurationController < ApplicationController
active_param = nil
java_facade.ruleParamChanged(profile.id, active_rule.id, rule_param.name, old_value, nil, current_user.name)
end
- # let's reload the active rule
+
+ # let's reload the active rule
active_rule = ActiveRule.find(active_rule.id)
render :partial => 'rule', :locals => {:profile => profile, :rule => active_rule.rule, :active_rule => active_rule}
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 34afac5ad91..76037b191c3 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
@@ -8,7 +8,7 @@
<td class="form-key-cell"><%= parameter.name -%></td>
<td class="form-val-cell">
- <form onsubmit="$j.ajax({ url: '<%= ApplicationController.root_context -%>/rules_configuration/update_param/<%=active_param_id-%>?active_rule_id=<%=active_rule_id-%>&param_id=<%=parameter.id-%>&profile_id=<%=profile.id-%>',
+ <form onsubmit="$j.ajax({ url: '<%= ApplicationController.root_context -%>/rules_configuration/update_param/<%=active_param_id-%>?active_rule_id=<%=active_rule_id-%>&param_id=<%=parameter.id-%>&profile_id=<%=profile.id-%>',
type:'post',beforeSend: function(request){$j('#param_loading_<%=parameter.id-%>').show();$j('#error_<%=parameter.id-%>').hide();},
data: $j(this).serialize(),
success: function(htmlSuccess){$j('#rule_<%=rule.id-%>').replaceWith(htmlSuccess);},
@@ -23,7 +23,7 @@
<span id="text_<%= parameter.id -%>"><%= param_value_input(parameter, param_value, :disabled => read_only) -%></span>
<% unless read_only %>
- <%= submit_tag message('update_verb') %>
+ <%= submit_tag(message('update_verb'), :id => 'submit_' + parameter.id.to_s) %>
<img src="<%= ApplicationController.root_context -%>/images/loading.gif" style="display:none;" id="param_loading_<%= parameter.id -%>">
<% if active_parameter and active_parameter.errors.size>0 %>
<span class="error"><%= active_parameter.errors.on 'value' %></span>