fix(Designer): Trigger deletion should also remove dependant tokens through the workflow #4788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily focuses on enhancing the token removal functionality in the workflow design process. The most significant changes include adding a new test case to verify token removal when a trigger is deleted, importing a new token type for deletion, and modifying the
deleteOperation
andremoveAllTokensFromNode
functions to handle trigger deletion.Key changes include:
Token Removal Test:
e2e/designer/tokenRemoval.spec.ts
: A new test case has been added to verify that tokens are correctly removed from parameters when a trigger is deleted. This ensures that any references to the deleted trigger are also removed, maintaining the integrity of the workflow.Token Type Import:
libs/designer/src/lib/core/actions/bjsworkflow/delete.ts
: TheisOutputToken
function has been imported, which is used to identify output tokens that need to be removed when a trigger is deleted.Function Modifications for Trigger Deletion:
libs/designer/src/lib/core/actions/bjsworkflow/delete.ts
: ThedeleteOperation
function has been modified to include a newisTrigger
parameter. This is used to determine if the operation being deleted is a trigger, which is necessary for the correct removal of associated tokens.libs/designer/src/lib/core/actions/bjsworkflow/delete.ts
: TheremoveAllTokensFromNode
function has been updated to handle trigger deletion. It now checks if the token being removed is an output token associated with a deleted trigger and removes it accordingly.