mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 (#9068)
### What problem does this PR solve? Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -84,6 +84,7 @@ export type RFState = {
|
||||
setClickedNodeId: (id?: string) => void;
|
||||
setClickedToolId: (id?: string) => void;
|
||||
findUpstreamNodeById: (id?: string | null) => RAGFlowNodeType | undefined;
|
||||
deleteCategorizeCaseEdges: (source: string, sourceHandle: string) => void; // Deleting a condition of a classification operator will delete the related edge
|
||||
};
|
||||
|
||||
// this is our useStore hook that we can use in our components to get parts of the store and call actions
|
||||
@ -307,14 +308,14 @@ const useGraphStore = create<RFState>()(
|
||||
[sourceHandle as string]: undefined,
|
||||
});
|
||||
break;
|
||||
case Operator.Categorize:
|
||||
if (sourceHandle)
|
||||
updateNodeForm(source, undefined, [
|
||||
'category_description',
|
||||
sourceHandle,
|
||||
'to',
|
||||
]);
|
||||
break;
|
||||
// case Operator.Categorize:
|
||||
// if (sourceHandle)
|
||||
// updateNodeForm(source, undefined, [
|
||||
// 'category_description',
|
||||
// sourceHandle,
|
||||
// 'to',
|
||||
// ]);
|
||||
// break;
|
||||
case Operator.Switch: {
|
||||
updateSwitchFormData(source, sourceHandle, target, false);
|
||||
break;
|
||||
@ -508,6 +509,15 @@ const useGraphStore = create<RFState>()(
|
||||
const edge = edges.find((x) => x.target === id);
|
||||
return getNode(edge?.source);
|
||||
},
|
||||
deleteCategorizeCaseEdges: (source, sourceHandle) => {
|
||||
const { edges, setEdges } = get();
|
||||
setEdges(
|
||||
edges.filter(
|
||||
(edge) =>
|
||||
!(edge.source === source && edge.sourceHandle === sourceHandle),
|
||||
),
|
||||
);
|
||||
},
|
||||
})),
|
||||
{ name: 'graph', trace: true },
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user