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-1385 - Create the Core CIF Components library pages - productcarousel component #271

Merged
merged 4 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ public void testProductCarouselModel() throws ServletException {
slingBindings.put("productSkuList", productSkuList);

ProductCarousel productCarouselModel = context.request().adaptTo(ProductCarousel.class);
Assert.assertEquals(3, productCarouselModel.getProducts().size());
Assert.assertEquals("24-MG01", productCarouselModel.getProducts().get(0).getSKU());
Assert.assertEquals(4, productCarouselModel.getProducts().size());
Assert.assertEquals("24-MB02", productCarouselModel.getProducts().get(0).getSKU());

// We make sure that all assets in the sample JSON response point to the DAM
for (ProductListItem product : productCarouselModel.getProducts()) {
Assert.assertTrue(product.getImageURL().startsWith(CIF_DAM_ROOT));
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"sling:resourceType": "core/cif/components/commerce/productlist/v1/productlist"
},
"productcarousel": {
"product": ["24-MG01", "WJ01", "MJ01"],
"product": ["24-MB02", "WJ04#WJ04-XS-Orange", "MH01", "MH01#MH01-XS-Orange"],
"sling:resourceType": "core/cif/components/commerce/productcarousel/v1/productcarousel"
},
"productteaser": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[cif-examples.base]"
embed="[venia-theme,core.cif.components.common,core.cif.components.product.v1,core.cif.components.productteaser.v1]"/>
embed="[venia-theme,core.cif.components.common,core.cif.components.product.v1,core.cif.components.productteaser.v1,core.cif.components.productcarousel.v1]"/>
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@

.cif-demo .productteaser .item__image {
border: none !important;
}

.cif-demo .productcarousel__container {
max-width: 50%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Product Carousel Component for the Core Components Library"
jcr:primaryType="cq:Component"
jcr:title="Product Carousel"
sling:resourceSuperType="core/cif/components/commerce/productcarousel/v1/productcarousel"
componentGroup="Core Components Examples"/>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@
width="12"/>
</cq:responsive>
</teaser_1837085917>
<teaser_1837085927
cq:styleIds="[1547060090076]"
jcr:primaryType="nt:unstructured"
jcr:title="Product Carousel"
sling:resourceType="core-components-examples/components/teaser"
actionsEnabled="false"
descriptionFromPage="true"
fileReference="/content/dam/core-components-examples/library/cif-components/productcarousel.svg"
linkURL="/content/core-components-examples/library/commerce/productcarousel"
textIsRich="true"
titleFromPage="false">
<cq:responsive jcr:primaryType="nt:unstructured">
<default
jcr:primaryType="nt:unstructured"
width="3"/>
<small
jcr:primaryType="nt:unstructured"
width="4"/>
<extrasmall
jcr:primaryType="nt:unstructured"
width="12"/>
</cq:responsive>
</teaser_1837085927>
</container_1589240807>
</responsivegrid>
</root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
redirectTarget="/content/core-components-examples/library"/>
<product/>
<productteaser/>
<productcarousel/>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Page">
<jcr:content
cq:lastModified="{Date}2020-05-13T10:39:13.015+02:00"
cq:lastModifiedBy="admin"
cq:tags="[]"
cq:template="/conf/core-components-examples/settings/wcm/templates/content-page"
jcr:description="Display commerce product carousel"
jcr:primaryType="cq:PageContent"
jcr:title="Product Carousel"
sling:resourceType="cif-components-examples/components/page">
<root
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/foundation/components/responsivegrid">
<responsivegrid
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/foundation/components/responsivegrid">
<text_1740702241
cq:styleIds="[1644862132301]"
jcr:created="{Date}2019-02-15T19:05:53.032+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2019-02-15T19:09:39.787+01:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/text/v2/text"
text="&lt;h1>Productcarousel&lt;sub>v1&lt;/sub>&lt;/h1>"
textIsRich="true"/>
<text
cq:styleIds="[1544762734201]"
jcr:created="{Date}2018-12-06T19:11:23.947+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2020-05-13T10:39:13.010+02:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/text/v2/text"
text="&lt;p>The Product Carousel component is a server-side component written in HTL, allowing to display a list of featured products in a carousel style. The products are retrieved from Magento via GraphQL. This component can be used on any experience page.&lt;/p>&#xa;&lt;p>Note: due to the limited amount of sample data available, the links to product pages will always display the same demo product.&lt;br>&#xa;&lt;/p>&#xa;"
textIsRich="true"/>
<teaser
cq:styleIds="[1550165685463]"
jcr:created="{Date}2019-02-14T16:41:54.952+01:00"
jcr:createdBy="admin"
jcr:description="&lt;p>GitHub&lt;/p>&#xd;&#xa;"
jcr:lastModified="{Date}2019-02-14T16:49:57.290+01:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Technical Documentation"
sling:resourceType="core-components-examples/components/teaser"
actionsEnabled="false"
descriptionFromPage="false"
fileReference="/content/dam/core-components-examples/library/github-logo.svg"
linkURL="https://github.com/adobe/aem-core-cif-components/tree/master/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcarousel/v1/productcarousel"
textIsRich="true"
titleFromPage="false"/>
<title_865328580
cq:styleIds="[1544759664489]"
jcr:created="{Date}2018-12-06T19:22:23.729+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2018-12-06T19:23:25.116+01:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Examples"
sling:resourceType="core/wcm/components/title/v2/title"
type="h2"/>
<title_290384408
cq:styleIds="[1544759676459]"
jcr:created="{Date}2018-12-06T19:22:48.620+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2019-05-22T11:01:40.926+03:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Standard"
sling:resourceType="core/wcm/components/title/v2/title"
type="h3"/>
<text_1337506761
jcr:created="{Date}2018-12-06T19:23:41.968+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2019-05-22T11:26:32.604+03:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/text/v2/text"
text="&lt;p>The component, simply displaying sample data.&lt;/p>"
textIsRich="true"/>
<demo
jcr:created="{Date}2018-12-07T12:55:03.496+01:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2018-12-07T12:55:03.496+01:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="cif-components-examples/components/demo">
<component
jcr:primaryType="nt:unstructured"
sling:resourceType="core-components-examples/components/demo/component">
<productcarousel
jcr:created="{Date}2020-05-11T14:27:49.051+02:00"
jcr:createdBy="admin"
jcr:lastModified="{Date}2020-05-11T15:34:00.026+02:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Summer promotions!"
sling:resourceType="cif-components-examples/components/productcarousel"
product="[24-MB02,WJ04#WJ04-XS-Orange,MH01,MH01#MH01-XS-Orange]"/>
</component>
<info
jcr:primaryType="nt:unstructured"
sling:resourceType="core-components-examples/components/tabs">
<properties
cq:panelTitle="Properties"
jcr:primaryType="nt:unstructured"
sling:resourceType="core-components-examples/components/demo/properties"
reference="../../component"/>
<markup
cq:panelTitle="Markup"
jcr:primaryType="nt:unstructured"
sling:resourceType="core-components-examples/components/demo/markup"
reference="../../component"/>
</info>
</demo>
</responsivegrid>
</root>
</jcr:content>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="sling:Folder">
<jcr:content
jcr:primaryType="nt:unstructured"
jcr:title="Fusion Backpack">
<folderThumbnail/>
</jcr:content>
</jcr:root>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
dam:folderThumbnailPaths="[/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/fusion-backpack/mb02-gray-0.jpg]"
jcr:primaryType="nt:unstructured"
bgcolor="{Long}-1"
height="{Long}240"
width="{Long}280"/>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dam="http://www.day.com/dam/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:mixinTypes="[mix:referenceable]"
jcr:primaryType="dam:Asset"
jcr:uuid="3884db01-a45e-4644-ab8e-875ee4a30290">
<jcr:content
dam:assetState="processed"
jcr:lastModified="{Date}2020-05-11T15:42:56.861+02:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="dam:AssetContent">
<metadata
dam:Bitsperpixel="{Long}24"
dam:Comments="CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 80&#xa;&#xa;"
dam:extracted="{Date}2020-05-11T15:42:56.378+02:00"
dam:Fileformat="JPEG"
dam:MIMEtype="image/jpeg"
dam:Numberofimages="{Long}1"
dam:Numberoftextualcomments="{Long}1"
dam:Physicalheightindpi="{Long}96"
dam:Physicalheightininches="{Decimal}13.958333015441895"
dam:Physicalwidthindpi="{Long}96"
dam:Physicalwidthininches="{Decimal}11.25"
dam:Progressive="yes"
dam:sha1="b73793e427991261f2444441c8f22173e9af1c67"
dam:size="{Long}113847"
dc:format="image/jpeg"
jcr:mixinTypes="[cq:Taggable]"
jcr:primaryType="nt:unstructured"
tiff:ImageLength="{Long}1340"
tiff:ImageWidth="{Long}1080"/>
<related jcr:primaryType="nt:unstructured"/>
</jcr:content>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="admin"
jcr:mimeType="image/jpeg"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="sling:Folder">
<jcr:content
jcr:primaryType="nt:unstructured"
jcr:title="Ingrid Running Jacket">
<folderThumbnail/>
</jcr:content>
</jcr:root>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
dam:folderThumbnailPaths="[/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/ingrid-running-jacket/wj04-orange_main_2.jpg,/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/ingrid-running-jacket/wj04-red_main_2.jpg,/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/ingrid-running-jacket/wj04-white_main_2.jpg]"
jcr:primaryType="nt:unstructured"
bgcolor="{Long}-1"
height="{Long}240"
width="{Long}280"/>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dam="http://www.day.com/dam/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:mixinTypes="[mix:referenceable]"
jcr:primaryType="dam:Asset"
jcr:uuid="40988709-cc57-4fc2-be14-ac215ee13c69">
<jcr:content
dam:assetState="processed"
jcr:lastModified="{Date}2020-05-11T15:43:12.415+02:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="dam:AssetContent">
<metadata
dam:Bitsperpixel="{Long}24"
dam:Comments="CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 80&#xa;&#xa;"
dam:extracted="{Date}2020-05-11T15:43:11.873+02:00"
dam:Fileformat="JPEG"
dam:MIMEtype="image/jpeg"
dam:Numberofimages="{Long}1"
dam:Numberoftextualcomments="{Long}1"
dam:Physicalheightindpi="{Long}96"
dam:Physicalheightininches="{Decimal}16.45833396911621"
dam:Physicalwidthindpi="{Long}96"
dam:Physicalwidthininches="{Decimal}13.270833015441895"
dam:Progressive="yes"
dam:sha1="2fb695a17b45280f33e9a00b286776ad516ca8a2"
dam:size="{Long}162098"
dc:format="image/jpeg"
jcr:mixinTypes="[cq:Taggable]"
jcr:primaryType="nt:unstructured"
tiff:ImageLength="{Long}1580"
tiff:ImageWidth="{Long}1274"/>
<related jcr:primaryType="nt:unstructured"/>
</jcr:content>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:file">
<jcr:content
jcr:lastModifiedBy="workflow-process-service"
jcr:primaryType="oak:Resource"/>
</jcr:root>
Binary file not shown.
Loading