Conversation
Pipe and Kamelet resources inherit a no-op addNewEntity, so replacing on paste left a blank template. Apply the copied definition and rebuild child entities (beans, error handler, metadata).
…sue-3446-paste-pipe-kamelet * fix/issue-3446-paste-pipe-kamelet-upstream: fix(canvas): Apply pasted Pipe and Kamelet templates
The toJSON() method of KameletVisualEntity returns { route: RouteDefinition },
so the from property is nested under route, not at the top level.
Relates to KaotoIO#3838
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughPaste handling now passes raw definitions for single-entity resources. Kamelet and Pipe resources rebuild visual entities and metadata from pasted templates. Tests cover replacement content and removed nested entities. ChangesPaste entity replacement
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant usePasteEntity
participant KameletResource
participant PipeResource
participant VisualEntities
usePasteEntity->>KameletResource: addNewEntity(raw Kamelet definition)
KameletResource->>VisualEntities: rebuild flow and beans
KameletResource->>KameletResource: synchronize metadata
usePasteEntity->>PipeResource: addNewEntity(raw Pipe definition)
PipeResource->>VisualEntities: rebuild flow and error handler
PipeResource->>PipeResource: synchronize metadata
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Single-entity paste replacement now supplies the template shape expected by Kamelet and Pipe resources, with coverage for rebuilding and clearing replacement state. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit pastes templates with care Comment |
|
I have noticed a small bug in the implementation: when copied a pipe or a kamelet and pasted again, the product is correct but it appears hidden. Check this video (it appears only the pipe case but with kamelet is the same): Screen.Recording.2026-09-11.at.14.13.04.mov |



Fixes #3446
Fixes the TypeScript build error reported in #3838.
The test in
kamelet-resource.test.tsaccessed.fromdirectly on the result oftoJSON(), butKameletVisualEntity.toJSON()returns{ route: RouteDefinition }— sofromis nested underroute.Fix:
This is a companion fix to #3838 by @ThomasHartDev.
Summary by CodeRabbit