From 2d8a0a13f027b154eed52c2a65cacaadf617c802 Mon Sep 17 00:00:00 2001 From: samz406 Date: Tue, 28 Apr 2020 17:11:04 +0800 Subject: [PATCH 01/23] fix The create user is always loading when the queue does not select any value --- .../security/pages/users/_source/createUser.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue index 39dc27855a..b2cf89e1c7 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue @@ -150,7 +150,7 @@ // Mobile phone number regular let regPhone = /^1(3|4|5|6|7|8)\d{9}$/; // eslint-disable-line - + let regPassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]+$)[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、0-9A-Za-z]{6,22}$/; // user name @@ -194,7 +194,7 @@ _getQueueList () { return new Promise((resolve, reject) => { this.store.dispatch('security/getQueueList').then(res => { - + this.queueList = _.map(res, v => { return { id: v.id, @@ -229,12 +229,18 @@ }, _submit () { this.$refs['popup'].spinnerLoading = true + + let queueCode = ''; + //get queue code + if (this.queueName != ''){ + queueCode = this.queueList.length > 0 ? _.find(this.queueList, ['id', this.queueName]).code : '' + } let param = { userName: this.userName, userPassword: this.userPassword, tenantId: this.tenantId, email: this.email, - queue: this.queueList.length>0? _.find(this.queueList, ['id', this.queueName]).code : '', + queue: queueCode, phone: this.phone } From 9395abb15556c004024b9fe462ffc9c1c9433360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=96=E9=B8=A3?= Date: Thu, 7 May 2020 12:52:28 +0800 Subject: [PATCH 02/23] unique check before import ProcessDefinitions --- .../api/service/ProcessDefinitionService.java | 7 +++++++ sql/dolphinscheduler_mysql.sql | 1 + 2 files changed, 8 insertions(+) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java index 4fdafa46fa..f67f372c5c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java @@ -782,6 +782,13 @@ public class ProcessDefinitionService extends BaseDAGService { processDefinitionName, 1); } + //unique check + result = verifyProcessDefinitionName(loginUser, currentProjectName, processDefinitionName); + Status status = (Status) result.get(Constants.STATUS); + if (!Status.SUCCESS.equals(status)) { + return false; + } + // get create process result Map createProcessResult = getCreateProcessResult(loginUser, diff --git a/sql/dolphinscheduler_mysql.sql b/sql/dolphinscheduler_mysql.sql index c0c81dcb21..8ff2667f5f 100644 --- a/sql/dolphinscheduler_mysql.sql +++ b/sql/dolphinscheduler_mysql.sql @@ -415,6 +415,7 @@ CREATE TABLE `t_ds_process_definition` ( `modify_by` varchar(255) DEFAULT NULL, `resource_ids` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), + UNIQUE KEY `process_definition_unique` (`name`,`project_id`), KEY `process_definition_index` (`project_id`,`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; From ec2509fc466703b49b7aee5573d975d0c0251957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=96=E9=B8=A3?= Date: Thu, 7 May 2020 15:36:51 +0800 Subject: [PATCH 03/23] unique check before import ProcessDefinitions --- .../api/service/ProcessDefinitionService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java index f67f372c5c..3ec6d20414 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java @@ -783,9 +783,12 @@ public class ProcessDefinitionService extends BaseDAGService { } //unique check - result = verifyProcessDefinitionName(loginUser, currentProjectName, processDefinitionName); - Status status = (Status) result.get(Constants.STATUS); - if (!Status.SUCCESS.equals(status)) { + Map checkResult = verifyProcessDefinitionName(loginUser, currentProjectName, processDefinitionName); + Status status = (Status) checkResult.get(Constants.STATUS); + if (Status.SUCCESS.equals(status)) { + putMsg(result, Status.SUCCESS); + } else { + result.putAll(checkResult); return false; } From d20e1f95e1734419b4f0ea2c9b766c3dab1bc9eb Mon Sep 17 00:00:00 2001 From: samz406 Date: Thu, 7 May 2020 16:08:28 +0800 Subject: [PATCH 04/23] Modify the prompt message when the user does not select the queue --- .../conf/home/pages/security/pages/users/_source/createUser.vue | 2 +- dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js | 2 +- dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue index c02b205d79..4e78d1260e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/createUser.vue @@ -60,7 +60,7 @@