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

create new modeler instance always, but only call getModeler once in useBpmnEditor hook #12685

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

standeren
Copy link
Contributor

@standeren standeren commented Apr 19, 2024

Description

  • Remove singleton modeler instance usage to avoid mismatch in container property and canvasRef when switching tabs in Studio
  • Make sure only fetching modeler instance once from useBpmnEditor hook to avoid attaching multiple instances in the same canvas
  • Get the corresponding layoutSetId connected to the task when deleting a task with the deleteLayoutSet endpoint

This PR fixes an issue with getting an empty canvas in process-editor when moving between tabs

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

@github-actions github-actions bot added area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Apr 19, 2024
@standeren standeren force-pushed the create-new-modeler-instance-when-canvas-ref-changes branch from c4e3e1c to 02d2f15 Compare April 19, 2024 10:17
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 90.17%. Comparing base (43a6c92) to head (02d2f15).

Files Patch % Lines
...packages/process-editor/src/hooks/useBpmnEditor.ts 92.85% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12685   +/-   ##
=======================================
  Coverage   90.17%   90.17%           
=======================================
  Files        1296     1296           
  Lines       18557    18557           
  Branches     2261     2261           
=======================================
  Hits        16733    16733           
  Misses       1564     1564           
  Partials      260      260           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@nkylstad nkylstad left a comment

Choose a reason for hiding this comment

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

Nice job! I tested this locally as well, with adding and removing some tasks and navigating back and forth. Seems to work as expected!

@standeren standeren merged commit beed659 into main Apr 19, 2024
10 checks passed
@standeren standeren deleted the create-new-modeler-instance-when-canvas-ref-changes branch April 19, 2024 10:41
Jondyr pushed a commit that referenced this pull request Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants