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 9, 2024
1 parent 34aae8b commit d288a5b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 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(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("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,
"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,
"showAsPopup": true
},
"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,
"showAsPopup": false,
"name": "termsandconditions1694159302516",
"sling:resourceType": "core/fd/components/form/termsandconditions/v1/termsandconditions",
"wrapData": true,
Expand Down

0 comments on commit d288a5b

Please sign in to comment.