Skip to content

Commit

Permalink
[ksc-release-4.1] chore: validate email when editing basic informatio…
Browse files Browse the repository at this point in the history
…n (#5576)

Signed-off-by: donniean <[email protected]>
Co-authored-by: donniean <[email protected]>
  • Loading branch information
ks-ci-bot and donniean committed Dec 6, 2024
1 parent 1254513 commit ffbad8b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion locales/en/l10n-logIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

module.exports = {
// Log in page
INPUT_USERNAME_OR_EMAIL_TIP: 'Please enter your username or email.',
INPUT_USERNAME_OR_EMAIL_TIP: 'Please enter your username or email',
INPUT_EMAIL_TIP: 'Please enter your email',
LOG_IN: 'Log In',
LOG_IN_WITH_TITLE: 'Log in with {title}',
LOG_OUT: 'Log Out',
Expand Down
1 change: 1 addition & 0 deletions locales/es/l10n-logIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module.exports = {
// Log in page
INPUT_USERNAME_OR_EMAIL_TIP: 'Please input username or email',
INPUT_EMAIL_TIP: 'Please enter your email',
LOG_IN: 'Log In',
LOG_IN_WITH_TITLE: 'Log in with {title}',
LOG_OUT: 'Log Out',
Expand Down
1 change: 1 addition & 0 deletions locales/tc/l10n-logIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module.exports = {
// Log in page
INPUT_USERNAME_OR_EMAIL_TIP: '請輸入用戶名或信箱',
INPUT_EMAIL_TIP: '請輸入信箱',
LOG_IN: 'Log In',
LOG_IN_WITH_TITLE: '通過 {title} 登入',
LOG_OUT: 'Log Out',
Expand Down
3 changes: 2 additions & 1 deletion locales/zh/l10n-logIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

module.exports = {
// Log in page
INPUT_USERNAME_OR_EMAIL_TIP: '请输入用户名或邮箱。',
INPUT_USERNAME_OR_EMAIL_TIP: '请输入用户名或邮箱',
INPUT_EMAIL_TIP: '请输入邮箱',
LOG_IN: '登录',
LOG_IN_WITH_TITLE: '通过 {title} 登录',
LOG_OUT: '登出',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function UserCreateModal({ visible, onSuccess, onCancel }: UserCr
},
'spec.email': {
rules: [
{ required: true, message: t('INPUT_USERNAME_OR_EMAIL_TIP') },
{ required: true, message: t('INPUT_EMAIL_TIP') },
{ type: 'email', message: t('INVALID_EMAIL') },
{ validator: validator.emailValidator },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ export default function UserEditModal({
},
'spec.email': {
rules: [
{
required: true,
message: t('INPUT_USERNAME_OR_EMAIL_TIP'),
},
{ required: true, message: t('INPUT_EMAIL_TIP') },
{ type: 'email', message: t('INVALID_EMAIL') },
],
},
'spec.password': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ const BasicInfo = ({ visible, formData, form }: BasicInfoProps) => {
key={formData?.metadata?.name}
>
<FormItem label={t('USERNAME')} name={['metadata', 'name']}>
<Input placeholder="[email protected]" disabled />
<Input disabled />
</FormItem>
<FormItem label={t('EMAIL')} name={['spec', 'email']} help={t('USER_SETTING_EMAIL_DESC')}>
<FormItem
label={t('EMAIL')}
name={['spec', 'email']}
help={t('USER_SETTING_EMAIL_DESC')}
rules={[
{ required: true, message: t('INPUT_EMAIL_TIP') },
{ type: 'email', message: t('INVALID_EMAIL') },
]}
>
<Input placeholder="[email protected]" />
</FormItem>
{globals.config.supportLangs && (
Expand Down

0 comments on commit ffbad8b

Please sign in to comment.