aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins CI <ci@sonarsource.com>2012-07-23 17:00:37 +0200
committerJenkins CI <ci@sonarsource.com>2012-07-23 17:00:37 +0200
commitb7d658a3396df54ee1d4e0982ea31cbbe6b7e902 (patch)
tree5aaf7075104ee2351312e1a24a67f5137761105f
parentac72d19793d539d029759f53bf85195156343b63 (diff)
parent672f34433e52f15d851dff4978878887e69c2969 (diff)
downloadsonarqube-b7d658a3396df54ee1d4e0982ea31cbbe6b7e902.tar.gz
sonarqube-b7d658a3396df54ee1d4e0982ea31cbbe6b7e902.zip
Automatic merge from branch-3.2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb2
5 files changed, 12 insertions, 6 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 e2a4843aece..d9b6b28a323 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
@@ -342,7 +342,7 @@ class RulesConfigurationController < ApplicationController
note.text = params[:note]
note.user_login = current_user.login
note.save!
- render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true }
+ render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true, :profile => active_rule.rules_profile }
end
@@ -350,7 +350,7 @@ class RulesConfigurationController < ApplicationController
active_rule = ActiveRule.find(params[:active_rule_id])
active_rule.note.destroy if active_rule.note
active_rule.note = nil
- render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true }
+ render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => true, :profile => active_rule.rules_profile }
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb
index 0f0f3d35c73..93957d00f07 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb
@@ -34,6 +34,12 @@ class RulesParameter < ActiveRecord::Base
end
def description
+ description(rule)
+ end
+
+ # We provide the rule as parameter to avoid reloading this rule_parameter's rule.
+ # This hack would be useless if we could use :inverse_of on :rule
+ def description(rule)
@l10n_description ||=
begin
result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleParamDescription(I18n.locale, rule.repository_key, rule.plugin_rule_key, name())
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
index 19f671eb968..f961277b52b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
@@ -1,4 +1,4 @@
-<% #locals = active_rule, is_admin
+<% #locals = active_rule, is_admin, profile
note = active_rule.note
active_note_detail_div_id = "and_" + active_rule.id.to_s
add_active_note_button_id = "aanb_" + active_rule.id.to_s
@@ -28,7 +28,7 @@
</cite>
<p><%= note.html_text -%></p>
</blockquote>
- <% elsif is_admin && !active_rule.rules_profile.provided? %>
+ <% elsif is_admin && !profile.provided? %>
<a href="#" onclick="$('<%= active_note_form_div_id -%>').show();$('<%= active_note_detail_div_id -%>').hide();$('<%= active_note_textarea_id -%>').focus(); return false;"
class="link-action spacer-right" id="<%= add_active_note_button_id -%>"><%= message('rules_configuration.add_note') -%></a>
<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
index 99b342d9d0d..c89b7975006 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
@@ -85,7 +85,7 @@
<% if active_rule %>
<div id="active_rule_note_<%= active_rule.id -%>">
- <%= render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => is_admin} %>
+ <%= render :partial => 'active_rule_note', :locals => {:active_rule => active_rule, :is_admin => is_admin, :profile => profile} %>
</div>
<% 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 5d2565854b8..e18c9baf4c2 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
@@ -40,7 +40,7 @@
<% end %>
<% end %>
- <div class="form-val-note"><%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
+ <div class="form-val-note"><%= h(parameter.description(rule) || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
</form>
</td>