mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-31 23:47:28 -08:00
hide labels on connectors
This commit is contained in:
parent
3cca56d2ee
commit
f7ad5c0da8
|
@ -133,7 +133,7 @@ import NodeCreator from '@/components/NodeCreator/NodeCreator.vue';
|
||||||
import NodeSettings from '@/components/NodeSettings.vue';
|
import NodeSettings from '@/components/NodeSettings.vue';
|
||||||
import RunData from '@/components/RunData.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 mixins from 'vue-typed-mixins';
|
||||||
import { v4 as uuidv4} from 'uuid';
|
import { v4 as uuidv4} from 'uuid';
|
||||||
|
@ -1732,6 +1732,7 @@ export default mixins(
|
||||||
|
|
||||||
[...incoming, ...outgoing].forEach((connection: Connection) => {
|
[...incoming, ...outgoing].forEach((connection: Connection) => {
|
||||||
showOrHideMidpointArrow(connection);
|
showOrHideMidpointArrow(connection);
|
||||||
|
showOrHideItemsLabel(connection);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onNodeRun ({name, data}: {name: string, data: ITaskData[] | null}) {
|
onNodeRun ({name, data}: {name: string, data: ITaskData[] | null}) {
|
||||||
|
|
|
@ -162,6 +162,25 @@ export const getIcon = (name: string): string => {
|
||||||
return '';
|
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) => {
|
const canUsePosition = (position1: XYPositon, position2: XYPositon) => {
|
||||||
if (Math.abs(position1[0] - position2[0]) <= 100) {
|
if (Math.abs(position1[0] - position2[0]) <= 100) {
|
||||||
if (Math.abs(position1[1] - position2[1]) <= 50) {
|
if (Math.abs(position1[1] - position2[1]) <= 50) {
|
||||||
|
|
Loading…
Reference in a new issue