This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 95634afb83 [INLONG-8779][Dashboard] Modify password verification 
optimization (#8780)
95634afb83 is described below

commit 95634afb835f65fdef9f704484bb53ba920cb517
Author: Lizhen <[email protected]>
AuthorDate: Tue Aug 22 17:59:42 2023 +0800

    [INLONG-8779][Dashboard] Modify password verification optimization (#8780)
---
 .../src/ui/components/Layout/NavWidget/PasswordModal.tsx    | 13 +++++++++++--
 inlong-dashboard/src/ui/locales/cn.json                     |  2 +-
 inlong-dashboard/src/ui/locales/en.json                     |  2 +-
 inlong-dashboard/src/ui/pages/Login/index.tsx               |  5 +----
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git 
a/inlong-dashboard/src/ui/components/Layout/NavWidget/PasswordModal.tsx 
b/inlong-dashboard/src/ui/components/Layout/NavWidget/PasswordModal.tsx
index 81504dd2e5..0e4e429ba1 100644
--- a/inlong-dashboard/src/ui/components/Layout/NavWidget/PasswordModal.tsx
+++ b/inlong-dashboard/src/ui/components/Layout/NavWidget/PasswordModal.tsx
@@ -50,7 +50,10 @@ const Comp: React.FC<Props> = ({ id, ...modalProps }) => {
       type: 'password',
       label: t('components.Layout.NavWidget.NewPassword'),
       name: 'newPassword',
-      rules: [{ required: true }],
+      rules: [
+        { required: true },
+        { pattern: /^[@0-9a-z_-]+$/, message: t('pages.Login.PasswordRules') },
+      ],
     },
     {
       type: 'password',
@@ -58,6 +61,7 @@ const Comp: React.FC<Props> = ({ id, ...modalProps }) => {
       name: 'confirmPassword',
       rules: [
         { required: true },
+        { pattern: /^[@0-9a-z_-]+$/, message: t('pages.Login.PasswordRules') },
         ({ getFieldValue }) => ({
           validator(_, val) {
             if (val) {
@@ -131,7 +135,12 @@ const Comp: React.FC<Props> = ({ id, ...modalProps }) => {
   }, [userId]);
 
   return (
-    <Modal {...modalProps} 
title={t('components.Layout.NavWidget.EditPassword')} onOk={onOk}>
+    <Modal
+      {...modalProps}
+      width={590}
+      title={t('components.Layout.NavWidget.EditPassword')}
+      onOk={onOk}
+    >
       <FormGenerator content={content} form={form} useMaxWidth />
     </Modal>
   );
diff --git a/inlong-dashboard/src/ui/locales/cn.json 
b/inlong-dashboard/src/ui/locales/cn.json
index a04bafc10c..158a5877b3 100644
--- a/inlong-dashboard/src/ui/locales/cn.json
+++ b/inlong-dashboard/src/ui/locales/cn.json
@@ -755,7 +755,7 @@
   "pages.ClusterTags.TagPlaceholder": "请输入标签",
   "pages.ClusterTags.TenantPlaceholder": "请选择租户",
   "pages.Login.PleaseEnterUserName": "请输入用户名",
-  "pages.Login.PasswordRules": "只能包含小写字母、数字、中划线、下划线",
+  "pages.Login.PasswordRules": "只能包含小写字母、数字、中划线、下划线、@",
   "pages.Login.Login": "登录",
   "pages.Login.PleaseEnterYourPassword": "请输入密码",
   "pages.UserManagement.DetailModal.Day": "天",
diff --git a/inlong-dashboard/src/ui/locales/en.json 
b/inlong-dashboard/src/ui/locales/en.json
index 5a2bc56b79..09d707bca3 100644
--- a/inlong-dashboard/src/ui/locales/en.json
+++ b/inlong-dashboard/src/ui/locales/en.json
@@ -755,7 +755,7 @@
   "pages.ClusterTags.TagPlaceholder": "Please enter a tag",
   "pages.ClusterTags.TenantPlaceholder": "Please select a tenant",
   "pages.Login.PleaseEnterUserName": "Please enter user name",
-  "pages.Login.PasswordRules": "Only lowercase letters, numbers, minus, and 
underscores",
+  "pages.Login.PasswordRules": "Only lowercase letters, numbers, minus, @, and 
underscores",
   "pages.Login.Login": "Login",
   "pages.Login.PleaseEnterYourPassword": "Please enter your password",
   "pages.UserManagement.DetailModal.Day": "Days",
diff --git a/inlong-dashboard/src/ui/pages/Login/index.tsx 
b/inlong-dashboard/src/ui/pages/Login/index.tsx
index 41e1b20a43..ccbd3e2a86 100644
--- a/inlong-dashboard/src/ui/pages/Login/index.tsx
+++ b/inlong-dashboard/src/ui/pages/Login/index.tsx
@@ -49,10 +49,7 @@ const Comp: React.FC = () => {
         size: 'large',
         prefix: <LockOutlined />,
       },
-      rules: [
-        { required: true, message: t('pages.Login.PleaseEnterYourPassword') },
-        { pattern: /^[0-9a-z_-]+$/, message: t('pages.Login.PasswordRules') },
-      ],
+      rules: [{ required: true, message: 
t('pages.Login.PleaseEnterYourPassword') }],
     },
   ];
 

Reply via email to