fixed username display in the users dropdown on create/edit user policy (#30701)

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>
Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2024-06-25 09:33:33 +01:00 committed by GitHub
parent 40b9af4b96
commit 91efe37ec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ export const User = () => {
label="users" label="users"
helpText={t("policyUsers")} helpText={t("policyUsers")}
defaultValue={[]} defaultValue={[]}
variant="typeaheadMulti"
isRequired isRequired
/> />
); );

View file

@ -62,6 +62,7 @@ export const UserSelect = ({
const params: UserQuery = { const params: UserQuery = {
max: 20, max: 20,
}; };
if (search) { if (search) {
params.username = search; params.username = search;
} }
@ -154,7 +155,10 @@ export const UserSelect = ({
); );
}} }}
> >
{selection} {
users.find((u) => u?.id === selection)
?.username
}
</Chip> </Chip>
), ),
)} )}