Skip to content

Commit

Permalink
fixed an issue where auto suggestion and mouse hover on port validati…
Browse files Browse the repository at this point in the history
…on were inconsistent
  • Loading branch information
M-Wicenec committed Jul 26, 2024
1 parent b694f7b commit 36aef94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ export class Edge {
if(sourceNode.isApplication() && destinationNode.isApplication()){
draggingEdgeFixable = true
}

if(sourcePort.isInputPort() && destinationPort.isInputPort() && !destinationPort.isOutputPort()){
impossibleEdge = true
}else if (sourcePort.isOutputPort() && destinationPort.isOutputPort() && !destinationPort.isInputPort()){
impossibleEdge = true
}
}

//the worst edge errror function can only check for entries in errors or warnings, it isnt able to distinguish impossible from invalid
Expand Down
7 changes: 6 additions & 1 deletion src/GraphRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2129,8 +2129,13 @@ export class GraphRenderer {
}
return
}
let isValid: Errors.Validity

const isValid = Edge.isValid(eagle, true, null, GraphRenderer.portDragSourceNode().getKey(), GraphRenderer.portDragSourcePort().getId(), GraphRenderer.destinationNode.getKey(), GraphRenderer.destinationPort.getId(), false, false, false, false, {errors:[], warnings:[]});
if(!GraphRenderer.portDragSourcePortIsInput){
isValid = Edge.isValid(eagle, true, "", GraphRenderer.portDragSourceNode().getKey(), GraphRenderer.portDragSourcePort().getId(), GraphRenderer.destinationNode.getKey(), GraphRenderer.destinationPort.getId(), false, false, false, false, {errors:[], warnings:[]});
}else{
isValid = Edge.isValid(eagle, true, "", GraphRenderer.destinationNode.getKey(), GraphRenderer.destinationPort.getId(), GraphRenderer.portDragSourceNode().getKey(), GraphRenderer.portDragSourcePort().getId(), false, false, false, false, {errors:[], warnings:[]});
}
GraphRenderer.isDraggingPortValid(isValid);
}

Expand Down

0 comments on commit 36aef94

Please sign in to comment.