adobe / aem-core-cif-components

A set of configurations and components to get you started with AEM Commerce development
Apache License 2.0
103 stars 80 forks source link

CIF-2885: Allow the product details component to render sections selectively #919

Closed laurentiumagureanu closed 2 years ago

laurentiumagureanu commented 2 years ago

Description

Allow the product details component to render sections selectively

Related Issue

CIF-2885

Motivation and Context

Allow the product details component to render sections selectively

How Has This Been Tested?

Unit tests

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 2 years ago

Codecov Report

Merging #919 (5174797) into master (ede79c0) will increase coverage by 0.28%. The diff coverage is 97.29%.

@@             Coverage Diff              @@
##             master     #919      +/-   ##
============================================
+ Coverage     89.43%   89.71%   +0.28%     
- Complexity     2013     2016       +3     
============================================
  Files           333      338       +5     
  Lines          8927     9260     +333     
  Branches       1316     1316              
============================================
+ Hits           7984     8308     +324     
- Misses          670      679       +9     
  Partials        273      273              
Flag Coverage Δ
integration 52.80% <54.16%> (+0.51%) :arrow_up:
jest 86.38% <ø> (ø)
karma 95.68% <97.08%> (+0.41%) :arrow_up:
unittests 88.81% <100.00%> (+0.05%) :arrow_up:

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

Impacted Files Coverage Δ
...onents/internal/models/v1/product/ProductImpl.java 86.15% <ø> (ø)
...ommerce/product/v3/product/clientlib/js/gallery.js 96.10% <96.10%> (ø)
...e/product/v3/product/clientlib/js/addToWishlist.js 96.42% <96.42%> (ø)
...merce/product/v3/product/clientlib/js/addToCart.js 96.82% <96.82%> (ø)
...ommerce/product/v3/product/clientlib/js/product.js 97.40% <97.40%> (ø)
...product/v3/product/clientlib/js/variantSelector.js 98.43% <98.43%> (ø)
...onents/internal/models/v3/product/ProductImpl.java 94.11% <100.00%> (+2.01%) :arrow_up:
...mmerce/core/components/models/product/Product.java 92.85% <100.00%> (+26.19%) :arrow_up:

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 ede79c0...5174797. Read the comment docs.

LSantha commented 2 years ago

Observations:

buuhuu commented 2 years ago

here or later we may consider shaping the GQL query according to the configuration, at least the bigger parts like variants, images, description

We may have multiple product details components on a page (one with the variants, one with the price somewhere else) and if we have different queries per visible section per component we may execute unnecessary queries. We could however aggregate all the visible sections of all product components on a page to define a single query. This may addd complexity / affect performance.