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

CIF-1609 - Lazy Loading for PLP #406

Merged
merged 12 commits into from
Sep 28, 2020
Merged

CIF-1609 - Lazy Loading for PLP #406

merged 12 commits into from
Sep 28, 2020

Conversation

cjelger
Copy link
Contributor

@cjelger cjelger commented Sep 24, 2020

This PR adds lazy loading to the category and search pages vis the productcollection component. The pages are still rendered on the server, and are requested with a "load more" button and then appended to the display by some JS code.

See the screenshots: configuring the component to lazy-load adds a "Load more" button, clicking it displays a loading spinner until the next page is loaded.

The css changes are in adobe/aem-cif-guides-venia#61

How Has This Been Tested?

Extended unit tests and tested manually.

Screenshots (if appropriate):

Screenshot 2020-09-24 at 10 27 00

Screenshot 2020-09-24 at 10 34 52

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

- implement lazy loading for productcollection component
- add design dialog option to choose pagination type
- enable lazy loading for search results component
- display/hide loading spinner when loading more products
- add client-side fetching of lazy loaded products
- update README files
@codecov
Copy link

codecov bot commented Sep 24, 2020

Codecov Report

Merging #406 into master will increase coverage by 0.05%.
The diff coverage is 93.93%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #406      +/-   ##
============================================
+ Coverage     86.06%   86.11%   +0.05%     
- Complexity      947      950       +3     
============================================
  Files           188      188              
  Lines          4886     4918      +32     
  Branches        696      697       +1     
============================================
+ Hits           4205     4235      +30     
- Misses          539      541       +2     
  Partials        142      142              
Flag Coverage Δ Complexity Δ
#integration 67.29% <80.00%> (+0.01%) 691.00 <1.00> (+2.00)
#jest 81.55% <ø> (ø) 0.00 <ø> (ø)
#karma 94.24% <92.85%> (-0.08%) 0.00 <0.00> (ø)
#unittests 86.29% <100.00%> (+0.05%) 919.00 <2.00> (+4.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...oductcollection/clientlibs/js/productcollection.js 91.56% <92.85%> (+0.65%) 0.00 <0.00> (ø)
...ls/v1/productcollection/ProductCollectionImpl.java 96.29% <100.00%> (+0.29%) 14.00 <1.00> (+1.00)
.../components/internal/services/UrlProviderImpl.java 86.66% <100.00%> (+0.22%) 22.00 <0.00> (+1.00)
...ommerce/core/search/internal/models/PagerImpl.java 94.59% <100.00%> (+0.15%) 20.00 <1.00> (+1.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cae2fc8...9f6e773. Read the comment docs.

- make sure the 'lazy' selector is not added multiple times
@cjelger cjelger added the enhancement New feature or request label Sep 24, 2020
@herzog31 herzog31 merged commit 7b33d20 into master Sep 28, 2020
@herzog31 herzog31 deleted the CIF-1609 branch September 28, 2020 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request verified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants