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

feat: Add useUnmount hook #14382

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: Add useUnmount hook #14382

wants to merge 2 commits into from

Conversation

TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Jan 9, 2025

Description

This pull request adds a new hook named useUnmount to the @studio/hooks library. It calls a given function when the component unmounts, like componentDidUnmount in class components. It will be used in the process editor to clean up the BPMN modeler instance when the editor unmounts.

I have added the skip-manual-testing label since the hook is not yet in use, so there is no way to test it manually. Anyways, the unit tests should be sufficient for verifying that this function works as expected.

Related Issue

Verification

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

@github-actions github-actions bot added solution/studio/designer Issues related to the Altinn Studio Designer solution. frontend labels Jan 9, 2025
@TomasEng TomasEng added team/studio-domain1 skip-releasenotes Issues that do not make sense to list in our release notes skip-manual-testing PRs that do not need to be tested manually skip-documentation Issues where updating documentation is not relevant labels Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.58%. Comparing base (ffec39a) to head (d9614ea).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14382   +/-   ##
=======================================
  Coverage   95.58%   95.58%           
=======================================
  Files        1869     1870    +1     
  Lines       24237    24244    +7     
  Branches     2786     2786           
=======================================
+ Hits        23167    23174    +7     
  Misses        814      814           
  Partials      256      256           

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

@TomasEng TomasEng marked this pull request as ready for review January 9, 2025 08:45
@TomasEng TomasEng added quality/code Violations from current rules for code, best practices, etc. Or just bad code. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend quality/code Violations from current rules for code, best practices, etc. Or just bad code. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. skip-documentation Issues where updating documentation is not relevant skip-manual-testing PRs that do not need to be tested manually skip-releasenotes Issues that do not make sense to list in our release notes solution/studio/designer Issues related to the Altinn Studio Designer solution. team/studio-domain1
Projects
Status: 🔎 Review
Development

Successfully merging this pull request may close these issues.

1 participant