-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CIF-1608 - Category Carousel Component (#417)
* CIF-1608 - Category Carousel Component * created generic carousel component * created category carousel component * adjusted product carousel and related products component to extend the generic carousel component * added unit tests * CIF-1608 - Category Carousel Component * updated examples project with category carousel * added integration test for category carousel * CIF-1608 - Category Carousel Component * fixed IT failure * CIF-1608 - Category Carousel Component * fixed category carousel component icon in the component palette of page editor * CIF-1608 - Category Carousel Component * fixed code after merge conflicts * CIF-1608 - Category Carousel Component * extracted card template in featured category list * CIF-1608 - Category Carousel Component * clarifications in generic carousel * CIF-1608 - Category Carousel Component * fixed issue with JS code duplication Co-authored-by: Alex Kim <69959652+alkim91@users.noreply.github.com>
- untagged-ebfe5a02a7165692c605
- untagged-c7bf8eeaf54dbc3c2634
- untagged-48bd3eb366ecb36ef377
- core-cif-components-reactor-2.15.2
- core-cif-components-reactor-2.15.0
- core-cif-components-reactor-2.14.2
- core-cif-components-reactor-2.14.0
- core-cif-components-reactor-2.13.2
- core-cif-components-reactor-2.13.0
- core-cif-components-reactor-2.12.6
- core-cif-components-reactor-2.12.4
- core-cif-components-reactor-2.12.2
- core-cif-components-reactor-2.12.0
- core-cif-components-reactor-2.11.0
- core-cif-components-reactor-2.10.0
- core-cif-components-reactor-2.9.0
- core-cif-components-reactor-2.8.0
- core-cif-components-reactor-2.7.2
- core-cif-components-reactor-2.7.0
- core-cif-components-reactor-2.6.0
- core-cif-components-reactor-2.5.0
- core-cif-components-reactor-2.4.2
- core-cif-components-reactor-2.4.0
- core-cif-components-reactor-2.3.1
- core-cif-components-reactor-2.3.0
- core-cif-components-reactor-2.2.0
- core-cif-components-reactor-2.1.0
- core-cif-components-reactor-2.0.0
- core-cif-components-reactor-1.12.0
- core-cif-components-reactor-1.11.0
- core-cif-components-reactor-1.10.0
- core-cif-components-reactor-1.9.0
- core-cif-components-reactor-1.8.0
- core-cif-components-reactor-1.7.0
- core-cif-components-reactor-1.6.0
- core-cif-components-reactor-1.5.0
Showing
43 changed files
with
1,027 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/src/main/content/jcr_root/apps/cif-components-examples/clientlibs/venia-theme/venia.css
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...in/content/jcr_root/apps/cif-components-examples/components/categorycarousel/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="Featured Categories Component for the CIF Components Library" | ||
jcr:primaryType="cq:Component" | ||
jcr:title="Category Carousel" | ||
sling:resourceSuperType="core/cif/components/commerce/categorycarousel/v1/categorycarousel" | ||
componentGroup="Core Components Examples"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
.../jcr_root/content/core-components-examples/library/commerce/categorycarousel/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<?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-10-14T12:05:03.012+02:00" | ||
cq:lastModifiedBy="admin" | ||
cq:tags="[]" | ||
cq:template="/conf/core-components-examples/settings/wcm/templates/content-page" | ||
jcr:description="Display product categories in a carousel" | ||
jcr:primaryType="cq:PageContent" | ||
jcr:title="Category 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_title | ||
cq:styleIds="[1644862132301]" | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="core/wcm/components/text/v2/text" | ||
text="<h1>Category Carousel<sub>v1</sub></h1>" | ||
textIsRich="true"/> | ||
<text_description | ||
cq:styleIds="[1544762734201]" | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="core/wcm/components/text/v2/text" | ||
text="<p>The Category Carousel is a server side component written in HTL, allowing to display a list of categories in a carousel. Authors can configure the categories via&nbsp;Multifield&nbsp;and&nbsp;Category Picker. The image displayed for each category is obtained from the commerce system or can be manually selected by the author.</p>
<p>Note: due to the limited amount of sample data available, the link to the category pages will always display the same sample category data.</p>
" | ||
textIsRich="true"/> | ||
<teaser_documentation | ||
cq:styleIds="[1550165685463]" | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:description="<p>GitHub</p>
" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02: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/categorycarousel/v1/categorycarousel" | ||
textIsRich="true" | ||
titleFromPage="false"/> | ||
<title_examples | ||
cq:styleIds="[1544759664489]" | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Examples" | ||
sling:resourceType="core/wcm/components/title/v2/title" | ||
type="h2"/> | ||
<title_standard | ||
cq:styleIds="[1544759676459]" | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Standard" | ||
sling:resourceType="core/wcm/components/title/v2/title" | ||
type="h3"/> | ||
<text_details | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="core/wcm/components/text/v2/text" | ||
text="<p>Category Carousel displaying sample data.</p>" | ||
textIsRich="true"/> | ||
<demo | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02: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"> | ||
<categorycarousel | ||
jcr:created="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:createdBy="admin" | ||
jcr:lastModified="{Date}2020-10-14T12:05:03.012+02:00" | ||
jcr:lastModifiedBy="admin" | ||
jcr:primaryType="nt:unstructured" | ||
jcr:title="Trending product categories" | ||
sling:resourceType="cif-components-examples/components/categorycarousel"> | ||
<items jcr:primaryType="nt:unstructured"> | ||
<item0 | ||
jcr:primaryType="nt:unstructured" | ||
asset="/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/bruno-compete-hoodie/mh03-black_main_2.jpg" | ||
categoryId="15"/> | ||
<item1 | ||
jcr:primaryType="nt:unstructured" | ||
asset="/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/ingrid-running-jacket/wj04-orange_main_2.jpg" | ||
categoryId="24"/> | ||
<item2 | ||
jcr:primaryType="nt:unstructured" | ||
asset="/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/fusion-backpack/mb02-gray-0.jpg" | ||
categoryId="28"/> | ||
<item3 | ||
jcr:primaryType="nt:unstructured" | ||
asset="/content/dam/core-components-examples/library/cif-sample-assets/catalog/product/summit-watch/mg03-br-0.jpg" | ||
categoryId="32"/> | ||
</items> | ||
</categorycarousel> | ||
</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> |
43 changes: 43 additions & 0 deletions
43
it/http/src/test/java/com/adobe/cq/commerce/it/http/CategoryCarouselComponentIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************************* | ||
* | ||
* Copyright 2020 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
* | ||
******************************************************************************/ | ||
|
||
package com.adobe.cq.commerce.it.http; | ||
|
||
import org.apache.sling.testing.clients.ClientException; | ||
import org.apache.sling.testing.clients.SlingHttpResponse; | ||
import org.jsoup.Jsoup; | ||
import org.jsoup.nodes.Document; | ||
import org.jsoup.select.Elements; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class CategoryCarouselComponentIT extends CommerceTestBase { | ||
|
||
// Differentiates between the HTML output of the component itself, and the tab displaying the HTML output | ||
private static final String CATEGORYCAROUSEL_SELECTOR = CMP_EXAMPLES_DEMO_SELECTOR + " .categorycarousel "; | ||
|
||
@Test | ||
public void testCategoryCarouselWithSampleData() throws ClientException { | ||
SlingHttpResponse response = adminAuthor.doGet(COMMERCE_LIBRARY_PATH + "/categorycarousel.html", 200); | ||
Document doc = Jsoup.parse(response.getContent()); | ||
|
||
// Check title | ||
Elements elements = doc.select(CATEGORYCAROUSEL_SELECTOR + ".carousel__title"); | ||
Assert.assertEquals("Trending product categories", elements.first().html()); | ||
|
||
// Check that the components displays 4 categories | ||
elements = doc.select(CATEGORYCAROUSEL_SELECTOR + ".carousel__cardscontainer > .categorycarousel__card"); | ||
Assert.assertEquals(4, elements.size()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...main/content/jcr_root/apps/core/cif/components/commerce/carousel/v1/carousel/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="cq:Component" | ||
jcr:title="Carousel" | ||
cq:icon="imageCarousel" | ||
componentGroup=".hidden" /> |
Oops, something went wrong.