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

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


The following commit(s) were added to refs/heads/1.3.2-release by this push:
     new f668563  [bugFix][ui] cherry pick commit from dev for When modifying 
the dag, if the DAG is not saved, it cannot be formatted (#3282)
f668563 is described below

commit f668563c0c03e52ee405f554840d7de430446229
Author: break60 <[email protected]>
AuthorDate: Thu Jul 23 09:50:35 2020 +0800

    [bugFix][ui] cherry pick commit from dev for When modifying the dag, if the 
DAG is not saved, it cannot be formatted (#3282)
    
    * Click Cancel, the node data is restored to the original data
    
    * Delete the pid of the master and worker processes
    
    * When modifying the dag, if the DAG is not saved, it cannot be formatted
---
 dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue | 4 ++++
 dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js      | 1 +
 dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js         | 3 ++-
 dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js         | 3 ++-
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue 
b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
index a5098a0..e7962da 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
@@ -170,6 +170,10 @@
 
       // DAG automatic layout
       dagAutomaticLayout() {
+        if(this.store.state.dag.isEditDag) {
+          this.$message.warning(`${i18n.$t('Please save the DAG before 
formatting')}`)
+          return false
+        }
         $('#canvas').html('')
 
       // Destroy round robin
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js 
b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
index 09d51b9..e2f3f2b 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
@@ -230,6 +230,7 @@ export default {
         id: payload
       }, res => {
         resolve(res)
+        state.isEditDag = false
       }).catch(e => {
         reject(e)
       })
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 657dcef..504534e 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -599,5 +599,6 @@ export default {
   zkDirectory: 'zkDirectory',
   'Directory detail': 'Directory detail',
   'Connection name': 'Connection name',
-  'Current connection settings': 'Current connection settings'
+  'Current connection settings': 'Current connection settings',
+  'Please save the DAG before formatting': 'Please save the DAG before 
formatting'
 }
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 8f38f34..f84f41b 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -604,5 +604,6 @@ export default {
   zkDirectory: 'zk注册目录',
   'Directory detail': '查看目录详情',
   'Connection name': '连线名',
-  'Current connection settings': '当前连线设置'
+  'Current connection settings': '当前连线设置',
+  'Please save the DAG before formatting': '格式化前请先保存DAG'
 }

Reply via email to