-
Notifications
You must be signed in to change notification settings - Fork 29
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(Canvas): Improve add steps into canvas #1673
Conversation
f90dd63
to
d376281
Compare
b4e1fd0
to
8cf7b33
Compare
8cf7b33
to
e911ad6
Compare
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.
tested only functionality on web browser and it works as expected
Currently, we have 3 alternative mechanisms for adding new steps in the canvas: 1. Right click on a node and select between `Prepend`, `Append`, and `Insert`. 2. Use the Step Toolbar to `Insert` 3. Use the quick add edge. This commit replaces the quick add edge with a floating button over the last element of the route. In addition to that, it generates a placeholder when the steps property is empty, so the user can quickly add a new step to initialize the branch.
e911ad6
to
1735e95
Compare
@@ -141,7 +141,7 @@ export abstract class AbstractCamelVisualEntity<T extends object> implements Bas | |||
/** If we're in Replace mode, we need to delete the existing step */ | |||
const deleteCount = options.mode === AddStepMode.ReplaceStep ? 1 : 0; | |||
|
|||
const stepsArray: ProcessorDefinition[] = getValue(this.entityDef, pathArray.slice(0, -2), []); |
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.
This was the root cause of the bug preventing adding steps in EIPs with steps: undefined
, like multicast
or filter
.
The problem was that for array properties (like steps
) that don't exist by default, for instance, when adding a multicast
, aggregate
or filter
, Kaoto doesn't offer a template with the steps
property already created, the code creates a new array but it doesn't assign it to the object, therefore, the step gets assigned to a newly created array completely detached from the Camel Route structure.
The fix is to use the getArrayProperty
which ensures the requested array, regardless of whether it exists or not, is properly attached to the structure.
Since the StepToolbar `+` button was removed in favor of using a placeholder node or the `arrow` icon, we no longer need to disable the node interactions for parallel EIPs like `multicast` and loadBalance`
Quality Gate passedIssues Measures |
Context
Currently, we have 3 alternative mechanisms for adding new steps in the canvas:
Prepend
,Append
, andInsert
.Insert
Changes
This commit replaces the quick add edge with a floating button over the last element of the route. In addition to that, it generates a placeholder when the steps property is empty, so the user can quickly add a new step to initialize the branch.
Notes
fix: #1648
fix: #1647
fix: #1072