mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
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)
This commit is contained in:
parent
4b6813aa5e
commit
993d87516d
@ -74,10 +74,7 @@ const GroupCardAvatarsInner = ({
|
||||
return (
|
||||
<StyledAvatars>
|
||||
{shownUsers.map((user) => (
|
||||
<AvatarComponent
|
||||
key={objectId(user)}
|
||||
user={{ ...user, id: objectId(user) }}
|
||||
/>
|
||||
<AvatarComponent key={objectId(user)} user={user} />
|
||||
))}
|
||||
<ConditionallyRender
|
||||
condition={users.length > avatarLimit}
|
||||
|
@ -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<IProjectOwnersProps> = ({ owners = [] }) => {
|
||||
</StyledContainer>
|
||||
<ConditionallyRender
|
||||
condition={owners.length === 1}
|
||||
show={
|
||||
<StyledUserName>
|
||||
{users[0]?.name || users[0]?.description}
|
||||
</StyledUserName>
|
||||
}
|
||||
show={<StyledUserName>{users[0]?.name}</StyledUserName>}
|
||||
elseShow={<div />}
|
||||
/>
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user