]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5356 Fix display of rule params in edition after creation
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 18 Jun 2014 15:33:07 +0000 (17:33 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 18 Jun 2014 15:34:56 +0000 (17:34 +0200)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-custom-rule-creation-view.coffee

index 26321af580413c28165f3cd49404774bfae3c58d..6274e9fb44c39ac9e57cbcefb088ecd2e32872d4 100644 (file)
@@ -103,6 +103,7 @@ define [
         data: postData
         error: () ->
       .done (r) =>
+          delete @templateRule
           @options.app.showRule r.rule.key
           @hide()
       .fail (jqXHR, textStatus, errorThrown) =>
@@ -160,9 +161,10 @@ define [
       params = {}
       if @templateRule
         params = @templateRule.get 'params'
-      else if @model
+      else if @model and @model.has 'params'
         params = @model.get('params').map (p) ->
-          _.extend p, value: p.defaultValue
+          _.extend p,
+            value: p.defaultValue
 
       _.extend super,
         change: @model && @model.has 'key'