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-2827: Placeholder XF in product list component #930

Merged
merged 34 commits into from
Jul 18, 2022
Merged

Conversation

laurentiumagureanu
Copy link
Collaborator

Description

be able to insert an XF into the product list component to show content between products

Related Issue

CIF-2827

Motivation and Context

be able to insert an XF into the product list component to show content between products

How Has This Been Tested?

Unit tests.
Manually

Screenshots (if appropriate):

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:

  • I have signed the Adobe Open Source CLA.
  • 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.

@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #930 (962f798) into master (daa88fa) will decrease coverage by 0.13%.
The diff coverage is 76.73%.

@@             Coverage Diff              @@
##             master     #930      +/-   ##
============================================
- Coverage     89.71%   89.57%   -0.14%     
- Complexity     2154     2172      +18     
============================================
  Files           347      352       +5     
  Lines          9673     9764      +91     
  Branches       1394     1405      +11     
============================================
+ Hits           8678     8746      +68     
- Misses          713      727      +14     
- Partials        282      291       +9     
Flag Coverage Δ
integration 51.62% <27.50%> (-0.67%) ⬇️
jest 86.55% <ø> (ø)
karma 95.33% <100.00%> (+<0.01%) ⬆️
unittests 88.44% <73.00%> (-0.35%) ⬇️

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

Impacted Files Coverage Δ
...ore/components/models/productlist/ProductList.java 50.00% <0.00%> (-50.00%) ⬇️
...ommerce/core/examples/servlets/GraphqlServlet.java 88.65% <0.00%> (-2.83%) ⬇️
...ents/CommerceExperienceFragmentsRetrieverImpl.java 65.38% <65.38%> (ø)
...servlets/ProductListXfStylesDataSourceServlet.java 70.00% <70.00%> (ø)
...nternal/servlets/AbstractProductListXfServlet.java 83.33% <83.33%> (ø)
...nternal/models/v1/productlist/ProductListImpl.java 92.20% <96.22%> (+1.00%) ⬆️
...gment/CommerceExperienceFragmentContainerImpl.java 100.00% <100.00%> (ø)
...riencefragment/CommerceExperienceFragmentImpl.java 90.90% <100.00%> (+15.41%) ⬆️
...ets/ProductListXfStylesRenderConditionServlet.java 100.00% <100.00%> (ø)
...oductcollection/clientlibs/js/productcollection.js 89.85% <100.00%> (+0.14%) ⬆️

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 daa88fa...962f798. Read the comment docs.

@LSantha
Copy link
Collaborator

LSantha commented Jun 28, 2022

We may need an update for the readme and the examples project to show the cool new feature.

@herzog31 herzog31 added the feature New feature or request label Jul 7, 2022
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.

LGTM

public class ProductListImpl extends ProductCollectionImpl implements ProductList {

public static final String RESOURCE_TYPE = "core/cif/components/commerce/productlist/v1/productlist";
protected static final String PLACEHOLDER_DATA = "productlist-component-placeholder-data.json";
protected static final String PN_FRAGMENT_LOCATION = "fragmentLocation";
protected static final String PN_FRAGMENT_CSS_CLASS = "fragmentCssClass";

Copy link
Collaborator

Choose a reason for hiding this comment

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

These PN_-s would better be public like ProductList.PN_SHOW_IMAGE and NN_FRAGMENTS.

@laurentiumagureanu laurentiumagureanu requested review from LSantha and buuhuu and removed request for buuhuu July 8, 2022 14:20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<template data-sly-template.item="${@ item}">
<span class="${'productcollection__item-xf {0}' @ format=[item.cssClassName], context='text'}">
<sly data-sly-resource="${item.renderResource}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

We should include the resource with wcmmode disable. Currently the synthetic resource gets an edit overlay.

composite="{Boolean}true"
fieldDescription="Allows insertion of Experience Fragments at specified positions"
fieldLabel="Experince Fragment placeholders">
<field
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you miss the render condition here?

@buuhuu buuhuu merged commit 78f1845 into master Jul 18, 2022
@buuhuu buuhuu deleted the issue/CIF-2827 branch July 18, 2022 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants