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(canvas): remove all planes on diagram.clear #569

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Conversation

marstamm
Copy link
Contributor

@marstamm marstamm commented Sep 15, 2021

What is the problem?

Fix
on diagram.clear:

  • Remove all planes
  • Reset active Plane

@marstamm marstamm requested a review from a team September 15, 2021 13:40
@marstamm marstamm self-assigned this Sep 15, 2021
@marstamm marstamm requested review from smbea and MaxTru and removed request for a team September 15, 2021 13:40
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Sep 15, 2021
test/spec/core/CanvasSpec.js Outdated Show resolved Hide resolved
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

One small finding, looks good other than that.

@nikku
Copy link
Member

nikku commented Sep 16, 2021

One thing I'm asking myself: Why did our re-import tests in bpmn-js not catch the issue? Or don't we test that particular scenario?

If we don't I'd ask you to create an integration test in bpmn-js that does cover this scenario.

@nikku nikku merged commit 51636fe into develop Sep 16, 2021
@nikku nikku deleted the clear-remove-planes branch September 16, 2021 08:31
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Sep 16, 2021
@marstamm
Copy link
Contributor Author

The import and clearing/reimport works when we only use the default plane.
However, accessing the root element in the period between clear and reimport, we already had an active plane and therefore did not create a new root element, which lead to problems. Now we create a new plane with an implicit root, which is the same behavior as a clean canvas

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.

2 participants