fix(reactflowUtils.ts): update updateEdgesIds function to correctly update targetHandle proxy ids and stringify targetHandle
fix(reactflowUtils.ts): update expandGroupNode function to correctly iterate over flowEdges instead of ReactFlowInstance.getEdges() to redirect edges to correct proxy node
This commit is contained in:
parent
4b04aadd1d
commit
46fc843760
1 changed files with 11 additions and 2 deletions
|
|
@ -918,7 +918,16 @@ function updateProxyIdsOnTemplate(
|
|||
});
|
||||
}
|
||||
|
||||
function updateEdgesIds(edges: Edge[], idsMap: { [key: string]: string }) {}
|
||||
function updateEdgesIds(edges: Edge[], idsMap: { [key: string]: string }) {
|
||||
edges.forEach((edge) => {
|
||||
let targetHandle: targetHandleType = edge.data.targetHandle;
|
||||
if (targetHandle.proxy && idsMap[targetHandle.proxy!.id]) {
|
||||
targetHandle.proxy!.id = idsMap[targetHandle.proxy!.id];
|
||||
}
|
||||
edge.data.targetHandle = targetHandle;
|
||||
edge.targetHandle = scapedJSONStringfy(targetHandle);
|
||||
});
|
||||
}
|
||||
|
||||
export function expandGroupNode(
|
||||
groupNode: NodeDataType,
|
||||
|
|
@ -936,7 +945,7 @@ export function expandGroupNode(
|
|||
console.log(gEdges);
|
||||
//redirect edges to correct proxy node
|
||||
let updatedEdges: Edge[] = [];
|
||||
ReactFlowInstance.getEdges().forEach((edge) => {
|
||||
flowEdges.forEach((edge) => {
|
||||
let newEdge = _.cloneDeep(edge);
|
||||
if (newEdge.target === groupNode.id) {
|
||||
const targetHandle: targetHandleType = newEdge.data.targetHandle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue