Skip to content

Commit

Permalink
fix: 修复任务未执行节点预览时免渲染表单项中变量仍被渲染问题 TencentBlueKing#7358
Browse files Browse the repository at this point in the history
  • Loading branch information
lTimej committed May 16, 2024
1 parent 84875d9 commit 5ba4a45
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions gcloud/tasktmpl3/domains/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ def get_need_render_context_keys():
if node_type == NodeType.ServiceActivity.value and node_code != "subprocess_plugin":
need_render_context_keys = get_need_render_context_keys()
else:
need_render_context_keys = list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys())
no_need_render_keys = {
"${%s}" % key
for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items()
if not val.get("need_render")
}
need_render_context_keys = set(list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys()))
no_need_render_keys = set(
{
"${%s}" % key
for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items()
if not val.get("need_render")
}
)

need_render_context_keys = need_render_context_keys.difference(no_need_render_keys)
context_values = [
ContextValue(key=key, type=VAR_CONTEXT_MAPPING[info["type"]], value=info["value"], code=info.get("custom_type"))
Expand Down

0 comments on commit 5ba4a45

Please sign in to comment.