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

Collapsed subprocess paste & undo bugfix #2275

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jarekdanielak
Copy link
Contributor

Problem

When a collapsed subprocess with children is pasted, the children are first created on the canvas root and then moved into the new subprocess.

When this action is undone, editor crashes because it attempts to move an element to the parent which is already removed from the canvas.

This seems to be a problem with order of operations - our subprocess implementation should first create all elements, then move them and undo those in the opposite order, but it seems to revert move action for some elements which parent was already removed (shape.create.revert).

Proposed solution

This pull request adds a test to cover this case (569ce9f) and proposes to move children into the new subprocess after all elements are created.

Unfortunately, this causes a problem with text annotations and labels which are not getting copied now.

Additional context

For more detailed debugging discussion see bpmn-io/diagram-js#957 (comment) and below.

Closes #2269

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@jarekdanielak jarekdanielak marked this pull request as draft January 17, 2025 20:03
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending in progress Currently worked on and removed needs review Review pending labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Currently worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy + Paste and then Undo Collapsed Sub process throws JS Errors
1 participant