Skip to content

Commit a2dc777

Browse files
Pavitra KhatriPavitra Khatri
Pavitra Khatri
authored and
Pavitra Khatri
committed
Add Show Popup property under custom property
1 parent 19da0c7 commit a2dc777

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private ReservedProperties() {
162162
public static final String FD_ENABLE_AUTO_SAVE = "fd:enableAutoSave";
163163
public static final String FD_AUTO_SAVE_STRATEGY_TYPE = "fd:autoSaveStrategyType";
164164
public static final String FD_AUTO_SAVE_INTERVAL = "fd:autoSaveInterval";
165+
public static final String FD_PN_SHOW_AS_POPUP = "fd:showAsPopup";
165166
private static final Set<String> reservedProperties = aggregateReservedProperties();
166167

167168
private static Set<String> aggregateReservedProperties() {

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

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public boolean isShowAsPopup() {
8787
Map<String, Object> properties = super.getProperties();
8888
if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) {
8989
properties.put(CUSTOM_TNC_PROPERTY, true);
90+
properties.put(ReservedProperties.FD_PN_SHOW_AS_POPUP, isShowAsPopup());
9091
}
9192
return properties;
9293
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void testExportedType() throws Exception {
9595
public void testGetProperties() {
9696
TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context);
9797
Assert.assertTrue(tnc.isShowApprovalOption());
98-
Assert.assertTrue(tnc.isShowAsPopup());
9998
Assert.assertFalse(tnc.isShowLink());
10099
}
101100

@@ -105,6 +104,7 @@ public void testCustomFDProperty() {
105104
Map<String, Object> props = tnc.getProperties();
106105
Assert.assertTrue(props.containsKey("fd:tnc"));
107106
Assert.assertTrue((Boolean) props.get("fd:tnc"));
107+
Assert.assertFalse((Boolean) props.get("fd:showAsPopup"));
108108

109109
}
110110

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

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"fd:path": "/content/termsandconditions",
1313
"fd:tnc": true,
14+
"fd:showAsPopup": false,
1415
"customProp": "customPropValue"
1516
},
1617
"label": {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"dorExcludeDescription": false
1010
},
1111
"fd:path": "/content/termsandconditionsNoWrapData",
12-
"fd:tnc": true
12+
"fd:tnc": true,
13+
"fd:showAsPopup": true
1314
},
1415
"label": {
1516
"value": "Terms And Conditions"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"showApprovalOption": true,
44
"jcr:title": "Terms And Conditions",
55
"fd:tnc": true,
6-
"showAsPopup": true,
6+
"showAsPopup": false,
77
"name": "termsandconditions1694159302516",
88
"sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions",
99
"wrapData": true,

0 commit comments

Comments
 (0)