1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-10 01:16:39 +02:00

fix: access overview fallback to email (#9582)

https://linear.app/unleash/issue/2-3430/fix-undefined-in-access-overview-when-user-name-is-unavailable

Adds a fallback to email in case the name is not available.

Also switches the priority of the fallbacks to be consistent with other
places in our codebase (email > username) and uses `||` instead of `??`
because falsy values don't provide much informational value anyways.


![image](https://github.com/user-attachments/assets/2726247c-b7ba-4ed8-8589-f56fff63d031)
This commit is contained in:
Nuno Góis 2025-03-20 11:02:19 +00:00 committed by GitHub
parent afd24aa58a
commit a10dca44f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ export const AccessOverview = () => {
isLoading={loading}
header={
<PageHeader
title={`Access overview for ${user.name ?? user.username}`}
title={`Access overview for ${user.name || user.email || user.username}`}
actions={
<ConditionallyRender
condition={!isSmallScreen}

View File

@ -131,7 +131,7 @@ export const ProfileTab = ({ user }: IProfileTabProps) => {
<StyledAvatar user={user} />
<StyledInfo>
<StyledInfoName>
{user.name || user.username}
{user.name || user.email || user.username}
</StyledInfoName>
<Typography variant='body1'>{user.email}</Typography>
</StyledInfo>