From 051c36588bc49db77ad3effb1696f3bca2252da6 Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Mon, 14 Apr 2025 16:57:51 +0200 Subject: [PATCH] fix(console): correct count for users list, show create timestamp in user details (#9705) This pull request fixes a couple of minor issues with the user list and details pages in Console. # Which Problems Are Solved 1. The total count in the users list was the total number of results returned. This made the pagination not work when there were more than `pageSize * 2` users. 2. The user details page did not show the created timestamp when viewing a user. # How the Problems Are Solved 1. The response includes the total number calculated by the backend. Use that instead. 2. Inverse the ternary returning the creation date. # Additional Changes None # Additional Context None --------- Co-authored-by: Thomas Krampl (cherry picked from commit bb59192e3e96b9b448f734b3725588f399f32741) --- console/src/app/modules/info-row/info-row.component.ts | 7 ++----- .../users/user-list/user-table/user-table.component.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/console/src/app/modules/info-row/info-row.component.ts b/console/src/app/modules/info-row/info-row.component.ts index 2689584813..85d6a1bdc6 100644 --- a/console/src/app/modules/info-row/info-row.component.ts +++ b/console/src/app/modules/info-row/info-row.component.ts @@ -66,14 +66,11 @@ export class InfoRowComponent { } public get changeDate() { - return this?.user?.details?.changeDate; + return this.user?.details?.changeDate; } public get creationDate() { - if (!this.user) { - return undefined; - } - return '$typeName' in this.user ? undefined : this.user.details?.creationDate; + return this.user?.details?.creationDate; } private getEmail(user: User.AsObject | UserV2 | UserV1) { diff --git a/console/src/app/pages/users/user-list/user-table/user-table.component.ts b/console/src/app/pages/users/user-list/user-table/user-table.component.ts index 29de192ec2..6ff0d2cd67 100644 --- a/console/src/app/pages/users/user-list/user-table/user-table.component.ts +++ b/console/src/app/pages/users/user-list/user-table/user-table.component.ts @@ -119,7 +119,7 @@ export class UserTableComponent implements OnInit { this.dataSize = toSignal( this.users$.pipe( - map((users) => users.result.length), + map((users) => Number(users.details?.totalResult ?? users.result.length)), distinctUntilChanged(), ), { initialValue: 0 },