From 993d87516d7dc1f7353d54c6df02e32fa600e09c Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 2 Aug 2024 13:29:31 +0200 Subject: [PATCH] fix: show "System" for system users, instead of "User ID n" where n is the project's number in the order. (#7734) Fixes a bug introduced with the new tooltips where the system user was shown as "User ID n" instead of "System". The "n" in this case is actually the user's index number in the list of project owners (including duplicates). There's a few things happening: 1. Change the object for system owners: use `name` instead of `description`. At the same time, remove the `description` property completely because it's not used at the moment. 2. Remove the assignnment of `id: objectId(user)` to the user sent to the User Avatar component. This was a leftover from when we split out the AvatarGroup component, and is not something we use anymore. Before: ![image](https://github.com/user-attachments/assets/bd348daf-c81e-4ea9-b8a9-f10af71a0da7) After: ![image](https://github.com/user-attachments/assets/d147f7c7-d683-43ac-9ee2-6116f155dad6) --- .../src/component/common/AvatarGroup/AvatarGroup.tsx | 5 +---- .../NewProjectCard/ProjectOwners/ProjectOwners.tsx | 11 ++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/frontend/src/component/common/AvatarGroup/AvatarGroup.tsx b/frontend/src/component/common/AvatarGroup/AvatarGroup.tsx index ad6d0d5b28..68c28564d1 100644 --- a/frontend/src/component/common/AvatarGroup/AvatarGroup.tsx +++ b/frontend/src/component/common/AvatarGroup/AvatarGroup.tsx @@ -74,10 +74,7 @@ const GroupCardAvatarsInner = ({ return ( {shownUsers.map((user) => ( - + ))} avatarLimit} diff --git a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx index 0633557a02..b96b01c87a 100644 --- a/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx +++ b/frontend/src/component/project/NewProjectCard/ProjectOwners/ProjectOwners.tsx @@ -18,7 +18,6 @@ const useOwnersMap = () => { name: string; imageUrl?: string; email?: string; - description?: string; } => { if (owner.ownerType === 'user') { return { @@ -30,12 +29,10 @@ const useOwnersMap = () => { if (owner.ownerType === 'group') { return { name: owner.name, - description: 'group', }; } return { - name: '', - description: 'System', + name: 'System', imageUrl: `${uiConfig.unleashUrl}/logo-unleash.png`, }; }; @@ -76,11 +73,7 @@ export const ProjectOwners: FC = ({ owners = [] }) => { - {users[0]?.name || users[0]?.description} - - } + show={{users[0]?.name}} elseShow={
} />