Skip to content

Commit

Permalink
Make email and full name grow over username and roles
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Dec 30, 2024
1 parent 39d8d7d commit 0dd7d42
Showing 1 changed file with 43 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import type { EuiFlexItemProps } from '@elastic/eui';
import {
EuiBadge,
EuiBadgeGroup,
Expand Down Expand Up @@ -764,6 +765,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
/>
),
testSubj: 'username',
grow: 1 as EuiFlexItemProps['grow'],
},
];

Expand All @@ -783,6 +785,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
/>
),
testSubj: 'full_name',
grow: 2,
});

rightSideItems.push({
Expand All @@ -800,6 +803,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
/>
),
testSubj: 'email',
grow: 3,
});
}

Expand All @@ -822,6 +826,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
/>
),
testSubj: 'userRoles',
grow: 2,
});

return (
Expand Down Expand Up @@ -854,44 +859,45 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data })
</EuiTitle>
</EuiPageHeaderSection>
<EuiPageHeaderSection>
<EuiFlexGroup alignItems="flexStart" css={rightSideItemsCSS}>
<EuiFlexGroup alignItems="center" css={rightSideItemsCSS}>
{rightSideItems.map((item) => (
<EuiDescriptionList
key={item.testSubj}
textStyle="reverse"
css={rightSideItemCSS}
listItems={[
{
title: (
<EuiText color={euiTheme.colors.darkestShade} size="s">
<EuiFlexGroup
responsive={false}
alignItems="center"
gutterSize="none"
>
<EuiFlexItem grow={false}>{item.title}</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip type="questionInCircle" content={item.helpText} />
</EuiFlexItem>
</EuiFlexGroup>
</EuiText>
),
description: (
<span data-test-subj={item.testSubj}>
{item.description || (
<EuiText color={euiTheme.colors.textDisabled} size="s">
<FormattedMessage
id="xpack.security.accountManagement.userProfile.noneProvided"
defaultMessage="None provided"
/>
</EuiText>
)}
</span>
),
},
]}
compressed
/>
<EuiFlexItem key={item.testSubj} grow={item.grow}>
<EuiDescriptionList
textStyle="reverse"
css={rightSideItemCSS}
listItems={[
{
title: (
<EuiText color={euiTheme.colors.darkestShade} size="s">
<EuiFlexGroup
responsive={false}
alignItems="center"
gutterSize="none"
>
<EuiFlexItem grow={false}>{item.title}</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip type="questionInCircle" content={item.helpText} />
</EuiFlexItem>
</EuiFlexGroup>
</EuiText>
),
description: (
<span data-test-subj={item.testSubj}>
{item.description || (
<EuiText color={euiTheme.colors.textDisabled} size="s">
<FormattedMessage
id="xpack.security.accountManagement.userProfile.noneProvided"
defaultMessage="None provided"
/>
</EuiText>
)}
</span>
),
},
]}
compressed
/>
</EuiFlexItem>
))}
</EuiFlexGroup>
</EuiPageHeaderSection>
Expand Down

0 comments on commit 0dd7d42

Please sign in to comment.