From 170910a9c2619e67b7393235959bbb3d002deb4d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 24 Aug 2016 12:08:38 +0200 Subject: [PATCH] SONAR-7968 Remove indicativeSize field in /api/settings/list_definitions WS --- .../org/sonar/server/settings/ws/ListDefinitionsAction.java | 1 - .../sonar/server/settings/ws/list_definitions-example.json | 2 -- .../sonar/server/settings/ws/ListDefinitionsActionTest.java | 6 +----- sonar-ws/src/main/protobuf/ws-settings.proto | 3 +-- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/settings/ws/ListDefinitionsAction.java b/server/sonar-server/src/main/java/org/sonar/server/settings/ws/ListDefinitionsAction.java index 107046420ed..3baef74a380 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/settings/ws/ListDefinitionsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/settings/ws/ListDefinitionsAction.java @@ -142,7 +142,6 @@ public class ListDefinitionsAction implements SettingsWsAction { .setName(fieldDefinition.name()) .setDescription(fieldDefinition.description()) .setType(Settings.Type.valueOf(fieldDefinition.type().name())) - .setIndicativeSize(fieldDefinition.indicativeSize()) .addAllOptions(fieldDefinition.options()) .build(); } diff --git a/server/sonar-server/src/main/resources/org/sonar/server/settings/ws/list_definitions-example.json b/server/sonar-server/src/main/resources/org/sonar/server/settings/ws/list_definitions-example.json index 041b22da2e8..e69a3aeffaa 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/settings/ws/list_definitions-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/settings/ws/list_definitions-example.json @@ -52,7 +52,6 @@ "name": "Text", "description": "Text field description", "type": "TEXT", - "indicativeSize": 10, "options": [] }, { @@ -60,7 +59,6 @@ "name": "List", "description": "List field description", "type": "SINGLE_SELECT_LIST", - "indicativeSize": 20, "options": [ "value1", "value2" diff --git a/server/sonar-server/src/test/java/org/sonar/server/settings/ws/ListDefinitionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/settings/ws/ListDefinitionsActionTest.java index b26687cbb2a..47ebd860da5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/settings/ws/ListDefinitionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/settings/ws/ListDefinitionsActionTest.java @@ -172,7 +172,7 @@ public class ListDefinitionsActionTest { .builder("foo") .type(PropertyType.PROPERTY_SET) .fields( - PropertyFieldDefinition.build("boolean").name("Boolean").description("boolean desc").type(PropertyType.BOOLEAN).indicativeSize(15).build(), + PropertyFieldDefinition.build("boolean").name("Boolean").description("boolean desc").type(PropertyType.BOOLEAN).build(), PropertyFieldDefinition.build("list").name("List").description("list desc").type(PropertyType.SINGLE_SELECT_LIST).options("one", "two").build()) .build()); @@ -188,15 +188,12 @@ public class ListDefinitionsActionTest { assertThat(definition.getFields(0).getDescription()).isEqualTo("boolean desc"); assertThat(definition.getFields(0).getType()).isEqualTo(BOOLEAN); assertThat(definition.getFields(0).getOptionsCount()).isZero(); - assertThat(definition.getFields(0).getIndicativeSize()).isEqualTo(15); assertThat(definition.getFields(1).getKey()).isEqualTo("list"); assertThat(definition.getFields(1).getName()).isEqualTo("List"); assertThat(definition.getFields(1).getDescription()).isEqualTo("list desc"); assertThat(definition.getFields(1).getType()).isEqualTo(SINGLE_SELECT_LIST); assertThat(definition.getFields(1).getOptionsList()).containsExactly("one", "two"); - // 20 is the default value - assertThat(definition.getFields(1).getIndicativeSize()).isEqualTo(20); } @Test @@ -363,7 +360,6 @@ public class ListDefinitionsActionTest { .name("Text") .description("Text field description") .type(PropertyType.TEXT) - .indicativeSize(10) .build(), PropertyFieldDefinition.build("list") .name("List") diff --git a/sonar-ws/src/main/protobuf/ws-settings.proto b/sonar-ws/src/main/protobuf/ws-settings.proto index 76da8a6910c..c4f09b10fe1 100644 --- a/sonar-ws/src/main/protobuf/ws-settings.proto +++ b/sonar-ws/src/main/protobuf/ws-settings.proto @@ -47,8 +47,7 @@ message Field { optional string name = 2; optional string description = 3; optional Type type = 4; - optional int32 indicativeSize = 5; - repeated string options = 6; + repeated string options = 5; } enum Type { -- 2.39.5