NXT-4577: Allow bendpoint deletion during execution#175
NXT-4577: Allow bendpoint deletion during execution#175hornm-knime wants to merge 1 commit intomasterfrom
Conversation
NXT-4577 (Allow bendpoint deletion when connection cannot be deleted due to executing successors)
There was a problem hiding this comment.
Pull request overview
Enables deleting selected connection bendpoints even when the connection itself cannot be deleted (e.g., due to execution state), aligning delete behavior with the intent of NXT-4577.
Changes:
- Removes the
allowedActions.canDeletegate for deleting bendpoints indeleteSelectedObjects. - Always forwards selected
connectionBendpointsin the delete command payload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const deleteableBendpoints = Object.keys(connectionBendpoints).reduce( | ||
| (acc, connectionId) => { | ||
| const connection = this.activeWorkflow!.connections[connectionId]; | ||
| return connection.allowedActions?.canDelete | ||
| ? { | ||
| ...acc, | ||
| [connectionId]: connectionBendpoints[connectionId], | ||
| } | ||
| : acc; | ||
| return { | ||
| ...acc, | ||
| [connectionId]: connectionBendpoints[connectionId], | ||
| }; |
There was a problem hiding this comment.
This change alters deletion semantics by allowing bendpoints to be deleted even when the owning connection itself isn’t deletable. Please add/adjust a unit test to cover the case where a connection has allowedActions.canDelete === false but selected bendpoints are still sent in workflowCommand.Delete.connectionBendpoints.
| (acc, connectionId) => { | ||
| const connection = this.activeWorkflow!.connections[connectionId]; | ||
| return connection.allowedActions?.canDelete | ||
| ? { | ||
| ...acc, | ||
| [connectionId]: connectionBendpoints[connectionId], | ||
| } | ||
| : acc; | ||
| return { | ||
| ...acc, | ||
| [connectionId]: connectionBendpoints[connectionId], | ||
| }; |
There was a problem hiding this comment.
connection is declared but never used, and the this.activeWorkflow!.connections[connectionId] lookup is now only introducing an unnecessary non-null assertion / potential runtime throw. Remove the unused variable and avoid dereferencing activeWorkflow here (or explicitly skip entries where the connection no longer exists).
31a2194 to
92c95ec
Compare
|



NXT-4577 (Allow bendpoint deletion when connection cannot be deleted due to executing successors)