Skip to content

Commit 040f877

Browse files
authored
FORMS-26630: Add show as popup property in guidecontainer model json (#1929)
* FORMS-26630: Add show as popup property in guidecontainer model json * FORMS-26630: Update show as popup test * FORMS-26630: Move popup key out from condition
1 parent d4c4cbd commit 040f877

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
public class TermsAndConditionsImpl extends PanelImpl implements TermsAndConditions {
4747

4848
private static final String CUSTOM_TNC_PROPERTY = "fd:tnc";
49+
private static final String SHOW_AS_POPUP_PROPERTY = "fd:showAsPopup";
4950

5051
@JsonIgnore
5152
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_SHOW_APPROVAL_OPTION)
@@ -88,6 +89,7 @@ public boolean isShowAsPopup() {
8889
if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) {
8990
properties.put(CUSTOM_TNC_PROPERTY, true);
9091
}
92+
properties.put(SHOW_AS_POPUP_PROPERTY, isShowAsPopup());
9193
return properties;
9294
}
9395

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public void testCustomFDProperty() {
105105
Map<String, Object> props = tnc.getProperties();
106106
Assert.assertTrue(props.containsKey("fd:tnc"));
107107
Assert.assertTrue((Boolean) props.get("fd:tnc"));
108+
Assert.assertTrue(props.containsKey("fd:showAsPopup"));
109+
Assert.assertTrue((Boolean) props.get("fd:showAsPopup"));
108110

109111
}
110112

bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"properties": {
77
"fd:path": "/content/termsandconditions",
88
"fd:tnc": true,
9+
"fd:showAsPopup": true,
910
"customProp": "customPropValue"
1011
},
1112
"label": {

bundles/af-core/src/test/resources/form/termsandconditions/exporter-termsandconditionsNoWrapData.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"name": "termsandconditions1694159302516",
55
"properties": {
66
"fd:path": "/content/termsandconditionsNoWrapData",
7-
"fd:tnc": true
7+
"fd:tnc": true,
8+
"fd:showAsPopup": true
89
},
910
"label": {
1011
"value": "Terms And Conditions"

0 commit comments

Comments
 (0)