From 07ced8b59136324100a0371e327d6978d8036dd0 Mon Sep 17 00:00:00 2001 From: zhuangchong Date: Fri, 16 Oct 2020 15:10:20 +0800 Subject: [PATCH 1/2] [fix-#3843][api]When update workflow definition,if name already exists, the prompt is not friendly. --- .../js/conf/home/pages/dag/_source/udp/udp.vue | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue index e6949b33e3..18cf86a2b6 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue @@ -82,7 +82,7 @@ {{$t('Cancel')}} - {{$t('Add')}} + {{$t('Add')}} @@ -99,6 +99,7 @@ name: 'udp', data () { return { + originalName: '', // dag name name: '', // dag description @@ -169,22 +170,14 @@ this.$emit('onUdp') } - // Edit => direct storage - if (this.store.state.dag.name && this.store.state.dag.name===this.name) { - _verif() - } else if (this.store.state.dag.name && this.store.state.dag.name!==this.name) { + if (this.originalName !== this.name) { this.store.dispatch('dag/verifDAGName', this.name).then(res => { _verif() }).catch(e => { this.$message.error(e.msg || '') }) } else { - // New First verify that the name exists - this.store.dispatch('dag/verifDAGName', this.name).then(res => { - _verif() - }).catch(e => { - this.$message.error(e.msg || '') - }) + _verif() } }, /** @@ -207,6 +200,7 @@ this.udpList = dag.globalParams this.udpListCache = dag.globalParams this.name = dag.name + this.originalName = dag.name this.description = dag.description this.syncDefine = dag.syncDefine this.timeout = dag.timeout || 0 From a045827077e1f5f7a0cefa1d8cdfb94d6e2730f4 Mon Sep 17 00:00:00 2001 From: zhuangchong Date: Fri, 16 Oct 2020 16:44:39 +0800 Subject: [PATCH 2/2] update code. --- .../src/js/conf/home/pages/dag/_source/udp/udp.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue index 18cf86a2b6..8bb0b66640 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue @@ -99,7 +99,6 @@ name: 'udp', data () { return { - originalName: '', // dag name name: '', // dag description @@ -170,7 +169,7 @@ this.$emit('onUdp') } - if (this.originalName !== this.name) { + if (this.store.state.dag.name !== this.name) { this.store.dispatch('dag/verifDAGName', this.name).then(res => { _verif() }).catch(e => { @@ -200,7 +199,6 @@ this.udpList = dag.globalParams this.udpListCache = dag.globalParams this.name = dag.name - this.originalName = dag.name this.description = dag.description this.syncDefine = dag.syncDefine this.timeout = dag.timeout || 0