-
Notifications
You must be signed in to change notification settings - Fork 52
feat(Canvas): Drag and drop support on Edges #2808
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2808 +/- ##
==========================================
+ Coverage 86.80% 87.08% +0.28%
==========================================
Files 523 524 +1
Lines 17941 17984 +43
Branches 4037 4045 +8
==========================================
+ Hits 15573 15662 +89
+ Misses 2364 2319 -45
+ Partials 4 3 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d127013 to
4e32174
Compare
c84a531 to
1cd9f5e
Compare
lordrip
left a comment
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.
Code-wise looks good, just pending fixing a situation where 2 edges are highlighted when dragging over a node.
packages/ui/src/components/Visualization/Canvas/StepToolbar/StepToolbar.tsx
Outdated
Show resolved
Hide resolved
packages/ui/src/components/Visualization/Canvas/StepToolbar/StepToolbar.tsx
Outdated
Show resolved
Hide resolved
packages/ui/src/components/Visualization/Custom/Edge/CustomEdge.tsx
Outdated
Show resolved
Hide resolved
|
|
||
| /** from nod eand choice group */ | ||
| expect(vizNode.getChildren()).toHaveLength(2); | ||
| /** from node and choice group */ |
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.
Good catch 🙆♂️
| }, [] as IVisualizationNode[]); | ||
|
|
||
| /** Empty steps branch placeholder */ | ||
| if (branchVizNodes.length === 0) { |
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.
Food for thought:
There was a recent PR to use an additional visualization controller to render the graph before exporting. Considering we are gonna show placeholders always, seems necessary to implement a way to conditionally enable this placeholder rendering, this way, we can skip rendering them when exporting the image.
900479b to
746bbd6
Compare
lordrip
left a comment
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.
I think we're almost done, just a matter of covering the missing component and to think about what to do about showing the placeholder after a kamelet:sink and stop nodes.
packages/ui/src/components/Visualization/Custom/Node/CustomNode.tsx
Outdated
Show resolved
Hide resolved
|
@shivamG640 I think this is a great feature, I tested it myself and it feel way more intuitive to drop over the edges, and in combination with the placeholders, make the whole experience simpler, good job 💪 (Definitively worth a blog post 😄) Afterthoughts: I notice that for the most part, codecov complains about we lacking coverage for the drag and drop related functions. The problem is that we can't extract those functions right away because they need elements from the context, so I think we could use the "currying" technique here. Here's what I'm thinking, one of the functions use export const curriedDnDFn = (element: ElementTypeHere) => EXISTING_DND_FUNCTION_GOES_HEREThis way, we can pass a mock element and carry it inside of the function to test it. |
lordrip
left a comment
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.
I don't see a reasonable way to increase the coverage through unit tests for the CustomNode component, we can move this coverage to e2e instead.
|



Fixes: #2770
Changes introduced:
Above changes can be tested here: https://shivamg640.github.io/kaoto/