From 91efe37ec24a1993b67b8d78f46ce5f616a67847 Mon Sep 17 00:00:00 2001 From: agagancarczyk <4890675+agagancarczyk@users.noreply.github.com> Date: Tue, 25 Jun 2024 09:33:33 +0100 Subject: [PATCH] fixed username display in the users dropdown on create/edit user policy (#30701) Signed-off-by: Agnieszka Gancarczyk Co-authored-by: Agnieszka Gancarczyk --- js/apps/admin-ui/src/clients/authorization/policy/User.tsx | 1 + js/apps/admin-ui/src/components/users/UserSelect.tsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/apps/admin-ui/src/clients/authorization/policy/User.tsx b/js/apps/admin-ui/src/clients/authorization/policy/User.tsx index 1a64d523a0..db654e064a 100644 --- a/js/apps/admin-ui/src/clients/authorization/policy/User.tsx +++ b/js/apps/admin-ui/src/clients/authorization/policy/User.tsx @@ -9,6 +9,7 @@ export const User = () => { label="users" helpText={t("policyUsers")} defaultValue={[]} + variant="typeaheadMulti" isRequired /> ); diff --git a/js/apps/admin-ui/src/components/users/UserSelect.tsx b/js/apps/admin-ui/src/components/users/UserSelect.tsx index db1cde1868..492e8d8fe3 100644 --- a/js/apps/admin-ui/src/components/users/UserSelect.tsx +++ b/js/apps/admin-ui/src/components/users/UserSelect.tsx @@ -62,6 +62,7 @@ export const UserSelect = ({ const params: UserQuery = { max: 20, }; + if (search) { params.username = search; } @@ -154,7 +155,10 @@ export const UserSelect = ({ ); }} > - {selection} + { + users.find((u) => u?.id === selection) + ?.username + } ), )}