Make username column show usernames instead of full names

The backend removes the usernames of the SeviceUserInfo
objects but the keys of the map that the backend return
are usernames, so they can be used instead.

Change-Id: I196965959e401bf7068db381a39788301f4efb26
diff --git a/web/gr-serviceuser-list.ts b/web/gr-serviceuser-list.ts
index ee9e7d0..939d54a 100644
--- a/web/gr-serviceuser-list.ts
+++ b/web/gr-serviceuser-list.ts
@@ -40,8 +40,8 @@
   @state()
   canCreate = false;
 
-  @property({type: Array})
-  serviceUsers = new Array<ServiceUserInfo>();
+  @property({type: Map})
+  serviceUsers = new Map<String, ServiceUserInfo>();
 
   static override get styles() {
     return [
@@ -94,8 +94,8 @@
           <td>Loading...</td>
         </tr>
         <tbody class="${this.computeLoadingClass()}">
-          ${this.serviceUsers.map(serviceUser =>
-            this.renderServiceUserList(serviceUser)
+          ${[...this.serviceUsers].map(([username, serviceUser]) =>
+            this.renderServiceUserList(username, serviceUser)
           )}
         </tbody>
       </table>
@@ -120,7 +120,7 @@
     return html``;
   }
 
-  private renderServiceUserList(serviceUser: ServiceUserInfo) {
+  private renderServiceUserList(username: String, serviceUser: ServiceUserInfo) {
     if (!serviceUser._account_id) {
       return;
     }
@@ -128,7 +128,7 @@
       <tr class="table">
         <td class="name">
           <a href="${this.computeServiceUserUrl(serviceUser._account_id)}"
-            >${serviceUser.name}</a
+            >${username}</a
           >
         </td>
         <td class="fullName">${serviceUser.name}</td>
@@ -171,9 +171,7 @@
     return this.pluginRestApi
       .get<Object>('/a/config/server/serviceuser~serviceusers/')
       .then(serviceUsers => {
-        new Map<String, ServiceUserInfo>(Object.entries(serviceUsers)).forEach(
-          v => this.serviceUsers.push(v)
-        );
+        this.serviceUsers = new Map<String, ServiceUserInfo>(Object.entries(serviceUsers));
       });
   }