feat(ui): release & run workflow

This commit is contained in:
Fu Diwei
2025-01-01 16:53:52 +08:00
parent 5c1854948c
commit 6075cc5c95
17 changed files with 197 additions and 161 deletions

View File

@@ -362,20 +362,20 @@ export const getWorkflowOutputBeforeId = (node: WorkflowNode | WorkflowBranchNod
return output;
};
export const allNodesValidated = (node: WorkflowNode | WorkflowBranchNode): boolean => {
let current = node;
export const isAllNodesValidated = (node: WorkflowNode | WorkflowBranchNode): boolean => {
let current = node as typeof node | undefined;
while (current) {
if (!isWorkflowBranchNode(current) && !current.validated) {
return false;
}
if (isWorkflowBranchNode(current)) {
for (const branch of current.branches) {
if (!allNodesValidated(branch)) {
if (!isAllNodesValidated(branch)) {
return false;
}
}
}
current = current.next as WorkflowNode;
current = current.next;
}
return true;
};