-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(editor): Add remove node and connections functionality to canvas v2 #9602
Conversation
packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue
Outdated
Show resolved
Hide resolved
packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue
Outdated
Show resolved
Hide resolved
packages/editor-ui/src/components/canvas/elements/nodes/CanvasNodeToolbar.vue
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice progress 🙌
Also left a few comments
/> | ||
<EdgeLabelRenderer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to have multiple template roots here? If yes, can we use fragments for this? Otherwise, we can just wrap them in a container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what we're doing here. There's no explicit syntax for fragments in Vue(like <>..</>
in React). It's just ESlint not "realizing" this is Vue 3 project. So, I wouldn't add another container as those would add up quickly for each edge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I thought we are not handling the props correctly or something and that's why eslint
is complaining. Does it make sense to turn off this rule for editor-ui
?
packages/editor-ui/src/components/canvas/elements/edges/CanvasEdge.vue
Outdated
Show resolved
Hide resolved
For me, new nodes are added outside of the viewport Screen.Recording.2024-06-04.at.11.36.05.mov |
It's a known issue: https://linear.app/n8n/issue/N8N-7400/compute-node-position-when-creating-new-nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback!
1 flaky test on run #5299 ↗︎
Details:
cypress/e2e/5-ndv.cy.ts • 1 flaky test
Review all test suite changes for PR #9602 ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
Summary
Adds remove node and connections functionality, toolbar and edge actions. Introduces
useCanvasOperations
for node and connection specific actions, to avoid code pollution in node view v2 component.Related to #9135
Related tickets and issues
https://linear.app/n8n/issue/N8N-7403/add-ability-to-delete-edge-via-delete-key
https://linear.app/n8n/issue/N8N-7402/add-ability-to-delete-node-via-delete-key
https://linear.app/n8n/issue/N8N-7387/add-edge-actions
https://linear.app/n8n/issue/N8N-7401/add-ability-to-delete-node-via-node-actions
Review / Merge checklist
(no-changelog)
otherwise. (conventions)