fix(editor): Nodes connectors improvements (#8945)

Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
Giulio Andreini
2024-03-26 09:54:04 +01:00
committed by GitHub
parent ef45da95f1
commit 264f918d97
5 changed files with 31 additions and 11 deletions

View File

@@ -28,6 +28,7 @@ import { useHistoryStore } from '@/stores/history.store';
import { useCanvasStore } from '@/stores/canvas.store';
import type { EndpointSpec } from '@jsplumb/common';
import { useDeviceSupport } from 'n8n-design-system';
import type { N8nEndpointLabelLength } from '@/plugins/jsplumb/N8nPlusEndpointType';
const createAddInputEndpointSpec = (
connectionName: NodeConnectionType,
@@ -55,6 +56,12 @@ const createDiamondOutputEndpointSpec = (): EndpointSpec => ({
},
});
const getEndpointLabelLength = (length: number): N8nEndpointLabelLength => {
if (length <= 2) return 'small';
else if (length <= 6) return 'medium';
return 'large';
};
export const nodeBase = defineComponent({
data() {
return {
@@ -371,7 +378,7 @@ export const nodeBase = defineComponent({
outputConfigurations.push(outputConfiguration);
});
const endpointLabelLength = maxLabelLength < 4 ? 'short' : 'medium';
const endpointLabelLength = getEndpointLabelLength(maxLabelLength);
this.outputs.forEach((value, i) => {
const outputConfiguration = outputConfigurations[i];