web: reuse user display-name helper

This commit is contained in:
Dominic R
2026-04-22 20:46:59 -04:00
parent a62fb7f267
commit 4a56d42cbe
4 changed files with 8 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import { DEFAULT_CONFIG } from "#common/api/config";
import { PaginatedResponse, Table, TableColumn } from "#elements/table/Table";
import { SlottedTemplateResult } from "#elements/types";
import { getUserDisplayName } from "#elements/user/utils";
import {
GoogleWorkspaceProviderUser,
@@ -75,7 +76,7 @@ export class GoogleWorkspaceProviderUserList extends Table<GoogleWorkspaceProvid
}
protected override rowLabel(item: GoogleWorkspaceProviderUser): string {
return item.userObj.name || item.userObj.username;
return getUserDisplayName(item.userObj);
}
protected columns: TableColumn[] = [

View File

@@ -6,6 +6,7 @@ import { DEFAULT_CONFIG } from "#common/api/config";
import { PaginatedResponse, Table, TableColumn } from "#elements/table/Table";
import { SlottedTemplateResult } from "#elements/types";
import { getUserDisplayName } from "#elements/user/utils";
import {
MicrosoftEntraProviderUser,
@@ -75,7 +76,7 @@ export class MicrosoftEntraProviderUserList extends Table<MicrosoftEntraProvider
}
protected override rowLabel(item: MicrosoftEntraProviderUser): string {
return item.userObj.name || item.userObj.username;
return getUserDisplayName(item.userObj);
}
protected columns: TableColumn[] = [

View File

@@ -7,6 +7,7 @@ import { DEFAULT_CONFIG } from "#common/api/config";
import { PaginatedResponse, Table, TableColumn } from "#elements/table/Table";
import { SlottedTemplateResult } from "#elements/types";
import { getUserDisplayName } from "#elements/user/utils";
import {
ProvidersApi,
@@ -73,7 +74,7 @@ export class SCIMProviderUserList extends Table<SCIMProviderUser> {
}
protected override rowLabel(item: SCIMProviderUser): string {
return item.userObj.name || item.userObj.username;
return getUserDisplayName(item.userObj);
}
protected columns: TableColumn[] = [

View File

@@ -2,6 +2,7 @@ import { DEFAULT_CONFIG } from "#common/api/config";
import { PaginatedResponse, Table, TableColumn } from "#elements/table/Table";
import { SlottedTemplateResult } from "#elements/types";
import { getUserDisplayName } from "#elements/user/utils";
import { SCIMSourceUser, SourcesApi } from "@goauthentik/api";
@@ -25,7 +26,7 @@ export class SCIMSourceUserList extends Table<SCIMSourceUser> {
}
protected override rowLabel(item: SCIMSourceUser): string {
return item.userObj.name || item.userObj.username;
return getUserDisplayName(item.userObj);
}
protected columns: TableColumn[] = [