refactor(ui): merge the workflow and nodes slices

This allows undo/redo history to apply to node editor and workflow details/form.
This commit is contained in:
psychedelicious
2025-04-07 20:17:22 +10:00
parent a0b515979a
commit 96a481530d
54 changed files with 487 additions and 534 deletions

View File

@@ -26,14 +26,9 @@ export const useEnqueueWorkflows = () => {
dispatch(enqueueRequestedWorkflows());
const state = getState();
const nodesState = selectNodesSlice(state);
const workflow = state.workflow;
const templates = $templates.get();
const graph = buildNodesGraph(state, templates);
const builtWorkflow = buildWorkflowWithValidation({
nodes: nodesState.nodes,
edges: nodesState.edges,
workflow,
});
const builtWorkflow = buildWorkflowWithValidation(nodesState);
if (builtWorkflow) {
// embedded workflows don't have an id
@@ -134,10 +129,10 @@ export const useEnqueueWorkflows = () => {
} as const;
});
assert(workflow.id, 'Workflow without ID cannot be used for API validation run');
assert(nodesState.id, 'Workflow without ID cannot be used for API validation run');
batchConfig.validation_run_data = {
workflow_id: workflow.id,
workflow_id: nodesState.id,
input_fields: api_input_fields,
output_fields: api_output_fields,
};