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

[Issue #2526] Lazy evaluate navigation sub-items on demand #2527

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

Conversation

ky940819
Copy link
Contributor

Q                       A
Fixed Issues? Fixes #2526
Patch: Bug Fix? No
Minor: New Feature? No
Major: Breaking Change? No
Tests Added + Pass? Yes
Documentation Provided No
Any Dependency Changes? No
License Apache License, Version 2.0

Changes Navigation and NavigationItem Sling models so that the children are passed as a Supplier instead of the List.

This means that a full traversal and evaluation of the navigation tree does not need to be performed before the Navigation model returns the List<NavigationItem> to the caller. Evaluating deeper levels of the navigation structure will occur on demand if required.

Updates `NavigationItemImpl` constructor to accept a `Supplier` which
supplies a list of children instead of passing the list its self in
the constructor.

This allows the work of constructing a navigation sub-tree to be
deferred and only completed if the `NavigationItem#getChildren()`
method is called.

----
refs adobe#2526
Updates the V1 and V2 `NavigationImpl` models to pass a `Supplier` to
their respective `NavigationItemImpl` constructors.

Removes `Navigation#getExportedType()` because it is exactly the
same as the super method.

----
refs adobe#2526
Updates the breadcrumb model implementations by removing the `children` field
from `BreadcrumbItemImpl` constructor because it is always set to empty list (i.e.
breadcrumb items never have children).

The `BreadcrumbItemImpl` will now pass a `Supplier` which
supplies an empty list to the super class `NavigationItemImpl`.

Removes `BreadcrumbImpl#getExportedType()` because it is exactly the same
as the super method.

----
refs adobe#2526
…tructors

Updates the V1 and V2 `LanguageNavigationImpl` models to pass
a `Supplier` to their respective `LanguageNavigationItemImpl`
constructors

Fixes a possible NPE in `LanguageNavigationImpl` if
navigation root is not set in either properties or
policy.

Removes `LanguageNavigationImpl#getExportedType()` because it
is exactly the same as the method from the super class.

Update how titles are determined for language navigation items to
reuse the logic used for all other navigation items.

----
refs adobe#2526
@sonarcloud
Copy link

sonarcloud bot commented Jun 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Jun 11, 2023

Codecov Report

Attention: Patch coverage is 96.77419% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 87.21%. Comparing base (f861c90) to head (9d46011).
Report is 5 commits behind head on main.

Files Patch % Lines
...nts/internal/models/v1/LanguageNavigationImpl.java 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2527      +/-   ##
============================================
+ Coverage     87.18%   87.21%   +0.03%     
- Complexity     2669     2673       +4     
============================================
  Files           233      233              
  Lines          7124     7118       -6     
  Branches       1090     1086       -4     
============================================
- Hits           6211     6208       -3     
+ Misses          362      361       -1     
+ Partials        551      549       -2     

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

@sonarcloud
Copy link

sonarcloud bot commented Sep 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

sonarcloud bot commented Feb 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 28, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

[Navigation] Load navigation child items on demand
3 participants