Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Aug 21, 2023
2 parents 8dbbcba + 079213e commit 88e2045
Show file tree
Hide file tree
Showing 18 changed files with 182 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ jobs:
java-version: ${{ matrix.java }}
maven-executable: ./mvnw
sonar-run-on-os: ubuntu-latest
sonar-run-on-java-version: 11
sonar-run-on-java-version: 17
sonar-token: ${{ secrets.SONAR_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

name: Deploy

concurrency: ${{ github.workflow }}

on:
push:
branches:
Expand Down
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# 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 CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
4 changes: 2 additions & 2 deletions bundles/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>jar</packaging>

<name>WCM Core Components</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@ protected ListItem newLinkListItem(@NotNull String newTitle, @NotNull LinkWrappe
getId(), getParentComponent(), this.resource);
}

@Override
protected boolean getActionsEnabledDefault() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void activate() {
boolean actionsDisabled = currentStyle.get(PN_ACTIONS_DISABLED, false);

// read component properties
actionsEnabled = properties.get(PN_ACTIONS_ENABLED, false) && !actionsDisabled;
actionsEnabled = properties.get(PN_ACTIONS_ENABLED, getActionsEnabledDefault()) && !actionsDisabled;
boolean titleFromPage = properties.get(PN_TITLE_FROM_PAGE, false);
boolean descriptionFromPage = properties.get(PN_DESCRIPTION_FROM_PAGE, false);

Expand All @@ -138,11 +138,13 @@ private void activate() {
}
}
}
// primary link is not enabled when actions are enabled
link = new LinkWrapper(linkHandler.invalid());
}

// if no actions enabled, resolve primary teaser link
// if actions are enabled and present, primary link is not enabled
if (actionsEnabled && !this.actions.isEmpty()) {
link = new LinkWrapper(linkHandler.invalid());
}
// otherwise resolve primary teaser link
else {
link = new LinkWrapper(HandlerUnwrapper.get(linkHandler, resource).build());
targetPage = link.getLinkObject().getTargetPage();
Expand Down Expand Up @@ -185,6 +187,10 @@ private void activate() {

}

protected boolean getActionsEnabledDefault() {
return true;
}

@Override
public @NotNull Media getMediaObject() {
return media;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static com.adobe.cq.wcm.core.components.models.Page.NN_PAGE_FEATURED_IMAGE;
import static com.adobe.cq.wcm.core.components.models.Teaser.NN_ACTIONS;
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTIONS_DISABLED;
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTIONS_ENABLED;
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTION_TEXT;
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_DESCRIPTION_FROM_PAGE;
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_DESCRIPTION_HIDDEN;
Expand Down Expand Up @@ -109,7 +108,7 @@ void testEmpty() {

Teaser underTest = AdaptTo.notNull(context.request(), Teaser.class);

assertFalse(underTest.isActionsEnabled());
assertTrue(underTest.isActionsEnabled());
assertTrue(underTest.getActions().isEmpty());
assertFalse(underTest.isImageLinkHidden());
assertNull(underTest.getTitle());
Expand All @@ -125,7 +124,6 @@ void testEmpty() {
}

@Test
@SuppressWarnings("null")
void testWithImageAndPrimaryLink() {
enableDataLayer(context, true);

Expand All @@ -140,7 +138,7 @@ void testWithImageAndPrimaryLink() {

Teaser underTest = AdaptTo.notNull(context.request(), Teaser.class);

assertFalse(underTest.isActionsEnabled());
assertTrue(underTest.isActionsEnabled());
assertTrue(underTest.getActions().isEmpty());
assertFalse(underTest.isImageLinkHidden());
assertEquals("Teaser Title", underTest.getTitle());
Expand Down Expand Up @@ -261,8 +259,7 @@ void testWithActions() {
Resource resource = context.create().resource(page, "teaser",
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
PN_LINK_TYPE, ExternalLinkType.ID,
PN_LINK_EXTERNAL_REF, "http://host",
PN_ACTIONS_ENABLED, true);
PN_LINK_EXTERNAL_REF, "http://host");
context.currentResource(resource);
context.create().resource(resource, NN_ACTIONS + "/action1",
PN_ACTION_TEXT, "Action 1",
Expand Down Expand Up @@ -297,8 +294,7 @@ void testWithActions_DisabledViaPolicy() {
Resource resource = context.create().resource(page, "teaser",
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
PN_LINK_TYPE, ExternalLinkType.ID,
PN_LINK_EXTERNAL_REF, "http://host",
PN_ACTIONS_ENABLED, true);
PN_LINK_EXTERNAL_REF, "http://host");
context.currentResource(resource);
context.create().resource(resource, NN_ACTIONS + "/action1",
PN_ACTION_TEXT, "Action 1",
Expand All @@ -322,7 +318,6 @@ void testTitleDescriptionImageFromFirstActionPage() {
PN_MEDIA_REF_STANDARD, asset.getPath());
Resource resource = context.create().resource(page, "teaser",
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
PN_ACTIONS_ENABLED, true,
PN_TITLE_FROM_PAGE, true,
PN_DESCRIPTION_FROM_PAGE, true,
PN_IMAGE_FROM_PAGE_IMAGE, true,
Expand Down
6 changes: 6 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
<body>

<release version="1.13.2-2.22.6" date="2023-08-21">
<action type="fix" dev="sseifert" issue="12">
Fix detection of teaser actions in Teaser V2.
</action>
</release>

<release version="1.13.0-2.22.6" date="2023-05-19">
<action type="add" dev="sseifert" issue="11">
Add List (v4).
Expand Down
6 changes: 3 additions & 3 deletions examples/bundles/examples-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples-core</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>jar</packaging>

<name>WCM Core Components Examples Core</name>
Expand All @@ -44,7 +44,7 @@
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<scope>compile</scope>
</dependency>

Expand Down
10 changes: 5 additions & 5 deletions examples/content-packages/examples-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples-libs</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>content-package</packaging>

<name>WCM Core Components Examples wcm.io Libraries</name>
Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -153,7 +153,7 @@
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.sling.commons</artifactId>
<version>1.6.2</version>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>io.wcm</groupId>
Expand Down Expand Up @@ -188,7 +188,7 @@
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.ui.granite</artifactId>
<version>1.9.10</version>
<version>1.9.12</version>
</dependency>

</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions examples/content-packages/examples-sample-content/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples-sample-content</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>content-package</packaging>

<name>WCM Core Components Examples Content</name>
Expand Down
6 changes: 3 additions & 3 deletions examples/content-packages/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>content-package</packaging>

<name>WCM Core Components Examples</name>
Expand All @@ -42,7 +42,7 @@
<dependency>
<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples-core</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<scope>compile</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

<groupId>io.wcm.samples</groupId>
<artifactId>io.wcm.wcm.core.components.examples.root</artifactId>
<version>1.13.0-2.22.6</version>
<version>1.13.2-2.22.6</version>
<packaging>pom</packaging>

<modules>
Expand Down
Loading

0 comments on commit 88e2045

Please sign in to comment.