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

[NodeBundle] Allow NodeMenuItem to be extended #2677

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

Conversation

mwoynarski
Copy link
Contributor

@mwoynarski mwoynarski commented May 14, 2020

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets

Altered the NodeMenu helper to instantiate new NodeMenuItems using a protected method so NodeMenuItem can be replaced or extended without the developer being forced to override every method in NodeMenu that creates a new instance.

Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

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

Hi @, your PR needs some changes

  • It seems that our checklist is missing or incomplete
  • your PR title should look like [SomeBundle] Fixed some code

@mwoynarski mwoynarski force-pushed the patch-1 branch 3 times, most recently from 189506a to eb1f035 Compare May 14, 2020 21:46
@mwoynarski mwoynarski changed the title Allow NodeMenuItem to be extended [NodeBundle] Allow NodeMenuItem to be extended May 14, 2020
@ProfessorKuma ProfessorKuma added this to the 5.6.0 milestone May 15, 2020
Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

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

Hi @, your PR needs some changes

  • This PR seems to need a milestone of a minor release.

Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

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

Hi @, your PR passed all our requirements.

Thank you for contributing!

@acrobat acrobat self-requested a review May 29, 2020 09:02
@acrobat acrobat modified the milestones: 5.6.0, 5.7.0 Jun 25, 2020
@acrobat acrobat modified the milestones: 5.7.0, 5.8.0 Oct 12, 2020
@acrobat acrobat modified the milestones: 5.8.0, 5.9.0 Mar 17, 2021
@acrobat acrobat modified the milestones: 5.9.0, 5.10.0 Oct 10, 2021
Copy link
Member

@acrobat acrobat left a comment

Choose a reason for hiding this comment

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

What would be the usecase to extend the node menu? What "feature" is missing or part need to be extendable?

@acrobat acrobat removed this from the 5.10.0 milestone Oct 12, 2021
@mwoynarski
Copy link
Contributor Author

mwoynarski commented Oct 12, 2021

It's less about making NodeMenu extensible as it is making NodeMenuItem extensible.

A year and a half on, I don't recall all the intricacies of the problem, but the basic issue was that I had needed to alter the behaviour of the getChildren() method of NodeMenuItem to incorporate something from the PagesConfiguration service, but it isn't possible to replace the NodeMenuItem class without replacing the entirety of the NodeMenu helper due to all of the individual calls to new NodeMenuItem(). Converting NodeMenuItem to an interface and refactoring NodeMenu to offer a method for creating new menu items allows a developer to utilize their own replacement for NodeMenuItem by extending NodeMenu and overriding only the createMenuItem() method, rather than having to duplicate the entire class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants