Skip to content

Commit 88e2045

Browse files
committed
Merge branch 'develop'
2 parents 8dbbcba + 079213e commit 88e2045

File tree

18 files changed

+182
-159
lines changed

18 files changed

+182
-159
lines changed

.github/workflows/maven-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ jobs:
3232
java-version: ${{ matrix.java }}
3333
maven-executable: ./mvnw
3434
sonar-run-on-os: ubuntu-latest
35-
sonar-run-on-java-version: 11
35+
sonar-run-on-java-version: 17
3636
sonar-token: ${{ secrets.SONAR_TOKEN }}
3737
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/maven-deploy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
name: Deploy
44

5+
concurrency: ${{ github.workflow }}
6+
57
on:
68
push:
79
branches:

.mvn/wrapper/maven-wrapper.jar

3.73 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

bundles/core/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm</groupId>
3333
<artifactId>io.wcm.wcm.core.components</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>jar</packaging>
3636

3737
<name>WCM Core Components</name>

bundles/core/src/main/java/io/wcm/wcm/core/components/impl/models/v1/TeaserV1Impl.java

+5
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,9 @@ protected ListItem newLinkListItem(@NotNull String newTitle, @NotNull LinkWrappe
8383
getId(), getParentComponent(), this.resource);
8484
}
8585

86+
@Override
87+
protected boolean getActionsEnabledDefault() {
88+
return false;
89+
}
90+
8691
}

bundles/core/src/main/java/io/wcm/wcm/core/components/impl/models/v2/TeaserV2Impl.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private void activate() {
118118
boolean actionsDisabled = currentStyle.get(PN_ACTIONS_DISABLED, false);
119119

120120
// read component properties
121-
actionsEnabled = properties.get(PN_ACTIONS_ENABLED, false) && !actionsDisabled;
121+
actionsEnabled = properties.get(PN_ACTIONS_ENABLED, getActionsEnabledDefault()) && !actionsDisabled;
122122
boolean titleFromPage = properties.get(PN_TITLE_FROM_PAGE, false);
123123
boolean descriptionFromPage = properties.get(PN_DESCRIPTION_FROM_PAGE, false);
124124

@@ -138,11 +138,13 @@ private void activate() {
138138
}
139139
}
140140
}
141-
// primary link is not enabled when actions are enabled
142-
link = new LinkWrapper(linkHandler.invalid());
143141
}
144142

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

186188
}
187189

190+
protected boolean getActionsEnabledDefault() {
191+
return true;
192+
}
193+
188194
@Override
189195
public @NotNull Media getMediaObject() {
190196
return media;

bundles/core/src/test/java/io/wcm/wcm/core/components/impl/models/v2/TeaserV2ImplTest.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static com.adobe.cq.wcm.core.components.models.Page.NN_PAGE_FEATURED_IMAGE;
2525
import static com.adobe.cq.wcm.core.components.models.Teaser.NN_ACTIONS;
2626
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTIONS_DISABLED;
27-
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTIONS_ENABLED;
2827
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_ACTION_TEXT;
2928
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_DESCRIPTION_FROM_PAGE;
3029
import static com.adobe.cq.wcm.core.components.models.Teaser.PN_DESCRIPTION_HIDDEN;
@@ -109,7 +108,7 @@ void testEmpty() {
109108

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

112-
assertFalse(underTest.isActionsEnabled());
111+
assertTrue(underTest.isActionsEnabled());
113112
assertTrue(underTest.getActions().isEmpty());
114113
assertFalse(underTest.isImageLinkHidden());
115114
assertNull(underTest.getTitle());
@@ -125,7 +124,6 @@ void testEmpty() {
125124
}
126125

127126
@Test
128-
@SuppressWarnings("null")
129127
void testWithImageAndPrimaryLink() {
130128
enableDataLayer(context, true);
131129

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

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

143-
assertFalse(underTest.isActionsEnabled());
141+
assertTrue(underTest.isActionsEnabled());
144142
assertTrue(underTest.getActions().isEmpty());
145143
assertFalse(underTest.isImageLinkHidden());
146144
assertEquals("Teaser Title", underTest.getTitle());
@@ -261,8 +259,7 @@ void testWithActions() {
261259
Resource resource = context.create().resource(page, "teaser",
262260
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
263261
PN_LINK_TYPE, ExternalLinkType.ID,
264-
PN_LINK_EXTERNAL_REF, "http://host",
265-
PN_ACTIONS_ENABLED, true);
262+
PN_LINK_EXTERNAL_REF, "http://host");
266263
context.currentResource(resource);
267264
context.create().resource(resource, NN_ACTIONS + "/action1",
268265
PN_ACTION_TEXT, "Action 1",
@@ -297,8 +294,7 @@ void testWithActions_DisabledViaPolicy() {
297294
Resource resource = context.create().resource(page, "teaser",
298295
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
299296
PN_LINK_TYPE, ExternalLinkType.ID,
300-
PN_LINK_EXTERNAL_REF, "http://host",
301-
PN_ACTIONS_ENABLED, true);
297+
PN_LINK_EXTERNAL_REF, "http://host");
302298
context.currentResource(resource);
303299
context.create().resource(resource, NN_ACTIONS + "/action1",
304300
PN_ACTION_TEXT, "Action 1",
@@ -322,7 +318,6 @@ void testTitleDescriptionImageFromFirstActionPage() {
322318
PN_MEDIA_REF_STANDARD, asset.getPath());
323319
Resource resource = context.create().resource(page, "teaser",
324320
PROPERTY_RESOURCE_TYPE, RESOURCE_TYPE,
325-
PN_ACTIONS_ENABLED, true,
326321
PN_TITLE_FROM_PAGE, true,
327322
PN_DESCRIPTION_FROM_PAGE, true,
328323
PN_IMAGE_FROM_PAGE_IMAGE, true,

changes.xml

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
2424
<body>
2525

26+
<release version="1.13.2-2.22.6" date="2023-08-21">
27+
<action type="fix" dev="sseifert" issue="12">
28+
Fix detection of teaser actions in Teaser V2.
29+
</action>
30+
</release>
31+
2632
<release version="1.13.0-2.22.6" date="2023-05-19">
2733
<action type="add" dev="sseifert" issue="11">
2834
Add List (v4).

examples/bundles/examples-core/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.wcm.core.components.examples-core</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>jar</packaging>
3636

3737
<name>WCM Core Components Examples Core</name>
@@ -44,7 +44,7 @@
4444
<dependency>
4545
<groupId>io.wcm</groupId>
4646
<artifactId>io.wcm.wcm.core.components</artifactId>
47-
<version>1.13.0-2.22.6</version>
47+
<version>1.13.2-2.22.6</version>
4848
<scope>compile</scope>
4949
</dependency>
5050

examples/content-packages/examples-libs/pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.wcm.core.components.examples-libs</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>content-package</packaging>
3636

3737
<name>WCM Core Components Examples wcm.io Libraries</name>
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>io.wcm</groupId>
4444
<artifactId>io.wcm.wcm.core.components</artifactId>
45-
<version>1.13.0-2.22.6</version>
45+
<version>1.13.2-2.22.6</version>
4646
<scope>compile</scope>
4747
</dependency>
4848

@@ -153,7 +153,7 @@
153153
<dependency>
154154
<groupId>io.wcm</groupId>
155155
<artifactId>io.wcm.sling.commons</artifactId>
156-
<version>1.6.2</version>
156+
<version>1.6.4</version>
157157
</dependency>
158158
<dependency>
159159
<groupId>io.wcm</groupId>
@@ -188,7 +188,7 @@
188188
<dependency>
189189
<groupId>io.wcm</groupId>
190190
<artifactId>io.wcm.wcm.ui.granite</artifactId>
191-
<version>1.9.10</version>
191+
<version>1.9.12</version>
192192
</dependency>
193193

194194
</dependencies>

examples/content-packages/examples-sample-content/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.wcm.core.components.examples-sample-content</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>content-package</packaging>
3636

3737
<name>WCM Core Components Examples Content</name>

examples/content-packages/examples/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../../../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.wcm.core.components.examples</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>content-package</packaging>
3636

3737
<name>WCM Core Components Examples</name>
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>io.wcm.samples</groupId>
4444
<artifactId>io.wcm.wcm.core.components.examples-core</artifactId>
45-
<version>1.13.0-2.22.6</version>
45+
<version>1.13.2-2.22.6</version>
4646
<scope>compile</scope>
4747
</dependency>
4848

examples/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<parent>
2626
<groupId>io.wcm</groupId>
2727
<artifactId>io.wcm.wcm.core.components.parent</artifactId>
28-
<version>1.13.0-2.22.6</version>
28+
<version>1.13.2-2.22.6</version>
2929
<relativePath>../parent/pom.xml</relativePath>
3030
</parent>
3131

3232
<groupId>io.wcm.samples</groupId>
3333
<artifactId>io.wcm.wcm.core.components.examples.root</artifactId>
34-
<version>1.13.0-2.22.6</version>
34+
<version>1.13.2-2.22.6</version>
3535
<packaging>pom</packaging>
3636

3737
<modules>

0 commit comments

Comments
 (0)