mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(editor): Add ability to import workflows in new canvas (no-changelog) (#10051)
Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
@@ -6,8 +6,6 @@ import type { Connection } from '@vue-flow/core';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { isValidCanvasConnectionMode, isValidNodeConnectionType } from '@/utils/typeGuards';
|
||||
import { NodeConnectionType } from 'n8n-workflow';
|
||||
import type { Connection as VueFlowConnection } from '@vue-flow/core/dist/types/connection';
|
||||
import { PUSH_NODES_OFFSET } from '@/utils/nodeViewUtils';
|
||||
|
||||
export function mapLegacyConnectionsToCanvasConnections(
|
||||
legacyConnections: IConnections,
|
||||
@@ -94,21 +92,6 @@ export function parseCanvasConnectionHandleString(handle: string | null | undefi
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the width and height of a connection
|
||||
*
|
||||
* @TODO See whether this is actually needed or just a legacy jsPlumb check
|
||||
*/
|
||||
export function getVueFlowConnectorLengths(connection: VueFlowConnection): [number, number] {
|
||||
const connectionId = createCanvasConnectionId(connection);
|
||||
const edgeRef = document.getElementById(connectionId);
|
||||
if (!edgeRef) {
|
||||
return [PUSH_NODES_OFFSET, PUSH_NODES_OFFSET];
|
||||
}
|
||||
|
||||
return [edgeRef.clientWidth, edgeRef.clientHeight];
|
||||
}
|
||||
|
||||
export function createCanvasConnectionHandleString({
|
||||
mode,
|
||||
type = NodeConnectionType.Main,
|
||||
|
||||
Reference in New Issue
Block a user