mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(editor): Add execute workflow functionality and statuses to new canvas (no-changelog) (#9902)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import type { IConnection, IConnections, INodeTypeDescription } from 'n8n-workflow';
|
||||
import type { INodeUi } from '@/Interface';
|
||||
import type { CanvasConnection, CanvasConnectionPortType, CanvasConnectionPort } from '@/types';
|
||||
import { CanvasConnectionMode } from '@/types';
|
||||
import type { Connection } from '@vue-flow/core';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { isValidNodeConnectionType } from '@/utils/typeGuards';
|
||||
import { isValidCanvasConnectionMode, isValidNodeConnectionType } from '@/utils/typeGuards';
|
||||
import { NodeConnectionType } from 'n8n-workflow';
|
||||
|
||||
export function mapLegacyConnectionsToCanvasConnections(
|
||||
@@ -29,8 +30,8 @@ export function mapLegacyConnectionsToCanvasConnections(
|
||||
id: `[${fromId}/${fromConnectionType}/${fromIndex}][${toId}/${toConnectionType}/${toIndex}]`,
|
||||
source: fromId,
|
||||
target: toId,
|
||||
sourceHandle: `outputs/${fromConnectionType}/${fromIndex}`,
|
||||
targetHandle: `inputs/${toConnectionType}/${toIndex}`,
|
||||
sourceHandle: `${CanvasConnectionMode.Output}/${fromConnectionType}/${fromIndex}`,
|
||||
targetHandle: `${CanvasConnectionMode.Input}/${toConnectionType}/${toIndex}`,
|
||||
data: {
|
||||
fromNodeName,
|
||||
source: {
|
||||
@@ -53,9 +54,10 @@ export function mapLegacyConnectionsToCanvasConnections(
|
||||
}
|
||||
|
||||
export function parseCanvasConnectionHandleString(handle: string | null | undefined) {
|
||||
const [, type, index] = (handle ?? '').split('/');
|
||||
const [mode, type, index] = (handle ?? '').split('/');
|
||||
|
||||
const resolvedType = isValidNodeConnectionType(type) ? type : NodeConnectionType.Main;
|
||||
const resolvedMode = isValidCanvasConnectionMode(mode) ? mode : CanvasConnectionMode.Output;
|
||||
|
||||
let resolvedIndex = parseInt(index, 10);
|
||||
if (isNaN(resolvedIndex)) {
|
||||
@@ -63,6 +65,7 @@ export function parseCanvasConnectionHandleString(handle: string | null | undefi
|
||||
}
|
||||
|
||||
return {
|
||||
mode: resolvedMode,
|
||||
type: resolvedType,
|
||||
index: resolvedIndex,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user