Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion frontend/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"user_name": "User name",
"user_name_description": "Only latin characters, dashes, underscores, and digits",
"global_role_description": "Whether the user is an administrator or not",
"email_description": "Enter user email",
"token": "Token",
"token_description": "Specify use your personal access token",
"global_role": "Global role",
Expand All @@ -530,7 +531,8 @@
"refresh_token_confirm_message": "Are you sure you want to rotate token?",
"refresh_token_button_label": "Rotate",
"validation": {
"user_name_format": "Only letters, numbers, - or _"
"user_name_format": "Only letters, numbers, - or _",
"email_format": "Incorrect email"
}
},

Expand Down
10 changes: 4 additions & 6 deletions frontend/src/pages/User/Details/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ export const Settings: React.FC = () => {
{/* <div>{data.user_name}</div>*/}
{/*</div>*/}

{process.env.UI_VERSION !== 'enterprise' && (
<div>
<Box variant="awsui-key-label">{t('users.email')}</Box>
<div>{data.email ?? '-'}</div>
</div>
)}
<div>
<Box variant="awsui-key-label">{t('users.email')}</Box>
<div>{data.email ?? '-'}</div>
</div>

<PermissionGuard allowedGlobalRoles={[GlobalUserRole.ADMIN]}>
<div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/User/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const UserEdit: React.FC = () => {
const onSubmitHandler = async (userData: Partial<IUser>) => {
try {
const data = await updateUser({
...pick(userData, ['global_role']),
...pick(userData, ['global_role', 'email']),
username: paramUserName,
}).unwrap();

Expand Down
14 changes: 14 additions & 0 deletions frontend/src/pages/User/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ export const UserForm: React.FC<Props> = ({
/>
)}

<FormInput
label={t('users.email')}
description={t('users.email_description')}
control={control}
name="email"
disabled={loading}
rules={{
pattern: {
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
message: t('users.edit.validation.email_format'),
},
}}
/>

<FormSelect
label={t('users.global_role')}
description={t('users.global_role_description')}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/User/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const UserList: React.FC = () => {
<NavigateLink href={ROUTES.USER.DETAILS.FORMAT(item.username)}>{item.username}</NavigateLink>
),
},
process.env.UI_VERSION === 'sky' && {
{
id: 'email',
header: t('users.email'),
cell: (item: IUser) => item.email ?? '-',
Expand Down