You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/10/17 13:52:04 UTC

[incubator-dolphinscheduler] branch dev updated: add verify tenant name cannot contain special characters. (#3865)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 3d4238f  add verify tenant name cannot contain special characters. (#3865)
3d4238f is described below

commit 3d4238f66811dc6b83bb65e3a146251be9ddde95
Author: zhuangchong <37...@users.noreply.github.com>
AuthorDate: Sat Oct 17 21:51:55 2020 +0800

    add verify tenant name cannot contain special characters. (#3865)
---
 .../pages/security/pages/tenement/_source/createTenement.vue     | 9 ++++++++-
 dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js           | 1 +
 dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js           | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue
index ebf644c..eb20ff9 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue
@@ -146,6 +146,13 @@
           this.$message.warning(`${i18n.$t('Please enter name')}`)
           return false
         }
+        // Verify tenant name cannot contain special characters
+        let isSpecial = /[~#^$@%&!*()<>《》:;'"{}【】	]/gi
+        if (isSpecial.test(this.tenantName)) {
+          this.$message.warning(`${i18n.$t('Please enter tenant name without special characters')}`)
+          return false
+        }
+
         return true
       },
       _submit () {
@@ -192,4 +199,4 @@
     },
     components: { mPopup, mListBoxF }
   }
-</script>
\ No newline at end of file
+</script>
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
index 0f59aec..cb32a62 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -187,6 +187,7 @@ export default {
   'Please select a queue': 'default is tenant association queue',
   'Please enter the tenant code in English': 'Please enter the tenant code in English',
   'Please enter tenant code in English': 'Please enter tenant code in English',
+  'Please enter tenant name without special characters': 'Please enter tenant name without special characters',
   'Edit User': 'Edit User',
   Tenant: 'Tenant',
   Email: 'Email',
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
index 0481cd0..8bedab1 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -189,6 +189,7 @@ export default {
   Queue: 'Yarn 队列',
   'Please enter the tenant code in English': '请输入租户编码只允许英文',
   'Please enter tenant code in English': '请输入英文租户编码',
+  'Please enter tenant name without special characters': '请输入不包含特殊字符的租户名称',
   'Edit User': '编辑用户',
   Tenant: '租户',
   Email: '邮件',