Skip to content

Commit

Permalink
Add Show Popup property under custom property
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavitra Khatri authored and ci-build committed Oct 8, 2024
1 parent f90346f commit 9389502
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public boolean isShowAsPopup() {
Map<String, Object> properties = super.getProperties();
if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) {
properties.put(CUSTOM_TNC_PROPERTY, true);
properties.put("fd:" + ReservedProperties.PN_SHOW_AS_POPUP, isShowAsPopup());
}
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void testExportedType() throws Exception {
public void testGetProperties() {
TermsAndConditions tnc = Utils.getComponentUnderTest(PATH_TNC, TermsAndConditions.class, context);
Assert.assertTrue(tnc.isShowApprovalOption());
Assert.assertTrue(tnc.isShowAsPopup());
Assert.assertFalse(tnc.isShowLink());
}

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

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"fd:path": "/content/termsandconditions",
"fd:tnc": true,
"fd:showAsPopup": false,
"customProp": "customPropValue"
},
"label": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"dorExcludeDescription": false
},
"fd:path": "/content/termsandconditionsNoWrapData",
"fd:tnc": true
"fd:tnc": true,
"fd:showAsPopup": false
},
"label": {
"value": "Terms And Conditions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"showApprovalOption": true,
"jcr:title": "Terms And Conditions",
"fd:tnc": true,
"showAsPopup": true,
"fd:showAsPopup": true,
"name": "termsandconditions1694159302516",
"sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions",
"wrapData": true,
Expand Down Expand Up @@ -47,7 +47,7 @@
"showApprovalOption": true,
"jcr:title": "Terms And Conditions",
"fd:tnc": true,
"showAsPopup": true,
"fd:showAsPopup": false,
"showLink": true,
"name": "termsandconditions1694159302516",
"sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions",
Expand Down Expand Up @@ -91,7 +91,7 @@
"showApprovalOption": true,
"jcr:title": "Terms And Conditions",
"fd:tnc": true,
"showAsPopup": true,
"fd:showAsPopup": true,
"name": "termsandconditions1694159302516",
"sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions",
"wrapData": true,
Expand Down

0 comments on commit 9389502

Please sign in to comment.