]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 SONAR-5136 Handle parameters on activation/change
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Thu, 22 May 2014 12:50:36 +0000 (14:50 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Thu, 22 May 2014 15:27:25 +0000 (17:27 +0200)
sonar-server/src/main/coffee/coding-rules/views/coding-rules-quality-profile-activation-view.coffee
sonar-server/src/main/hbs/coding-rules/coding-rules-quality-profile-activation.hbs

index d51bb7518e89aff37d573e87a2be6cdb0df2a47f..49df39f88054b7aa0d728b3c0d790cbe30cd6ac4 100644 (file)
@@ -28,6 +28,8 @@ define [
       params = @ui.qualityProfileParameters.map(->
         key: jQuery(@).prop('name'), value: jQuery(@).val() || jQuery(@).prop('placeholder')).get()
 
+      paramsHash = _.reduce((params.map (param) -> param.key + '=' + param.value), ((hash, param) -> hash + ';' + param), '')
+
       if @model
         profileKey = @model.get('qProfile')
       severity = @ui.qualityProfileSeverity.val()
@@ -40,7 +42,7 @@ define [
             profile_key: profileKey
             rule_key: @rule.get('key')
             severity: severity
-            params: params
+            params: paramsHash
       .done =>
           if @model
             @model.set severity: severity, params: params
index 0f839b022b06f2ce1289ba40a48dd63cf5cf41cc..3cc1097a5438ceb06cd91bc47ceac5722a7f9a5c 100644 (file)
@@ -40,9 +40,9 @@
           <th><h3>{{key}}</h3></th>
           <td>
             {{#eq type 'TEXT'}}
-              <textarea class="width100" rows="3" name="{{key}}"placeholder="{{default}}">{{value}}</textarea>
+              <textarea class="width100" rows="3" name="{{key}}" placeholder="{{defaultValue}}">{{value}}</textarea>
             {{else}}
-              <input type="text" name="{{key}}" value="{{value}}" placeholder="{{default}}">
+              <input type="text" name="{{key}}" value="{{value}}" placeholder="{{defaultValue}}">
             {{/eq}}
             <div class="note">{{description}}</div>
             {{#if extra}}