Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(DND): Fix console errors related to DND #1895

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,21 @@
}
},
end(dropResult, monitor) {
const graph = controller.getGraph();
// Show all edges after dropping
graph.getEdges().forEach((edge) => edge.setVisible(true));

if (monitor.didDrop() && dropResult) {
const draggedNodePath = element.getData().vizNode.data.path;
dropResult.getData()?.vizNode?.moveNodeTo(draggedNodePath);
// Set an empty model to clear the graph
controller.fromModel({

Check warning on line 113 in packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx

View check run for this annotation

Codecov / codecov/patch

packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx#L113

Added line #L113 was not covered by tests
nodes: [],
edges: [],
});
entitiesContext.updateEntitiesFromCamelResource();
} else {
// Show all edges after dropping
controller

Check warning on line 120 in packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx

View check run for this annotation

Codecov / codecov/patch

packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx#L120

Added line #L120 was not covered by tests
.getGraph()
.getEdges()
.forEach((edge) => edge.setVisible(true));

Check warning on line 123 in packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx

View check run for this annotation

Codecov / codecov/patch

packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx#L123

Added line #L123 was not covered by tests
controller.getGraph().layout();
}
},
Expand Down
Loading