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-1469 - CIF Core Components support for staged catalog data #399

Merged
merged 8 commits into from
Sep 22, 2020

Conversation

cjelger
Copy link
Contributor

@cjelger cjelger commented Sep 16, 2020

This PR adds the support for staged catalog data for Magento and AEM Launches. If the current page is inside an AEM Launch, a Preview-Version HTTP header will be sent with all GraphQL requests. The "epoch" value of the header is taken from the live date of the AEM Launch.

This also requires that a Magento integration token (with permission "Catalog > Staging") must be configured as an Authorization:Bearer <token> HTTP header in the GraphQL client.

Also important: I adapted the navigation and breadcrumb components so they use the "production version" of the current page to get their configuration, an also adapted the SiteNavigation class to make sure that it creates the "correct" links for the product and category pages. Here "correct" means that if the Launch includes the product and/or category page(s), then the links should point to the pages from the Launch and not to production pages.

How Has This Been Tested?

Extended unit tests and extensively tested manually.

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.

- added support for AEM Launches in magento client
- adapted components and unit tests to support launches
- adapted navigation and breadcrumb components to work with Launches
- extended site navigation methods to find product, category, and search pages in Launches
- extended unit tests for the site navigation with Launches
- ensures that product and category specific pages are properly detected in breadcrumb on launch pages
- extended unit tests
@codecov
Copy link

codecov bot commented Sep 16, 2020

Codecov Report

Merging #399 into master will decrease coverage by 2.69%.
The diff coverage is 38.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #399      +/-   ##
============================================
- Coverage     76.11%   73.41%   -2.70%     
+ Complexity      698      697       -1     
============================================
  Files           186      176      -10     
  Lines          4789     4315     -474     
  Branches        669      681      +12     
============================================
- Hits           3645     3168     -477     
+ Misses          931      927       -4     
- Partials        213      220       +7     
Flag Coverage Δ Complexity Δ
#integration 67.41% <38.33%> (-0.79%) 687.00 <10.00> (-1.00)
#jest 80.85% <ø> (ø) 0.00 <ø> (ø)
#karma ? ?
#unittests 93.15% <ø> (ø) 40.00 <ø> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...e/core/components/client/MagentoGraphqlClient.java 34.32% <22.22%> (-9.91%) 4.00 <0.00> (-2.00)
...commerce/core/components/utils/SiteNavigation.java 23.72% <23.07%> (-6.28%) 8.00 <2.00> (+1.00) ⬇️
.../internal/models/v1/breadcrumb/BreadcrumbImpl.java 80.80% <66.66%> (+0.39%) 25.00 <8.00> (ø)
...dels/v1/categorylist/FeaturedCategoryListImpl.java 64.70% <100.00%> (ø) 7.00 <0.00> (ø)
.../internal/models/v1/navigation/NavigationImpl.java 69.53% <100.00%> (+0.23%) 18.00 <0.00> (ø)
...onents/internal/models/v1/product/ProductImpl.java 73.94% <100.00%> (ø) 41.00 <0.00> (ø)
...models/v1/productcarousel/ProductCarouselImpl.java 58.92% <100.00%> (ø) 13.00 <0.00> (ø)
...nternal/models/v1/productlist/ProductListImpl.java 91.17% <100.00%> (ø) 23.00 <0.00> (ø)
...nal/models/v1/productteaser/ProductTeaserImpl.java 48.00% <100.00%> (ø) 9.00 <0.00> (ø)
...models/v1/relatedproducts/RelatedProductsImpl.java 57.77% <100.00%> (ø) 7.00 <0.00> (ø)
... and 10 more

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 cf6f5e9...d2173ab. Read the comment docs.

@cjelger cjelger added the feature New feature or request label Sep 16, 2020
Copy link
Member

@herzog31 herzog31 left a comment

Choose a reason for hiding this comment

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

Looks good. What about the client-side code?

@cjelger
Copy link
Contributor Author

cjelger commented Sep 17, 2020

@herzog31 Good point, I'll create a follow-up issue for that and add it for technical grooming.

@herzog31 herzog31 merged commit 4e2b51e into master Sep 22, 2020
@herzog31 herzog31 deleted the CIF-1469 branch September 22, 2020 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request verified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants