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

[2.x] Restructure navigation item class design to use composition over inheritance #1626

Merged

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Mar 21, 2024

We have some quirks due to the inheritance so I started wondering if it made the most sense that GroupedNavigationItem extended NavigationItem. For example, the destination is only null for groups, so it makes little sense for the base class to have that. It also adds some conflicts with making the constructors and static create helpers compatible. Additionally, get getRoute and getUrl accessors don't make sense on the group class. Just because both classes can belong as children in a navigation menu I think they are different enough to have separate structures as they're responsibilities and usages are very different.

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.87%. Comparing base (9077622) to head (1709763).

Additional details and impacted files
@@                       Coverage Diff                        @@
##             improved-navigation-internals    #1626   +/-   ##
================================================================
  Coverage                            99.87%   99.87%           
- Complexity                            1780     1782    +2     
================================================================
  Files                                  184      184           
  Lines                                 4811     4815    +4     
================================================================
+ Hits                                  4805     4809    +4     
  Misses                                   6        6           

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

@caendesilva caendesilva force-pushed the restructure-navigation-item-oop-design branch from 9b085b1 to c67fc32 Compare March 21, 2024 19:26
@caendesilva caendesilva force-pushed the restructure-navigation-item-oop-design branch from db2fe7a to 03f6da0 Compare March 21, 2024 20:02
@caendesilva caendesilva force-pushed the restructure-navigation-item-oop-design branch from 03f6da0 to eff193b Compare March 21, 2024 20:02
@caendesilva caendesilva marked this pull request as ready for review March 22, 2024 12:27
@caendesilva caendesilva merged commit b4a02cd into improved-navigation-internals Mar 22, 2024
8 checks passed
@caendesilva caendesilva deleted the restructure-navigation-item-oop-design branch March 22, 2024 12:28
@caendesilva caendesilva mentioned this pull request Jun 27, 2024
99 tasks
@caendesilva caendesilva added this to the v2 milestone Jul 9, 2024
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.

1 participant