From 9646b5948e635505fdd66c48efffbc6b444c0c1c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Fri, 25 Jul 2014 11:32:42 +0200 Subject: [PATCH] SONAR-5137 Add rule param type to WS response, use it in rule activation dialog --- .../coding-rules-quality-profile-activation.hbs | 8 ++++++++ .../main/java/org/sonar/server/rule/ws/RuleMapping.java | 1 + .../ws/CreateActionMediumTest/create_custom_rule.json | 3 ++- .../search_active_rules_params.json | 6 ++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/hbs/coding-rules/coding-rules-quality-profile-activation.hbs b/sonar-server/src/main/hbs/coding-rules/coding-rules-quality-profile-activation.hbs index d604642ce4e..560972b992b 100644 --- a/sonar-server/src/main/hbs/coding-rules/coding-rules-quality-profile-activation.hbs +++ b/sonar-server/src/main/hbs/coding-rules/coding-rules-quality-profile-activation.hbs @@ -43,7 +43,15 @@ {{#eq type 'TEXT'}} {{else}} + {{#eq type 'BOOLEAN'}} + + {{else}} + {{/eq}} {{/eq}}
{{description}}
{{#if extra}} diff --git a/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java b/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java index 5f68223b136..30c0430e7ec 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java @@ -159,6 +159,7 @@ public class RuleMapping extends BaseMapping { .beginObject() .prop("key", param.key()) .prop("desc", param.description()) + .prop("type", param.type().type()) .prop("defaultValue", param.defaultValue()) .endObject(); } diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/CreateActionMediumTest/create_custom_rule.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/CreateActionMediumTest/create_custom_rule.json index 648e6c9b2fe..8ee000b5f6b 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/CreateActionMediumTest/create_custom_rule.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/CreateActionMediumTest/create_custom_rule.json @@ -19,7 +19,8 @@ { "key": "regex", "desc": "Reg ex", - "defaultValue": "a.*" + "defaultValue": "a.*", + "type": "STRING" } ] } diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceMediumTest/search_active_rules_params.json b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceMediumTest/search_active_rules_params.json index c2938aeb995..03d35338f6c 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceMediumTest/search_active_rules_params.json +++ b/sonar-server/src/test/resources/org/sonar/server/rule/ws/RulesWebServiceMediumTest/search_active_rules_params.json @@ -5,12 +5,14 @@ { "key": "my_var", "desc": "My small description", - "defaultValue": "some value" + "defaultValue": "some value", + "type": "string" }, { "key": "the_var", "desc": "My small description", - "defaultValue": "other value" + "defaultValue": "other value", + "type": "integer" } ] } -- 2.39.5