fix: Only show error state on components w/ errors for node validation (#3968)

* Only show error state on components w/ errors for node validation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mike Fortman 2024-10-01 10:22:31 -05:00 • committed by GitHub
commit e63c377283
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -471,7 +471,11 @@ Array<{ id: string; errors: Array<string> }> {
];
}
// validateNode(n, edges) returns an array of errors for the node
return nodes.map((n) => ({ id: n.id, errors: validateNode(n, edges) }));
const nodeMap = nodes.map((n) => ({
id: n.id,
errors: validateNode(n, edges),
}));
return nodeMap.filter((n) => n.errors?.length);
}
export function updateEdges(edges: Edge[]) {