From e57d9fedf1fc28378eca71ea32b951f601fa2afc Mon Sep 17 00:00:00 2001 From: Siyasanga Date: Thu, 24 Oct 2024 00:47:17 +0200 Subject: [PATCH] Use getLocalisedName on the UserList component https://github.com/opencrvs/opencrvs-core/issues/6830 --- .../client/src/views/SysAdmin/Team/user/UserList.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx index 42e43a1dc7f..c61076155aa 100644 --- a/packages/client/src/views/SysAdmin/Team/user/UserList.tsx +++ b/packages/client/src/views/SysAdmin/Team/user/UserList.tsx @@ -34,7 +34,7 @@ import { NATL_ADMIN_ROLES, SYS_ADMIN_ROLES } from '@client/utils/constants' -import { createNamesMap } from '@client/utils/data-formatting' +import { createNamesMap, getLocalisedName } from '@client/utils/data-formatting' import { SysAdminContentWrapper } from '@client/views/SysAdmin/SysAdminContentWrapper' import { getAddressName, @@ -552,14 +552,7 @@ function UserListComponent(props: IProps) { return data.searchUsers.results.map( (user: User | null, index: number) => { if (user !== null) { - const name = - (user.name && - intl.formatMessage(constantsMessages.humanName, { - firstName: user.name[0].firstNames, - middleName: user.name[0].middleName, - lastName: user.name[0].familyName - })) || - '' + const name = getLocalisedName(intl, user.name[0]) const role = intl.formatMessage({ id: getUserRoleIntlKey(user.role._id) })