]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7210 WS user_tokens/search tokenCount replaced by tokensCount in response
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 20 Jan 2016 11:06:06 +0000 (12:06 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 20 Jan 2016 11:06:06 +0000 (12:06 +0100)
server/sonar-server/src/main/java/org/sonar/server/user/ws/UserJsonWriter.java
server/sonar-server/src/main/resources/org/sonar/server/user/ws/search-example.json
server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/five_users.json
server/sonar-server/src/test/resources/org/sonar/server/user/ws/SearchActionTest/user_one.json
server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs

index e19fbdba8aad8bcdd51724192d175cef52a2a7fe..b4711a075fdb913299dd4f69a51ac3fdd94c9829 100644 (file)
@@ -40,7 +40,7 @@ public class UserJsonWriter {
   private static final String FIELD_SCM_ACCOUNTS = "scmAccounts";
   private static final String FIELD_GROUPS = "groups";
   private static final String FIELD_ACTIVE = "active";
-  private static final String FIELD_TOKEN_COUNT = "tokenCount";
+  private static final String FIELD_TOKENS_COUNT = "tokensCount";
 
   public static final Set<String> FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_SCM_ACCOUNTS, FIELD_GROUPS, FIELD_ACTIVE);
   private static final Set<String> CONCISE_FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_ACTIVE);
@@ -61,7 +61,7 @@ public class UserJsonWriter {
   /**
    * Serializes a user to the passed JsonWriter.
    */
-  public void write(JsonWriter json, User user, @Nullable Integer tokenCount, Collection<String> groups, @Nullable Collection<String> fields) {
+  public void write(JsonWriter json, User user, @Nullable Integer tokensCount, Collection<String> groups, @Nullable Collection<String> fields) {
     json.beginObject();
     json.prop(FIELD_LOGIN, user.login());
     writeIfNeeded(json, user.name(), FIELD_NAME, fields);
@@ -69,7 +69,7 @@ public class UserJsonWriter {
     writeIfNeeded(json, user.active(), FIELD_ACTIVE, fields);
     writeGroupsIfNeeded(json, groups, fields);
     writeScmAccountsIfNeeded(json, fields, user);
-    writeTokenCount(json, tokenCount);
+    writeTokensCount(json, tokensCount);
     json.endObject();
   }
 
@@ -103,11 +103,11 @@ public class UserJsonWriter {
     }
   }
 
-  private static void writeTokenCount(JsonWriter json, @Nullable Integer tokenCount) {
+  private static void writeTokensCount(JsonWriter json, @Nullable Integer tokenCount) {
     if (tokenCount == null) {
       return;
     }
 
-    json.prop(FIELD_TOKEN_COUNT, tokenCount);
+    json.prop(FIELD_TOKENS_COUNT, tokenCount);
   }
 }
index 43f791d247f7f19afb36c5a0925bfb83514890ed..9f6ad704d55850de38805e11f603f97afa9f7c44 100644 (file)
@@ -10,7 +10,7 @@
         "sonar-users",
         "sonar-administrators"
       ],
-      "tokenCount": 1
+      "tokensCount": 1
     },
     {
       "login": "sbrandhof",
@@ -24,7 +24,7 @@
       "groups": [
         "sonar-users"
       ],
-      "tokenCount": 3
+      "tokensCount": 3
     }
   ]
 }
index 576b41ad6cea83abf8c24093eca7c1433fbf4d4d..53f48b5066c88526ad01c3b404fe8970a875fa51 100644 (file)
@@ -10,7 +10,7 @@
       "scmAccounts": [
         "user-0"
       ],
-      "tokenCount": 0
+      "tokensCount": 0
     },
     {
       "login": "user-1",
@@ -19,7 +19,7 @@
       "scmAccounts": [
         "user-1"
       ],
-      "tokenCount": 1
+      "tokensCount": 1
     },
     {
       "login": "user-2",
@@ -28,7 +28,7 @@
       "scmAccounts": [
         "user-2"
       ],
-      "tokenCount": 2
+      "tokensCount": 2
     },
     {
       "login": "user-3",
@@ -37,7 +37,7 @@
       "scmAccounts": [
         "user-3"
       ],
-      "tokenCount": 3
+      "tokensCount": 3
     },
     {
       "login": "user-4",
@@ -46,7 +46,7 @@
       "scmAccounts": [
         "user-4"
       ],
-      "tokenCount": 4
+      "tokensCount": 4
     }
   ]
 }
index 2f3d06e9ac6c9633fd3843d25ec91370a524efb9..87f7c37c97b83a95b75cf141c1836a72a39d36f2 100644 (file)
@@ -10,7 +10,7 @@
       "scmAccounts": [
         "user-1"
       ],
-      "tokenCount": 1
+      "tokensCount": 1
     }
   ]
 }
index 771d5c987bc23b250cb28ada900116af1ecf584f..fb5987fbbd848a70f46a3d095fea5873d7e35fba 100644 (file)
@@ -40,7 +40,7 @@
 </td>
 
 <td>
-  {{tokenCount}}
+  {{tokensCount}}
   <a class="js-user-tokens spacer-left icon-bullet-list" title="Update Tokens" data-toggle="tooltip" href="#"></a>
 </td>