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 <thomas.siegfried.krampl@nav.no>
(cherry picked from commit bb59192e3e)
This commit is contained in:
Trong Huu Nguyen
2025-04-14 16:57:51 +02:00
committed by Livio Spring
parent ff0c55c4b2
commit 051c36588b
2 changed files with 3 additions and 6 deletions

View File

@@ -66,14 +66,11 @@ export class InfoRowComponent {
} }
public get changeDate() { public get changeDate() {
return this?.user?.details?.changeDate; return this.user?.details?.changeDate;
} }
public get creationDate() { public get creationDate() {
if (!this.user) { return this.user?.details?.creationDate;
return undefined;
}
return '$typeName' in this.user ? undefined : this.user.details?.creationDate;
} }
private getEmail(user: User.AsObject | UserV2 | UserV1) { private getEmail(user: User.AsObject | UserV2 | UserV1) {

View File

@@ -119,7 +119,7 @@ export class UserTableComponent implements OnInit {
this.dataSize = toSignal( this.dataSize = toSignal(
this.users$.pipe( this.users$.pipe(
map((users) => users.result.length), map((users) => Number(users.details?.totalResult ?? users.result.length)),
distinctUntilChanged(), distinctUntilChanged(),
), ),
{ initialValue: 0 }, { initialValue: 0 },