Skip to content

Fixed drop of ObjectFlow, ControlFlow, Pin; Fixed autolayout #3479

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

Merged
merged 12 commits into from
Sep 27, 2024

Conversation

pbrown12303
Copy link
Contributor

@pbrown12303 pbrown12303 commented Sep 6, 2024

As reported in Issue #3477 dropping an existing ObjectFlow or ControlFlow onto an activity diagram does not automatically connect the flows to the end-point elements in the diagram. This change fixes that problem.

As reported in issue #3481, dropping a Pin does not automatically connect it with its owning action.

As reported in issue #2126, autolayout inverts associations, control flows, and object flows.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Issue Number: #3477

What is the new behavior?

When a ControlFlow or ObjectFlow is dropped on the diagram the diagram item automatically connects to the head and tail items already in the diagram.

When a Pin is dropped on the diagram it is automatically connected to its owning action

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the python Pull requests that update Python code label Sep 6, 2024
@danyeaw
Copy link
Member

danyeaw commented Sep 19, 2024

Hi @pbrown12303, could you please help me understand that more, aren't you creating a new drop function and registering to be called when an item is dropped? What is the relationship between that and the DiagramItem properties?

… if ActionItem not present (Issue gaphor#3481)

This change ensures that pins can only be dropped on an activity diagram if their owning actions are displayed. It is worth noting that the following behaviors are still allowed based on the default editing rules in gaphor:
1. Multiple instances of a pin may be dropped onto a diagram. They will, however, all be attached to the owning action.
2. A new pin may be dropped on a diagram in a location that does not attach to an action. This pin will not appear in the tree until such time as it is moved to connect to  an action.
@pbrown12303 pbrown12303 changed the title Fixed drop of ObjectFlow and ControlFlow Fixed drop of ObjectFlow, ControlFlow, Pin Sep 19, 2024
@pbrown12303
Copy link
Contributor Author

Sorry Dan, that comment was about a different change request (too many parallel change requests). I removed those comments.

@pbrown12303
Copy link
Contributor Author

I tried combining the two types in the type hints for the register - it doesn't work.

@pbrown12303
Copy link
Contributor Author

pbrown12303 commented Sep 20, 2024

Figured out how to register the same function for two different types - you need to use two @drop.register calls. I think this is your requested change.

@pbrown12303 pbrown12303 changed the title Fixed drop of ObjectFlow, ControlFlow, Pin Fixed drop of ObjectFlow, ControlFlow, Pin; Fixed autolayout Sep 23, 2024
@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Sep 27, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pbrown12303, these changes look great, and thanks for the contribution! In the future, it would be better to create a branch off of main for each issue you are fixing and then open separate pull requests for each topic. It makes it easier to review if unrelated changes are separated.

@danyeaw
Copy link
Member

danyeaw commented Sep 27, 2024

@all-contributors please add @pbrown12303 for bug, code

Copy link
Contributor

@danyeaw

I've put up a pull request to add @pbrown12303! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants