Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8n 2349 workflow canvas revamp #2388

Merged
merged 292 commits into from
Nov 19, 2021
Merged

N8n 2349 workflow canvas revamp #2388

merged 292 commits into from
Nov 19, 2021

Conversation

mutdmour
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@mutdmour mutdmour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hints

],
methods: {
__addNode (node: INodeUi) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor this giant function into three distinct functions..

isSource: false,
isTarget: !this.isReadOnly,
parameters: {
nodeIndex: this.nodeIndex,
type: inputName,
index,
},
dragAllowedWhenFull: inputData.dragAllowedWhenFull,
enabled: !this.isReadOnly,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes bug where you can pull connections in executions FROM INPUTS

isTarget: false,
enabled: !this.isReadOnly,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes bug where you can pull connections in executions from inputs

packages/editor-ui/src/plugins/N8nFlowchartType.js Outdated Show resolved Hide resolved
packages/editor-ui/src/plugins/N8nFlowchartType.js Outdated Show resolved Hide resolved
packages/editor-ui/src/plugins/N8nFlowchartType.js Outdated Show resolved Hide resolved
<div :class="{'node-wrapper': true, selected: isSelected}" :style="nodePosition">
<div class="select-background" v-show="isSelected"></div>
<div :class="{'node-default': true, 'touch-active': isTouchActive, 'is-touch-device': isTouchDevice}" :data-name="data.name" :ref="data.name">
<div :class="nodeClass" :style="nodeStyle" @dblclick="setNodeActive" @click.left="mouseLeftClick" v-touch:start="touchStart" v-touch:end="touchEnd">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a wrapper to keep options hoverable within node box but also have different z-index...

Comment on lines +1337 to 1340
} catch (e) {
console.error(e); // eslint-disable-line no-console
return true;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why wrap all binds with try/catch? because jsplumb has try /catch at bind level but it removes details.. this makes it easier to pin down errors

Comment on lines 1 to 10
/**
* Custom connector type
* Based on jsplumb Flowchart and Bezier types
*
* https://github.com/jsplumb/jsplumb
* https://github.com/jsplumb/jsplumb/blob/fb5fce52794fa52306825bdaa62bf3855cdfd7e0/src/connectors-flowchart.js
* https://github.com/jsplumb/jsplumb/blob/fb5fce52794fa52306825bdaa62bf3855cdfd7e0/src/connectors-bezier.js
*
* Dual licensed under the MIT and GPL2 licenses.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for legal reasons, checking with Jan on this

this.overrideTargetEndpoint = null;
};

this._compute = function (originalPaintInfo, params) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entry point for drawing connectors

@mutdmour mutdmour marked this pull request as ready for review November 16, 2021 12:56
Comment on lines +375 to +381
if (diffX < (-1 * loopbackMinimum)) {
// loop backward behavior
midy = paintInfo.startStubY - (diffX < 0 ? direction * loopbackVerticalLength : 0);
} else {
// original flowchart behavior
midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorcery by which loops happen

}
};

const lineCalculators = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed other types of flows... when endpoints are perpendicular or orthogonal... to avoid lots of dead code.. can add them back if needed

Copy link
Contributor

@BHesseldieck BHesseldieck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing work 🚀

just some smaller suggestions 😊

packages/editor-ui/src/components/NodeIcon.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/components/NodeIcon.vue Outdated Show resolved Hide resolved
packages/editor-ui/src/store.ts Outdated Show resolved Hide resolved
packages/editor-ui/src/views/canvasHelpers.ts Outdated Show resolved Hide resolved
@janober janober merged commit d8598b0 into master Nov 19, 2021
@janober janober deleted the n8n-2349-connectors branch November 19, 2021 09:17
@janober
Copy link
Member

janober commented Nov 19, 2021

Amazing work. Got merged. Thanks a lot!

@janober
Copy link
Member

janober commented Nov 19, 2021

Got released with n8n@0.150.0

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants