-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [SITES-19919] Fixed List (v4) missing teaser image for page with external redirect Jira: https://jira.corp.adobe.com/browse/SITES-19919 There are 3 distinct cases: * internal page list item * internal page list item with external redirect * external page list item First and third cases were handled correctly But in the second case the page was treated as external (3rd case) leading to the missing teaser image The current fix makes sure that in the 2nd case the page is considered internal just like in the 1st case * SITES-19919: add tests * Change Test name * SITES-19919: fix tests * SITES-19919: improve test mocking --------- Co-authored-by: Igor Myronenko <[email protected]>
- Loading branch information
1 parent
8fbb567
commit d6699e5
Showing
5 changed files
with
85 additions
and
2 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
24 changes: 24 additions & 0 deletions
24
...test/resources/components/list-v4-static-internal-pages-containing-external-redirect.html
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,24 @@ | ||
<div class="list-v4 list"> | ||
<ul class="cmp-list" data-cmp-data-layer="{"list-v4-c9b2ee1865":{"@type":"core-component/components/list-v4"}}" id="list-v4-c9b2ee1865"> | ||
<li class="cmp-list__item" data-cmp-data-layer="{"list-v4-c9b2ee1865-item-5a69939138":{"@type":"core-component/components/list-v4/item","dc:title":"List","repo:modifyDate":"0000-00-00T00:00:00Z","xdm:linkURL":"/content/core-components/list.html"}}"> | ||
<div class="cmp-teaser" data-cmp-data-layer="{"teaser-v2-c9b2ee1865":{"@type":"core-component/components/teaser-v2","dc:title":"List","xdm:linkURL":"/content/core-components/list.html"}}" id="teaser-v2-c9b2ee1865"> | ||
<a class="cmp-teaser__link" data-cmp-clickable="" href="/content/core-components/list.html"> | ||
<div class="cmp-teaser__content"> | ||
<h2 class="cmp-teaser__title"> List </h2> | ||
</div></a> | ||
</div></li> | ||
<li class="cmp-list__item" data-cmp-data-layer="{"list-v4-c9b2ee1865-item-e7fc6d9060":{"@type":"core-component/components/list-v4/item","dc:title":"lorem ipsum1","repo:modifyDate":"0000-00-00T00:00:00Z","xdm:linkURL":"https://www.adobe.com"}}"> | ||
<div class="cmp-teaser" data-cmp-data-layer="{"teaser-v2-c9b2ee1865":{"@type":"core-component/components/teaser-v2","dc:title":"Page redirecting to external link","xdm:linkURL":"https://www.adobe.com"}}" id="teaser-v2-c9b2ee1865"> | ||
<a class="cmp-teaser__link" data-cmp-clickable="" href="https://www.adobe.com" target="_blank"> | ||
<div class="cmp-teaser__content"> | ||
<h2 class="cmp-teaser__title"> Page redirecting to external link </h2> | ||
</div> | ||
<div class="cmp-teaser__image"> | ||
<div class="cmp-image" data-asset-id="7f2a2314-7701-4c27-8945-bd5388ac94da" data-cmp-data-layer="{"teaser-v2-c9b2ee1865-image":{"@type":"core-component/components/image-v3","dc:title":"Rock Climbing and Bouldering above the lake and mountains","image":{"@type":"image/jpeg","repo:id":"7f2a2314-7701-4c27-8945-bd5388ac94da","repo:modifyDate":"0000-00-00T00:00:00Z","repo:path":"/content/dam/core-components/AdobeStock_140634652_climbing.jpeg","xdm:smartTags":{"bay":0.5985470414161682,"beach":0.5976041555404663,"beautiful":0.6171958446502686,"blue":0.7352101802825928,"clouds":0.571403980255127,"coast":0.6973159313201904,"coastline":0.595418393611908,"day":0.571010410785675,"green":0.6390171051025391,"hiking":0.5750616788864136,"hill":0.6186604499816895,"island":0.6160755157470703,"italy":0.5701255798339844,"lake":0.7277572751045227,"landscape":0.757290244102478,"mountain":0.7924668192863464,"mountains":0.6863020062446594,"nature":0.7408576607704163,"rock":0.6624879240989685,"sea":0.7226889729499817,"sky":0.6803537011146545,"summer":0.642336905002594,"travel":0.6782629489898682,"view":0.5776767134666443,"water":0.7416633367538452}},"xdm:linkURL":"https://www.adobe.com"}}" data-cmp-filereference="/content/dam/core-components/AdobeStock_140634652_climbing.jpeg" data-cmp-hook-image="imageV3" data-cmp-is="image" data-cmp-src="/content/core-components/list/_jcr_content/root/container/list_v4_static_internal_pages_containing_external_redirect.coreimg{.width}.jpeg/content/core-components/simple-page/simple-redirect/jcr:content/cq:featuredimage/0/adobestock-140634652-climbing.jpeg" id="teaser-v2-c9b2ee1865-image" itemscope itemtype="http://schema.org/ImageObject"> | ||
<img alt="Rock Climbing and Bouldering above the lake and mountains" class="cmp-image__image" height="862" itemprop="contentUrl" loading="lazy" src="/content/core-components/list/_jcr_content/root/container/list_v4_static_internal_pages_containing_external_redirect.coreimg.jpeg/content/core-components/simple-page/simple-redirect/_jcr_content/_cq_featuredimage/0/adobestock-140634652-climbing.jpeg" title="Rock Climbing and Bouldering above the lake and mountains" width="1293"> | ||
<meta content="Rock Climbing and Bouldering above the lake and mountains" itemprop="caption"> | ||
</div> | ||
</div></a> | ||
</div></li> | ||
</ul> | ||
</div> |
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
37 changes: 37 additions & 0 deletions
37
...ent/src/content/jcr_root/content/core-components/simple-page/simple-redirect/.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,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
~ Copyright 2021 Adobe | ||
~ | ||
~ Licensed 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 CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> | ||
<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}2021-01-15T16:44:49.861+02:00" | ||
cq:lastModifiedBy="admin" | ||
cq:template="/conf/core-components/settings/wcm/templates/simple-template" | ||
jcr:primaryType="cq:PageContent" | ||
jcr:title="Page redirecting to external link" | ||
cq:redirectTarget="https://www.adobe.com" | ||
cq:redirectPermanent="true" | ||
sling:resourceType="core/wcm/components/page/v2/page"> | ||
<cq:featuredimage | ||
jcr:primaryType="nt:unstructured" | ||
sling:resourceType="core/wcm/components/image/v3/image" | ||
altValueFromDAM="true" | ||
fileReference="/content/dam/core-components/AdobeStock_140634652_climbing.jpeg" /> | ||
<image | ||
jcr:primaryType="nt:unstructured" | ||
fileReference="/content/dam/core-components/AdobeStock_140634652_climbing.jpeg" /> | ||
</jcr:content> | ||
</jcr:root> |