Browse Source

Merge pull request #3872 from break60/1.3.3-release

[fixBug-3840][ui]The tenant code only allows letters or a combination of letters and numbers
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
1bf2f0d8e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue
  2. 6
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  3. 5
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
  4. 4
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/TenantManageData.java

19
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue

@ -30,7 +30,7 @@
:disabled="item ? true : false" :disabled="item ? true : false"
v-model="tenantCode" v-model="tenantCode"
maxlength="60" maxlength="60"
:placeholder="$t('Please enter name')"> :placeholder="$t('Please enter tenant code')">
</x-input> </x-input>
</template> </template>
</m-list-box-f> </m-list-box-f>
@ -41,7 +41,7 @@
type="input" type="input"
v-model="tenantName" v-model="tenantName"
maxlength="60" maxlength="60"
:placeholder="$t('Please enter name')" :placeholder="$t('Please enter tenant Name')"
autocomplete="off"> autocomplete="off">
</x-input> </x-input>
</template> </template>
@ -88,7 +88,7 @@
store, store,
queueList: [], queueList: [],
queueId: '', queueId: '',
tenantCode: '', tenantCode: null,
tenantName: '', tenantName: '',
description: '', description: '',
} }
@ -133,17 +133,20 @@
}, },
_verification () { _verification () {
let isEn = /^[0-9a-zA-Z_.-]{1,}$/ let isEn = /^[0-9a-zA-Z_.-]{1,}$/
let isNumber = /^\d+$/
let isComb =/^[0-9a-zA-Z]*$/g
if (!this.tenantCode.replace(/\s*/g,"")) { if(!isComb.test(this.tenantCode)) {
this.$message.warning(`${i18n.$t('Please enter the tenant code in English')}`) this.$message.warning(`${i18n.$t('The tenant code. Only letters or a combination of letters and numbers are allowed')}`)
return false return false
} }
if (!isEn.test(this.tenantCode) || _.startsWith(this.tenantCode, '_', 0) || _.startsWith(this.tenantCode, '.', 0)) { if(isNumber.test(this.tenantCode)) {
this.$message.warning(`${i18n.$t('Please enter tenant code in English')}`) this.$message.warning(`${i18n.$t('The tenant code. Only letters or a combination of letters and numbers are allowed')}`)
return false return false
} }
if (!this.tenantName.replace(/\s*/g,"")) { if (!this.tenantName.replace(/\s*/g,"")) {
this.$message.warning(`${i18n.$t('Please enter name')}`) this.$message.warning(`${i18n.$t('Please enter tenant Name')}`)
return false return false
} }
return true return true

6
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -173,8 +173,10 @@ export default {
'Tenant Name': 'Tenant Name', 'Tenant Name': 'Tenant Name',
Queue: 'Queue', Queue: 'Queue',
'Please select a queue': 'default is tenant association queue', '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': 'Please enter tenant code',
'Please enter tenant code in English': 'Please enter tenant code in English', 'Please enter tenant Name': 'Please enter tenant Name',
'The tenant code. Only letters or a combination of letters and numbers are allowed': 'The tenant code. Only letters or a combination of letters and numbers are allowed',
'The tenant code cannot be all numbers': 'The tenant code cannot be all numbers',
'Edit User': 'Edit User', 'Edit User': 'Edit User',
Tenant: 'Tenant', Tenant: 'Tenant',
Email: 'Email', Email: 'Email',

5
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -176,8 +176,9 @@ export default {
'Tenant Code': '租户编码', 'Tenant Code': '租户编码',
'Tenant Name': '租户名称', 'Tenant Name': '租户名称',
Queue: '队列', Queue: '队列',
'Please enter the tenant code in English': '请输入租户编码只允许英文', 'Please enter tenant code': '请输入租户编码',
'Please enter tenant code in English': '请输入英文租户编码', 'Please enter tenant Name': '请输入租户名称',
'The tenant code. Only letters or a combination of letters and numbers are allowed': '租户编码只允许字母或字母与数字组合',
'Edit User': '编辑用户', 'Edit User': '编辑用户',
Tenant: '租户', Tenant: '租户',
Email: '邮件', Email: '邮件',

4
e2e/src/test/java/org/apache/dolphinscheduler/data/security/TenantManageData.java

@ -25,12 +25,12 @@ public class TenantManageData {
/** /**
* Tenant Code * Tenant Code
*/ */
public static final String TENANT_CODE = "selenium_tenant_code_1"; public static final String TENANT_CODE = "seleniumTenantCode1";
/** /**
* Tenant Name * Tenant Name
*/ */
public static final String TENANT_NAME = "selenium_tenant_Name"; public static final String TENANT_NAME = "seleniumTenantName";
/** /**
* Queue * Queue

Loading…
Cancel
Save