]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3432 Add feedback on rule property validation
authorDavid Gageot <david@gageot.net>
Thu, 5 Jul 2012 15:13:08 +0000 (17:13 +0200)
committerDavid Gageot <david@gageot.net>
Thu, 5 Jul 2012 15:13:14 +0000 (17:13 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb

index 160e31a981ce5acd72a8e34f87b05ca2c68bb78c..e2a4843aecea447602ed0069f3b8dfb938376fca 100644 (file)
@@ -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
index 1078ed98dc40051b94e7273053210d1e28d5ae0d..b7410b1ecd8114590a4b4d5876ac88c1005e55cb 100644 (file)
   <%= parameter.name -%>
 </td>
 <td class="form-val-cell">
-  <%= 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 += "<br/>"
      end
   %>
+  <div id="error_<%= rule.id -%>" class="error" style="display: none"></div>
   <span id="<%= span_id -%>"><%= textfield -%></span>
 
   <% if !read_only %>