diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2013-12-23 12:21:14 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2013-12-23 12:21:14 +0100 |
commit | 676932e588e925e22da9f5b83313607258f392df (patch) | |
tree | a1ac17efa0a7f008a6e39591c3860e3ca1b36007 /sonar-server/src/main/webapp/WEB-INF | |
parent | 193260715b52e175f6875a4e0056cebdd5d30fa3 (diff) | |
download | sonarqube-676932e588e925e22da9f5b83313607258f392df.tar.gz sonarqube-676932e588e925e22da9f5b83313607258f392df.zip |
SONAR-4535 Reindex active rule note update
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/new_rules_configuration_controller.rb | 27 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule.html.erb | 4 |
2 files changed, 14 insertions, 17 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/new_rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/new_rules_configuration_controller.rb index 5a7a60b6417..2000c99a2ad 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/new_rules_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/new_rules_configuration_controller.rb @@ -309,14 +309,13 @@ class NewRulesConfigurationController < ApplicationController access_denied unless has_role?(:profileadmin) require_parameters :param_id, :active_rule_id, :profile_id + result = nil call_backend do - Internal.quality_profiles.updateActiveRuleParam(params[:active_rule_id].to_i, params[:param_id], params[:value]) + result = Internal.quality_profiles.updateActiveRuleParam(params[:profile_id].to_i, params[:active_rule_id].to_i, params[:param_id], params[:value]) end - - # TODO use a QProfileRule instead of rails objects - profile = Profile.find(params[:profile_id].to_i) - active_rule = ActiveRule.find(params[:active_rule_id].to_i) - render :partial => 'rule', :locals => {:profile => profile, :rule => active_rule.rule, :active_rule => active_rule} + profile = result.profile + rule = result.rule + render :partial => 'rule', :locals => {:profile => profile, :rule => rule} end @@ -342,13 +341,11 @@ class NewRulesConfigurationController < ApplicationController verify_post_request require_parameters :active_rule_id, :note + rule = nil call_backend do - Internal.quality_profiles.updateActiveRuleNote(params[:active_rule_id].to_i, params[:note]) + rule = Internal.quality_profiles.updateActiveRuleNote(params[:active_rule_id].to_i, params[:note]) end - - # TODO use a QProfileRule instead of rails objects - active_rule = ActiveRule.find(params[:active_rule_id]) - render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :profile => active_rule.rules_profile} + render :partial => 'active_rule_note', :locals => {:rule => rule} end @@ -356,13 +353,11 @@ class NewRulesConfigurationController < ApplicationController verify_post_request require_parameters :active_rule_id + rule = nil call_backend do - Internal.quality_profiles.deleteActiveRuleNote(params[:active_rule_id].to_i) + rule = Internal.quality_profiles.deleteActiveRuleNote(params[:active_rule_id].to_i) end - - # TODO use a QProfileRule instead of rails objects - active_rule = ActiveRule.find(params[:active_rule_id]) - render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :profile => active_rule.rules_profile} + render :partial => 'active_rule_note', :locals => {:rule => rule} end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule.html.erb index 31694628def..01d8a2d03de 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule.html.erb @@ -1,3 +1,5 @@ +<% #locals = rule, profile -%> + <td nowrap valign="top" class="left" x="<%= rule.severity -%>" width="1%"> <form id="levels_<%= rule.id -%>" action="" class="rule-levels-form"> <% enable_modification = profiles_administrator? @@ -87,7 +89,7 @@ <% end %> <div id="active_rule_note_<%= rule.activeRuleId -%>"> - <%= render :partial => 'active_rule_note', :locals => {:rule => rule, :profile => profile} %> + <%= render :partial => 'active_rule_note', :locals => {:rule => rule} %> </div> <% if profiles_administrator? %> |