diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index a3233b0a00..bd53fe176f 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -133,7 +133,7 @@ import NodeCreator from '@/components/NodeCreator/NodeCreator.vue'; import NodeSettings from '@/components/NodeSettings.vue'; import RunData from '@/components/RunData.vue'; -import { getLeftmostTopNode, getWorkflowCorners, scaleSmaller, scaleBigger, scaleReset, showOrHideMidpointArrow, addEndpointArrow, getDefaultOverlays, getIcon, getNewNodePosition, hideMidpointArrow } from './helpers'; +import { getLeftmostTopNode, getWorkflowCorners, scaleSmaller, scaleBigger, scaleReset, showOrHideMidpointArrow, addEndpointArrow, getDefaultOverlays, getIcon, getNewNodePosition, hideMidpointArrow, showOrHideItemsLabel } from './helpers'; import mixins from 'vue-typed-mixins'; import { v4 as uuidv4} from 'uuid'; @@ -1732,6 +1732,7 @@ export default mixins( [...incoming, ...outgoing].forEach((connection: Connection) => { showOrHideMidpointArrow(connection); + showOrHideItemsLabel(connection); }); }, onNodeRun ({name, data}: {name: string, data: ITaskData[] | null}) { diff --git a/packages/editor-ui/src/views/helpers.ts b/packages/editor-ui/src/views/helpers.ts index 7bfd6be1ce..c263a6f98f 100644 --- a/packages/editor-ui/src/views/helpers.ts +++ b/packages/editor-ui/src/views/helpers.ts @@ -162,6 +162,25 @@ export const getIcon = (name: string): string => { return ''; }; +export const showOrHideItemsLabel = (connection: Connection) => { + const overlay = connection.getOverlay('output-items-label'); + if (!overlay) { + return; + } + + // @ts-ignore + const bounds = connection.connector.bounds; + const diffX = Math.abs(bounds.maxX - bounds.minX); + const diffY = Math.abs(bounds.maxY - bounds.minY); + + if (diffX < 150 && diffY < 100) { + overlay.setVisible(false); + } + else { + overlay.setVisible(true); + } +}; + const canUsePosition = (position1: XYPositon, position2: XYPositon) => { if (Math.abs(position1[0] - position2[0]) <= 100) { if (Math.abs(position1[1] - position2[1]) <= 50) {