From 69a153c5f5c9d91b4eececbcfbf9e2fb407f89c4 Mon Sep 17 00:00:00 2001 From: Wangyizhi1 <87303815+Wangyizhi1@users.noreply.github.com> Date: Sat, 18 Sep 2021 17:28:03 +0800 Subject: [PATCH] [Fix-6139][UI] Fix missing relationship issue (#6258) * the relationship is missing in kinship * Fix missing environmentCode parameter issue when modifying the process --- .../dag/_source/formModel/_source/relatedEnvironment.vue | 9 +++++++-- .../conf/home/pages/dag/_source/formModel/formModel.vue | 9 +++++++-- .../projects/pages/kinship/_source/graphGridOption.js | 1 + .../src/js/conf/home/store/dag/actions.js | 8 +++++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/relatedEnvironment.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/relatedEnvironment.vue index a75fe5c6a3..25b5bbf781 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/relatedEnvironment.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/relatedEnvironment.vue @@ -49,6 +49,9 @@ }, workerGroup: { type: String + }, + isNewCreate: { + type: Boolean } }, model: { @@ -70,6 +73,7 @@ }, _initEnvironmentOptions (workerGroup) { this.environmentOptions = [] + this.selectedValue = '' if (this.environmentList && workerGroup) { this.environmentList.forEach(item => { if (item.workerGroups && item.workerGroups.length > 0) { @@ -85,10 +89,11 @@ if (this.environmentOptions.length > 0) { /// default to select this environment when only have one environment - if (this.environmentOptions.length === 1 && this.selectedValue === '') { + /// automatically select only when creating a new task + if (this.isNewCreate && this.environmentOptions.length === 1 && this.selectedValue === '') { this.selectedValue = this.environmentOptions[0].code - this.$emit('environmentCodeEvent', this.selectedValue) } + this.$emit('environmentCodeEvent', this.selectedValue) } else { this.selectedValue = '' this.$emit('environmentCodeEvent', this.selectedValue) 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 3d81d3ee17..911e450afb 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 @@ -118,6 +118,7 @@ @@ -512,7 +513,9 @@ postTasks: [], prevTasks: [], // refresh part of the formModel, after set backfillItem outside - backfillRefresh: true + backfillRefresh: true, + // whether this is a new Task + isNewCreate: true } }, provide () { @@ -560,7 +563,8 @@ }, type: task.taskType, waitStartTimeout: task.taskParams.waitStartTimeout, - workerGroup: task.workerGroup + workerGroup: task.workerGroup, + environmentCode: task.environmentCode } }, /** @@ -902,6 +906,7 @@ const backfillItem = this.taskToBackfillItem(task) o = backfillItem this.backfillItem = backfillItem + this.isNewCreate = false } }) } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGridOption.js b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGridOption.js index ac08521050..5ad2408ce6 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGridOption.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGridOption.js @@ -41,6 +41,7 @@ export default function (locations, links, sourceWorkFlowCode, isShowLabel) { const { color, category } = getCategory(categoryDic, item, sourceWorkFlowCode) return { ...item, + id: item.code, emphasis: { itemStyle: { color 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 5bd9980cd3..720bd21c60 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js @@ -143,7 +143,7 @@ export default { state.globalParams = res.data.processDefinition.globalParamList // timeout state.timeout = res.data.processDefinition.timeout - // tenantId + // tenantCode state.tenantCode = res.data.processDefinition.tenantCode || 'default' // tasks info state.tasks = res.data.taskDefinitionList.map(task => _.pick(task, [ @@ -161,7 +161,8 @@ export default { 'failRetryInterval', 'timeoutFlag', 'timeoutNotifyStrategy', - 'timeout' + 'timeout', + 'environmentCode' ])) resolve(res.data) }).catch(res => { @@ -257,7 +258,8 @@ export default { 'failRetryInterval', 'timeoutFlag', 'timeoutNotifyStrategy', - 'timeout' + 'timeout', + 'environmentCode' ])) // startup parameters state.startup = _.assign(state.startup, _.pick(res.data, ['commandType', 'failureStrategy', 'processInstancePriority', 'workerGroup', 'warningType', 'warningGroupId', 'receivers', 'receiversCc']))