-
Notifications
You must be signed in to change notification settings - Fork 84
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
fix(designer): Prevent parent node from being dragged below dependent node #4973
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hartra344
approved these changes
Jun 13, 2024
…trotrejo/preventParent
ccastrotrejo
added a commit
that referenced
this pull request
Jun 28, 2024
… node (#4973) * Add custom hook to check for upstream token dependency * Update custom hook name * Update token dependency if is an array * Add initial unit tests * Add more unit test * Remove unused imports
ccastrotrejo
added a commit
that referenced
this pull request
Jul 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 improving the handling of token dependencies in the
libs/designer/src/lib/core/state/operation/operationSelector.ts
andlibs/designer/src/lib/ui/connections/dropzone.tsx
files. The most significant changes include adding a new functionuseTokenNodesDependencies
to manage dependencies of token nodes, and updating theDropZone
component to use this function.A new function
useTokenNodesDependencies
was added. This function takes a set of nodes as input and returns a record of dependencies for each node. Each node's dependencies are represented as a set of action names that are extracted from the node's operation input parameters. If a node does not have any operation input parameters, an empty set is returned for that node.The
useTokenNodesDependencies
function was imported fromoperationSelector.ts
.The
DropZone
component was updated to useuseTokenNodesDependencies
to get the dependencies of all upstream nodes.The
DropZone
component's drop condition was updated to prevent dropping if the item being dropped is a dependency of any upstream node.The dependencies of the
DropZone
component'suseDrop
hook were updated to includeupstreamNodesDependencies
.Fixes #3012
Screen.Recording.2024-06-12.at.2.35.55.PM.mov