Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FORMS-16446 Add isWrapData property on panel #1412

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ public Boolean isReadOnly() {
return readOnly;
}

@Override
@JsonIgnore
@Nullable
public boolean isWrapData() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to expose this property ? Please link the JIRA id in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is needed to check if panel is marked as wrapped. This is needed to create bindRefMap required in adobe sign submission.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not part of crispr spec. Even if this property is required, it should be a custom property specific to AEM implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add JsonIgnore on it

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 @@
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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to consume this on server, so its not required to expose this in json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add jsonIgnore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return false;

Check warning on line 50 in bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L50 was not covered by tests
}

}
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 @@ -137,4 +138,10 @@ void testNoFieldType() {
Panel panel = Utils.getComponentUnderTest(PATH_PANEL_WITHOUT_FIELDTYPE, Panel.class, context);
assertEquals(FieldType.PANEL.getValue(), panel.getFieldType());
}

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