Feat: Filter the query variable drop-down box options by type #3221 (#8485)

### What problem does this PR solve?

Feat: Filter the query variable drop-down box options by type #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-25 16:23:20 +08:00
committed by GitHub
parent b705ff08fe
commit c4b58ed195
13 changed files with 124 additions and 23 deletions

View File

@ -56,6 +56,7 @@ export type RFState = {
onSelectionChange: OnSelectionChangeFunc;
addNode: (nodes: RAGFlowNodeType) => void;
getNode: (id?: string | null) => RAGFlowNodeType | undefined;
updateNode: (node: RAGFlowNodeType) => void;
addEdge: (connection: Connection) => void;
getEdge: (id: string) => Edge | undefined;
updateFormDataOnConnect: (connection: Connection) => void;
@ -192,6 +193,16 @@ const useGraphStore = create<RFState>()(
addNode: (node: RAGFlowNodeType) => {
set({ nodes: get().nodes.concat(node) });
},
updateNode: (node) => {
const { nodes } = get();
const nextNodes = nodes.map((x) => {
if (x.id === node.id) {
return node;
}
return x;
});
set({ nodes: nextNodes });
},
getNode: (id?: string | null) => {
return get().nodes.find((x) => x.id === id);
},