feat(editor): Implement custom edge to support loops (no-changelog) (#10171)

Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
Elias Meire
2024-07-24 14:47:18 +02:00
committed by GitHub
parent b81f0bf9ea
commit 79bccf0305
14 changed files with 236 additions and 46 deletions

View File

@@ -167,6 +167,7 @@ export function mapCanvasConnectionToLegacyConnection(
export function mapLegacyEndpointsToCanvasConnectionPort(
endpoints: INodeTypeDescription['inputs'],
endpointNames: string[] = [],
): CanvasConnectionPort[] {
if (typeof endpoints === 'string') {
console.warn('Node endpoints have not been evaluated', endpoints);
@@ -176,7 +177,8 @@ export function mapLegacyEndpointsToCanvasConnectionPort(
return endpoints.map((endpoint, endpointIndex) => {
const typeValue = typeof endpoint === 'string' ? endpoint : endpoint.type;
const type = isValidNodeConnectionType(typeValue) ? typeValue : NodeConnectionType.Main;
const label = typeof endpoint === 'string' ? undefined : endpoint.displayName;
const label =
typeof endpoint === 'string' ? endpointNames[endpointIndex] : endpoint.displayName;
const index =
endpoints
.slice(0, endpointIndex + 1)