summaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-20 14:58:52 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-20 14:58:52 +0100
commit3afa92275641a77f49aa37a8c638003aec3f8396 (patch)
tree1d4416153f4378c5edea06aa6dd9771ca4511c2d /sonar-server/src/main/webapp/WEB-INF/app
parentf3a779a298a7a344ae56889eda8b6673994a61f0 (diff)
downloadsonarqube-3afa92275641a77f49aa37a8c638003aec3f8396.tar.gz
sonarqube-3afa92275641a77f49aa37a8c638003aec3f8396.zip
Fix issue when displaying rule parameter on not active rules
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule_param.html.erb5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb4
2 files changed, 7 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule_param.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule_param.html.erb
index 0fa93e21b12..d7f639afd95 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule_param.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/new_rules_configuration/_rule_param.html.erb
@@ -1,6 +1,9 @@
<% # locals = rule, profile, parameter
+ # Display default value only for inactive rules
param_id = "#{rule.id}#{parameter.key}"
- param_value = parameter.value || ''
+ # Display default value only for inactive rules
+ param_value = parameter.default_value if !rule.activeRuleId
+ param_value = parameter.value if !param_value
active_rule_id = rule.activeRuleId
read_only = rule.activeRuleId.nil? || !profiles_administrator?
%>
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 a44e972bf74..bd034cc8a24 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
@@ -1,5 +1,7 @@
<%
- param_value = active_parameter.value if active_parameter
+ # Display default value only for inactive rules
+ param_value = parameter.default_value if !active_rule
+ param_value = active_parameter.value if !param_value && active_parameter
active_param_id = active_parameter.id if active_parameter
active_rule_id = active_rule.id if active_rule
read_only = !active_rule || !profiles_administrator?