Skip to content
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
merged 8 commits into from
Jun 13, 2024

Conversation

ccastrotrejo
Copy link
Contributor

This pull request primarily focuses on improving the handling of token dependencies in the libs/designer/src/lib/core/state/operation/operationSelector.ts and libs/designer/src/lib/ui/connections/dropzone.tsx files. The most significant changes include adding a new function useTokenNodesDependencies to manage dependencies of token nodes, and updating the DropZone 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 from operationSelector.ts.

  • The DropZone component was updated to use useTokenNodesDependencies 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's useDrop hook were updated to include upstreamNodesDependencies.

Fixes #3012

Screen.Recording.2024-06-12.at.2.35.55.PM.mov

@ccastrotrejo ccastrotrejo marked this pull request as ready for review June 13, 2024 00:10
@ccastrotrejo ccastrotrejo enabled auto-merge (squash) June 13, 2024 16:34
@ccastrotrejo ccastrotrejo merged commit a29916d into main Jun 13, 2024
12 checks passed
@ccastrotrejo ccastrotrejo deleted the ccastrotrejo/preventParent branch June 13, 2024 17:14
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
ccastrotrejo added a commit that referenced this pull request Jun 27, 2024
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
ccastrotrejo added a commit that referenced this pull request Jul 1, 2024
…dragged below dependent node (#4973)" (#5053)

Revert "fix(designer): Prevent parent node from being dragged below dependent node (#4973)"

This reverts commit a29916d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent parent node from being dragged below dependent node
2 participants