From c4cf4cdec49232e45aec35e3bd58fcbd3f5c4ec6 Mon Sep 17 00:00:00 2001 From: Fred KISSIE Date: Wed, 29 Apr 2026 06:57:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20show=20idp=20name=20in?= =?UTF-8?q?=20user=20selector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/users-selector.tsx | 6 +++++- src/lib/getUserDisplayName.ts | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/users-selector.tsx b/src/components/users-selector.tsx index 844079e70..aed063fd7 100644 --- a/src/components/users-selector.tsx +++ b/src/components/users-selector.tsx @@ -8,7 +8,11 @@ import { useDebounce } from "use-debounce"; import { useTranslations } from "next-intl"; import { MultiSelectTagInput } from "./multi-select/multi-select-tag-input"; -export type SelectedUser = { id: string; text: string }; +export type SelectedUser = { + id: string; + text: string; + ipdName?: string | null; +}; export type UsersSelectorProps = { orgId: string; diff --git a/src/lib/getUserDisplayName.ts b/src/lib/getUserDisplayName.ts index e95096c16..508b198c3 100644 --- a/src/lib/getUserDisplayName.ts +++ b/src/lib/getUserDisplayName.ts @@ -8,6 +8,7 @@ type UserDisplayNameInput = email?: string | null; name?: string | null; username?: string | null; + idpName?: string | null; }; /** @@ -21,16 +22,25 @@ export function getUserDisplayName(input: UserDisplayNameInput): string { let email: string | null | undefined; let name: string | null | undefined; let username: string | null | undefined; + let idpName: string | null | undefined; if ("user" in input) { email = input.user.email; name = input.user.name; username = input.user.username; + idpName = input.user.idpName; } else { email = input.email; name = input.name; username = input.username; + idpName = input.idpName; } - return email || name || username || ""; + let nameShown = email || name || username || ""; + + if (idpName) { + nameShown = `${nameShown} (${idpName})`; + } + + return nameShown; }