Skip to content

Commit

Permalink
独立子流程节点失败后跳过后,其下面的子节点禁止操作 (TencentBlueKing#7192)
Browse files Browse the repository at this point in the history
* minor: 项目变量查看页添加默认值

* optimization: 独立子流程节点失败后跳过后,其下面的子节点禁止操作
  • Loading branch information
ywywZhou authored Nov 27, 2023
1 parent 58bcb73 commit 98ff1b8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
26 changes: 25 additions & 1 deletion frontend/desktop/src/pages/task/TaskExecute/ExecuteInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,28 @@
isShowActionWrap () {
// 任务终止时禁止节点操作
if (this.state === 'REVOKED') return false
// 判断父级节点是否存在失败后跳过
if (this.nodeDetailConfig.taskId) {
const allNodeStatus = {
...this.nodeDisplayStatus.children,
...Object.values(this.subprocessNodeStatus).reduce((acc, item) => {
return {
...acc,
...item.data.children
}
}, {})
}
const parentIds = this.nodeDetailConfig.root_node.split('-')
const isFailedSkip = parentIds.some(id => {
const { state, skip } = allNodeStatus[id] || {}
return state === 'FINISHED' && skip
})
if (isFailedSkip) {
return false
}
}
return (this.realTimeState.state === 'RUNNING' && !this.isSubProcessNode)
|| this.isShowRetryBtn
|| this.isShowSkipBtn
Expand Down Expand Up @@ -1391,7 +1413,9 @@
}
const resp = await this.getBatchInstanceStatus(data)
if (!resp.result) return
this.subprocessNodeStatus = resp.data
Object.keys(resp.data).forEach(key => {
this.$set(this.subprocessNodeStatus, key, resp.data[key])
})
for (const [key, value] of Object.entries(resp.data)) {
const { root_node, node_id } = this.subprocessTasks[key]
const nodeInfo = this.getNodeInfo(this.nodeData, root_node, node_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,17 @@
</div>
</div>
</section>
<section v-if="theEditingData.source_type !== 'component_outputs' && !isInternalVal" class="form-section">
<section v-if="!['component_outputs', 'system'].includes(theEditingData.source_type)" class="form-section">
<h3>{{ theEditingData.is_meta ? $t('配置') : $t('默认值') }}</h3>
<!-- 项目变量 -->
<div class="form-item clearfix" v-if="theEditingData.source_type === 'project'">
<label>{{ $t('输入框') }}</label>
<div class="form-content">
<bk-input v-model="theEditingData.value" :readonly="true"></bk-input>
</div>
</div>
<!-- 默认值 -->
<div class="form-item value-form clearfix">
<div class="form-item value-form clearfix" v-else>
<div class="form-content" v-bkloading="{ isLoading: atomConfigLoading, opacity: 1, zIndex: 100 }">
<template v-if="!atomConfigLoading && renderConfig.length">
<RenderForm
Expand Down

0 comments on commit 98ff1b8

Please sign in to comment.