add execute result branch

This commit is contained in:
yoan
2025-01-19 17:01:02 +08:00
parent 69d4b3f93d
commit e6e964aa8c
13 changed files with 336 additions and 47 deletions

View File

@@ -27,20 +27,29 @@ const AddNode = ({ node, disabled }: AddNodeProps) => {
[WorkflowNodeType.Apply, "workflow_node.apply.label", <SolutionOutlinedIcon />],
[WorkflowNodeType.Deploy, "workflow_node.deploy.label", <CloudUploadOutlinedIcon />],
[WorkflowNodeType.Branch, "workflow_node.branch.label", <SisternodeOutlinedIcon />],
[WorkflowNodeType.ExecuteResultBranch, "workflow_node.execute_result_branch.label", <SisternodeOutlinedIcon />],
[WorkflowNodeType.Notify, "workflow_node.notify.label", <SendOutlinedIcon />],
].map(([type, label, icon]) => {
return {
key: type as string,
disabled: disabled,
label: t(label as string),
icon: icon,
onClick: () => {
const nextNode = newNode(type as WorkflowNodeType);
addNode(nextNode, node.id);
},
};
});
}, [node.id, disabled]);
]
.filter(([type]) => {
if (node.type !== WorkflowNodeType.Apply && node.type !== WorkflowNodeType.Deploy && type === WorkflowNodeType.ExecuteResultBranch) {
return false;
}
return true;
})
.map(([type, label, icon]) => {
return {
key: type as string,
disabled: disabled,
label: t(label as string),
icon: icon,
onClick: () => {
const nextNode = newNode(type as WorkflowNodeType);
addNode(nextNode, node.id);
},
};
});
}, [node.id, disabled, node.type]);
return (
<div className="relative py-6 before:absolute before:left-1/2 before:top-0 before:h-full before:w-[2px] before:-translate-x-1/2 before:bg-stone-200 before:content-['']">