mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 08:35:08 +08:00
### What problem does this PR solve? Feat: Click the edit tool button of the agent form to open the corresponding form #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -85,6 +85,8 @@ export type RFState = {
|
||||
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
|
||||
findAgentToolNodeById: (id: string | null) => string | undefined;
|
||||
selectNodeIds: (nodeIds: string[]) => void;
|
||||
};
|
||||
|
||||
// this is our useStore hook that we can use in our components to get parts of the store and call actions
|
||||
@ -518,6 +520,22 @@ const useGraphStore = create<RFState>()(
|
||||
),
|
||||
);
|
||||
},
|
||||
findAgentToolNodeById: (id) => {
|
||||
const { edges } = get();
|
||||
return edges.find(
|
||||
(edge) =>
|
||||
edge.source === id && edge.sourceHandle === NodeHandleId.Tool,
|
||||
)?.target;
|
||||
},
|
||||
selectNodeIds: (nodeIds) => {
|
||||
const { nodes, setNodes } = get();
|
||||
setNodes(
|
||||
nodes.map((node) => ({
|
||||
...node,
|
||||
selected: nodeIds.includes(node.id),
|
||||
})),
|
||||
);
|
||||
},
|
||||
})),
|
||||
{ name: 'graph', trace: true },
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user