mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
### 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:
@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user