-
-
Notifications
You must be signed in to change notification settings - Fork 6
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] Rename NavItem fields to normalize its API #1600
Merged
caendesilva
merged 5 commits into
improved-navigation-internals
from
rename-navitem-fields
Mar 1, 2024
Merged
[2.x] Rename NavItem fields to normalize its API #1600
caendesilva
merged 5 commits into
improved-navigation-internals
from
rename-navitem-fields
Mar 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caendesilva
force-pushed
the
rename-navitem-fields
branch
from
March 1, 2024 14:03
f5ffe93
to
cfea2e0
Compare
caendesilva
force-pushed
the
rename-navitem-fields
branch
from
March 1, 2024 14:05
cfea2e0
to
e6c8cc2
Compare
Since the destination property in v2 is normalized to always be a route it no longer makes sense to have a divergent name for it.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## improved-navigation-internals #1600 +/- ##
================================================================
Coverage 99.95% 99.95%
Complexity 1775 1775
================================================================
Files 183 183
Lines 4801 4801
================================================================
Hits 4799 4799
Misses 2 2 ☔ View full report in Codecov by Sentry. |
While the method is implemented by using the `currentRoute` helper, the actual end usage is to compare active state, so it makes more sense for this to use that in the name. - `isActive()` is more common and may be more intuitive to other developers, as it explicitly suggests that the method is checking if the item is active. - `isCurrent()` is also clear, but it might be slightly less common in this context. It still conveys the intended meaning effectively.
Renames `getGroup()` to `getGroupIdentifier()` to clarify the purpose of the method.
Renames `getLink()` to `getUrl()` for clarity on what the method returns.
caendesilva
force-pushed
the
rename-navitem-fields
branch
from
March 1, 2024 16:02
9a2bc51
to
f17a412
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Makes some breaking changes to the NavItem class.
Rename protected
$destination
property to$route
Breaking: Rename
NavItem
methodgetDestination
togetRoute
Since the destination property in v2 is normalized to always be a route it no longer makes sense to have a divergent name for it.
Breaking: Rename
NavItem
methodisCurrent
toisActive
While the method is implemented by using the
currentRoute
helper, the actual end usage is to compare active state, so it makes more sense for this to use that in the name.Breaking: Rename
NavItem
methodgetGroup
togetGroupIdentifier
Renames
getGroup()
togetGroupIdentifier()
to clarify the purpose of the method.Breaking: Rename
NavItem
methodgetLink
togetUrl
Renames
getLink()
togetUrl()
for clarity on what the method returns.