From a8ba09c563e8812760c6cb61e1aa603a32856429 Mon Sep 17 00:00:00 2001 From: Dilshan Senarath Date: Wed, 24 Apr 2024 17:56:44 +0530 Subject: [PATCH 1/3] add 'Managed by' property as 'Parent Organization' for invited users --- .../admin.users.v1/components/users-list.tsx | 17 +++++++++++------ .../constants/user-management-constants.ts | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/features/admin.users.v1/components/users-list.tsx b/features/admin.users.v1/components/users-list.tsx index b69d2bd7393..33162036b7b 100644 --- a/features/admin.users.v1/components/users-list.tsx +++ b/features/admin.users.v1/components/users-list.tsx @@ -253,6 +253,10 @@ export const UsersList: React.FunctionComponent = (props: UsersL }; const renderUserIdp = (user: UserBasicInterface): string => { + if (user[SCIMConfigs?.scim?.enterpriseSchema]?.managedOrg) { + return UserManagementConstants.MANAGED_BY_PARENT_TEXT; + } + const userStore: string = user?.userName?.split("/").length > 1 ? user?.userName?.split("/")[0]?.toUpperCase() : userstoresConfig.primaryUserstoreName; @@ -313,12 +317,13 @@ export const UsersList: React.FunctionComponent = (props: UsersL
{ header as ReactNode } { - user[SCIMConfigs.scim.enterpriseSchema]?.managedOrg && ( - - ) + userConfig.disableManagedByColumn + && user[SCIMConfigs.scim.enterpriseSchema]?.managedOrg + && ( + + ) }
{ diff --git a/features/admin.users.v1/constants/user-management-constants.ts b/features/admin.users.v1/constants/user-management-constants.ts index 38f59629da8..93c3c831d4d 100644 --- a/features/admin.users.v1/constants/user-management-constants.ts +++ b/features/admin.users.v1/constants/user-management-constants.ts @@ -149,6 +149,8 @@ export class UserManagementConstants { public static readonly ERROR_COLLABORATOR_USER_LIMIT_REACHED: string = "ASG-UIM-10010"; // Query param to exclude groups from getUserList API call. public static readonly GROUPS_ATTRIBUTE: string = "groups"; + + public static readonly MANAGED_BY_PARENT_TEXT: string = "Parent Organization"; } /** From 905c7480c4e6c5c38797b6a45900858547e67c65 Mon Sep 17 00:00:00 2001 From: Dilshan Senarath Date: Wed, 24 Apr 2024 18:04:05 +0530 Subject: [PATCH 2/3] add optional chaining --- features/admin.users.v1/components/users-list.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/admin.users.v1/components/users-list.tsx b/features/admin.users.v1/components/users-list.tsx index 33162036b7b..bcb60c55b3e 100644 --- a/features/admin.users.v1/components/users-list.tsx +++ b/features/admin.users.v1/components/users-list.tsx @@ -317,8 +317,8 @@ export const UsersList: React.FunctionComponent = (props: UsersL
{ header as ReactNode } { - userConfig.disableManagedByColumn - && user[SCIMConfigs.scim.enterpriseSchema]?.managedOrg + userConfig?.disableManagedByColumn + && user[SCIMConfigs?.scim?.enterpriseSchema]?.managedOrg && (