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

Allow updates of CompositeMenuNode properties (#12948) #13425

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

ndoschek
Copy link
Contributor

@ndoschek ndoschek commented Feb 27, 2024

What it does

This PR refines the updateOptions method in the CompositeMenuNode class.
Previously, the method would only update the properties if they were undefined to begin with (due to the the nullish coalescing operator). With the updated implementation, updateOptions now allows properties to be updated.
(Please also see my use case description in the linked issue description)

Allow updates of CompositeMenuNode properties

  • refactor updateOptions function to allow updates
  • add unit test cases for updateOptions

Fixes #12948

How to test

The change is covered by unit tests since there's no existing use case in the example application to demonstrate the updated behavior so far.
These tests confirm the method's functionality across various scenarios, including handling partial updates and dealing with undefined values.

Follow-ups

--

Review checklist

Reminder for reviewers

@ndoschek
Copy link
Contributor Author

Hi @JonasHelming, could you please suggest a reviewer for this PR? Thank you in advance!

Copy link
Contributor

@jonah-iden jonah-iden left a comment

Choose a reason for hiding this comment

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

Other than the on minor comment this looks god to me 👍

packages/core/src/common/menu/composite-menu-node.spec.ts Outdated Show resolved Hide resolved
- refactor updateOptions function to allow updates
- add unit test cases for updateOptions

Fixes eclipse-theia#12948
@ndoschek
Copy link
Contributor Author

Thank you for the swift review, @jonah-iden! I've updated the imports in the test file and revised my commit accordingly.

@jonah-iden jonah-iden merged commit 53ee5e3 into eclipse-theia:master Feb 28, 2024
12 of 14 checks passed
@ndoschek ndoschek deleted the issues/12948 branch February 28, 2024 15:05
@jfaltermeier jfaltermeier added this to the 1.47.0 milestone Feb 29, 2024
This was referenced Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Options of CompositeMenuNode are not actually updated in updateOptions
3 participants