Skip to content

Commit

Permalink
Add isWrapData property on panel
Browse files Browse the repository at this point in the history
  • Loading branch information
dgurjar committed Oct 3, 2024
1 parent 0e3f849 commit b24b589
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public Boolean isReadOnly() {
return readOnly;
}

@Override
@JsonIgnore
@Nullable
public boolean isWrapData() {
return wrapData;
}

@Override
@JsonIgnore
@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import org.osgi.annotation.versioning.ConsumerType;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
* Defines the form {@code panel} Sling Model used for the {@code /apps/core/fd/components/form/panel/v1/panel} component.
*
Expand All @@ -36,4 +38,16 @@ public interface Panel extends Container, ContainerConstraint {
default Boolean isReadOnly() {
return null;
}

/**
* Checks if the container is wrap data.
*
* @return {@code true} if the container is wrap data, {@code false} otherwise
* @since com.adobe.cq.forms.core.components.models.form 5.3.0
*/
@JsonIgnore
default boolean isWrapData() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.stream.StreamSupport;

import org.apache.sling.api.resource.Resource;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -129,4 +130,10 @@ void testBoundPanelJSONExport() throws Exception {
Panel panel = Utils.getComponentUnderTest(PATH_BOUND_PANEL, Panel.class, context);
Utils.testJSONExport(panel, Utils.getTestExporterJSONPath(BASE, PATH_BOUND_PANEL));
}

@Test
void testWrapData() throws Exception {
Panel panel = Utils.getComponentUnderTest(PATH_BOUND_PANEL, Panel.class, context);
Assert.assertEquals(false, panel.isWrapData());
}
}

0 comments on commit b24b589

Please sign in to comment.