You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/01/14 08:33:21 UTC

[dolphinscheduler] branch 2.0.3-prepare updated: [Cherry-pick-2.0.3] (#8044)

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

caishunfeng pushed a commit to branch 2.0.3-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.3-prepare by this push:
     new 59c0abc  [Cherry-pick-2.0.3] (#8044)
59c0abc is described below

commit 59c0abcc2798382164ca41bc8ac2e4684e6fc59e
Author: xiangzihao <46...@qq.com>
AuthorDate: Fri Jan 14 16:32:27 2022 +0800

    [Cherry-pick-2.0.3] (#8044)
    
    * resolve conflict
    
    * [Fix-7513] Fix identical numbers and add positive integer judgment (#8032)
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * fix bug_7513
    
    * test
    
    * test
    
    * test
    
    * test
    
    * test
    
    * chinese change
    
    Co-authored-by: Assert <42...@users.noreply.github.com>
---
 .../src/js/conf/home/pages/dag/_source/dag.vue                | 11 ++++++++++-
 .../home/pages/dag/_source/formModel/_source/selectInput.vue  | 10 ++++++++--
 .../js/conf/home/pages/dag/_source/formModel/formModel.vue    |  6 +++---
 .../conf/home/pages/dag/_source/formModel/tasks/dependent.vue |  9 ++++++---
 dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js     |  7 +++++++
 dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js   |  8 ++++++++
 dolphinscheduler-ui/src/js/conf/home/store/dag/state.js       |  3 ++-
 7 files changed, 44 insertions(+), 10 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 6072908..c79a59f 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
@@ -225,7 +225,8 @@
         'setIsEditDag',
         'setName',
         'setLocations',
-        'resetLocalParam'
+        'resetLocalParam',
+        'setDependResult'
       ]),
       /**
        * Toggle full screen
@@ -561,6 +562,7 @@
           .then((res) => {
             this.$message(this.$t('Refresh status succeeded'))
             const { taskList } = res.data
+            const list = res.list
             if (taskList) {
               this.taskInstances = taskList
               taskList.forEach((taskInstance) => {
@@ -571,6 +573,13 @@
                 })
               })
             }
+            if (list) {
+              list.forEach((dependent) => {
+                if (dependent.dependentResult) {
+                  this.setDependResult(JSON.parse(dependent.dependentResult))
+                }
+              })
+            }
           })
           .finally(() => {
             this.loading(false)
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue
index ae8d18e..0af6729 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue
@@ -71,8 +71,14 @@
     },
     methods: {
       _onChange (o) {
-        this.$emit('valueEvent', +o)
-        this._setIconState(+o)
+        // positive integer judgment
+        const r = /^\+?[1-9][0-9]*$/
+        if (!r.test(o)) {
+          this.$message.warning(`${i18n.$t('Please enter a positive integer')}`)
+        } else {
+          this.$emit('valueEvent', +o)
+          this._setIconState(+o)
+        }
       },
       _setIconState (value) {
         // Whether there is a list
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
index 0552a4d..c30c130 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
@@ -130,13 +130,13 @@
           <div slot="content">
             <m-select-input
               v-model="maxRetryTimes"
-              :list="[0, 1, 2, 3, 4]"
+              :list="[]"
             ></m-select-input>
             <span>({{ $t("Times") }})</span>
             <span class="text-b">{{ $t("Failed retry interval") }}</span>
             <m-select-input
               v-model="retryInterval"
-              :list="[1, 10, 30, 60, 120]"
+              :list="[]"
             ></m-select-input>
             <span>({{ $t("Minute") }})</span>
           </div>
@@ -155,7 +155,7 @@
           <div slot="content">
             <m-select-input
               v-model="delayTime"
-              :list="[0, 1, 5, 10]"
+              :list="[]"
             ></m-select-input>
             <span>({{ $t("Minute") }})</span>
           </div>
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
index 1e52a55..5f03ba6 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
@@ -67,7 +67,7 @@
   import mListBox from './_source/listBox'
   import mDependItemList from './_source/dependItemList'
   import disabledState from '@/module/mixin/disabledState'
-  import { mapActions } from 'vuex'
+  import { mapState, mapActions } from 'vuex'
 
   export default {
     name: 'dependent',
@@ -166,7 +166,7 @@
     },
     created () {
       let o = this.backfillItem
-      let dependentResult = $(`#${o.id}`).data('dependent-result') || {}
+      let dependentResult = this.dependResult || {}
       // Does not represent an empty object backfill
       if (!_.isEmpty(o)) {
         this.relation = _.cloneDeep(o.dependence.relation) || 'AND'
@@ -174,7 +174,7 @@
         let defaultState = this.isDetails ? 'WAITING' : ''
         // Process instance return status display matches by key
         _.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
-          v1.state = dependentResult[`${v1.definitionId}-${v1.depTaskCode}-${v1.cycle}-${v1.dateValue}`] || defaultState
+          v1.state = dependentResult[`${v1.definitionCode}-${v1.depTaskCode}-${v1.cycle}-${v1.dateValue}`] || defaultState
         }))
         // cache project definitions
         const projectCodes = _.uniq(_.flatten(this.dependTaskList.map(dep => dep.dependItemList.map(item => item.projectCode))))
@@ -194,6 +194,9 @@
     destroyed () {
     },
     computed: {
+      ...mapState('dag', [
+        'dependResult'
+      ]),
       cacheDependent () {
         return {
           relation: this.relation,
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 659772e..dd19535 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
@@ -37,6 +37,13 @@ export default {
       io.get(`projects/${state.projectCode}/process-instances/${payload}/tasks`, {
         processInstanceId: payload
       }, res => {
+        res.list = _.map(res.data.taskList, v => {
+          return _.cloneDeep({
+            code: v.taskCode,
+            taskType: v.taskType,
+            dependentResult: v.dependentResult
+          })
+        })
         state.taskInstances = res.data.taskList
         resolve(res)
       }).catch(e => {
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
index a89b09c..82ffe7d 100755
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/mutations.js
@@ -105,6 +105,13 @@ export default {
   },
 
   /**
+   * set depend result
+   */
+  setDependResult (state, payload) {
+    state.dependResult = Object.assign(state.dependResult, {}, payload)
+  },
+
+  /**
    * reset params
    */
   resetParams (state, payload) {
@@ -122,6 +129,7 @@ export default {
     state.runFlag = (payload && payload.runFlag) || ''
     state.locations = (payload && payload.locations) || {}
     state.connects = (payload && payload.connects) || []
+    state.dependResult = (payload && payload.dependResult) || {}
   },
   /**
    * add task
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/state.js b/dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
index 61e1af1..6c6706f 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/state.js
@@ -120,5 +120,6 @@ export default {
   // Operating state
   isDetails: false,
   startup: {},
-  taskInstances: []
+  taskInstances: [],
+  dependResult: {}
 }