You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/09/19 05:00:15 UTC

[incubator-streampark] branch dev updated: [Bug] Fix the help when user/role name already exists (#1635)

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

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 7ef98644d [Bug] Fix the help when user/role name already exists (#1635)
7ef98644d is described below

commit 7ef98644d263b177cbbcfac7de36e8fb007ed72a
Author: 1996fanrui <19...@gmail.com>
AuthorDate: Mon Sep 19 13:00:09 2022 +0800

    [Bug] Fix the help when user/role name already exists (#1635)
---
 .../src/views/system/role/RoleAdd.vue                  | 18 ++++++++----------
 .../src/views/system/user/UserAdd.vue                  | 11 ++++-------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/streampark-console/streampark-console-webapp/src/views/system/role/RoleAdd.vue b/streampark-console/streampark-console-webapp/src/views/system/role/RoleAdd.vue
index ba3f938d4..9dc02f76a 100644
--- a/streampark-console/streampark-console-webapp/src/views/system/role/RoleAdd.vue
+++ b/streampark-console/streampark-console-webapp/src/views/system/role/RoleAdd.vue
@@ -49,7 +49,7 @@
           v-decorator="[
             'remark',
             {rules: [
-              { max: 50, message: '长度不能超过50个字符'}
+              { max: 50, message: 'Description should not be longer than 50 characters'}
             ]}]" />
       </a-form-item>
       <a-form-item
@@ -153,7 +153,7 @@ export default {
         this.menuSelectHelp = ''
       } else {
         this.menuSelectStatus = 'error'
-        this.menuSelectHelp = '请选择相应的权限'
+        this.menuSelectHelp = 'Please select the permission.'
       }
     },
     handleExpand (expandedKeys) {
@@ -161,14 +161,12 @@ export default {
     },
     handleSubmit () {
       const checkedArr = this.selectedKeysAndHalfCheckedKeys
-      if (this.validateStatus !== 'success') {
-        this.handleRoleNameBlur()
-      } else if (checkedArr.length === 0) {
+      if (checkedArr.length === 0) {
         this.menuSelectStatus = 'error'
-        this.menuSelectHelp = '请选择相应的权限'
+        this.menuSelectHelp = 'Please select the permission.'
       } else {
         this.form.validateFields((err, values) => {
-          if (!err) {
+          if (!err && this.validateStatus === 'success') {
             this.loading = true
             const role = this.form.getFieldsValue()
             role.menuId = checkedArr.join(',')
@@ -193,7 +191,7 @@ export default {
       if (roleName.length) {
         if (roleName.length > 10) {
           this.validateStatus = 'error'
-          this.help = '角色名称不能超过10个字符'
+          this.help = 'Role name should not be longer than 10 characters'
         } else {
           this.validateStatus = 'validating'
           checkName({
@@ -204,13 +202,13 @@ export default {
               this.help = ''
             } else {
               this.validateStatus = 'error'
-              this.help = '抱歉,该角色名称已存在'
+              this.help = 'Sorry, the role name already exists'
             }
           })
         }
       } else {
         this.validateStatus = 'error'
-        this.help = '角色名称不能为空'
+        this.help = 'Role name cannot be empty'
       }
     }
   },
diff --git a/streampark-console/streampark-console-webapp/src/views/system/user/UserAdd.vue b/streampark-console/streampark-console-webapp/src/views/system/user/UserAdd.vue
index 67152457a..06d49c937 100644
--- a/streampark-console/streampark-console-webapp/src/views/system/user/UserAdd.vue
+++ b/streampark-console/streampark-console-webapp/src/views/system/user/UserAdd.vue
@@ -183,9 +183,6 @@ export default {
     },
 
     handleSubmit() {
-      if (this.validateStatus !== 'success') {
-        this.handleUserNameBlur()
-      }
       this.form.validateFields((err, user) => {
         if (!err && this.validateStatus === 'success') {
           user.roleId = user.roleId.join(',')
@@ -207,10 +204,10 @@ export default {
       if (username.length) {
         if (username.length > 20) {
           this.validateStatus = 'error'
-          this.help = '用户名不能超过10个字符'
+          this.help = 'User name should not be longer than 20 characters'
         } else if (username.length < 4) {
           this.validateStatus = 'error'
-          this.help = '用户名不能少于4个字符'
+          this.help = 'Team name should not be less than 4 characters'
         } else {
           this.validateStatus = 'validating'
           checkUserName({
@@ -221,13 +218,13 @@ export default {
               this.help = ''
             } else {
               this.validateStatus = 'error'
-              this.help = '抱歉,该用户名已存在'
+              this.help = 'Sorry, the user name already exists'
             }
           })
         }
       } else {
         this.validateStatus = 'error'
-        this.help = '用户名不能为空'
+        this.help = 'User name cannot be empty'
       }
     }
   },