Skip to content

Commit b24b589

Browse files
author
dgurjar
committed
Add isWrapData property on panel
1 parent 0e3f849 commit b24b589

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ public Boolean isReadOnly() {
114114
return readOnly;
115115
}
116116

117+
@Override
118+
@JsonIgnore
119+
@Nullable
120+
public boolean isWrapData() {
121+
return wrapData;
122+
}
123+
117124
@Override
118125
@JsonIgnore
119126
@NotNull

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
import org.osgi.annotation.versioning.ConsumerType;
2121

22+
import com.fasterxml.jackson.annotation.JsonIgnore;
23+
2224
/**
2325
* Defines the form {@code panel} Sling Model used for the {@code /apps/core/fd/components/form/panel/v1/panel} component.
2426
*
@@ -36,4 +38,16 @@ public interface Panel extends Container, ContainerConstraint {
3638
default Boolean isReadOnly() {
3739
return null;
3840
}
41+
42+
/**
43+
* Checks if the container is wrap data.
44+
*
45+
* @return {@code true} if the container is wrap data, {@code false} otherwise
46+
* @since com.adobe.cq.forms.core.components.models.form 5.3.0
47+
*/
48+
@JsonIgnore
49+
default boolean isWrapData() {
50+
return false;
51+
}
52+
3953
}

bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImplTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.stream.StreamSupport;
2323

2424
import org.apache.sling.api.resource.Resource;
25+
import org.junit.Assert;
2526
import org.junit.jupiter.api.BeforeEach;
2627
import org.junit.jupiter.api.Test;
2728
import org.junit.jupiter.api.extension.ExtendWith;
@@ -129,4 +130,10 @@ void testBoundPanelJSONExport() throws Exception {
129130
Panel panel = Utils.getComponentUnderTest(PATH_BOUND_PANEL, Panel.class, context);
130131
Utils.testJSONExport(panel, Utils.getTestExporterJSONPath(BASE, PATH_BOUND_PANEL));
131132
}
133+
134+
@Test
135+
void testWrapData() throws Exception {
136+
Panel panel = Utils.getComponentUnderTest(PATH_BOUND_PANEL, Panel.class, context);
137+
Assert.assertEquals(false, panel.isWrapData());
138+
}
132139
}

0 commit comments

Comments
 (0)