FORMS-26630: Add show as popup property in guidecontainer model json - #1927
FORMS-26630: Add show as popup property in guidecontainer model json#1927akshayvas wants to merge 3 commits into
Conversation
sakshi-arora1
left a comment
There was a problem hiding this comment.
@akshayvas Where is the implementation honouring this configuration?
sakshi-arora1
left a comment
There was a problem hiding this comment.
Overview: adds fd:showAsPopup to the exported properties of TermsAndConditionsImpl so consumers of the JSON model can tell whether the T&C panel should render as a popup. Note the PR title mentions "guidecontainer" but the diff only touches TermsAndConditionsImpl — worth fixing the title/description for traceability.
Main concern is inline below: the new property is gated behind an unrelated existing condition (fd:tnc presence), which will silently drop fd:showAsPopup from the export for any content that doesn't have that marker property set.
Test coverage: both updated fixtures (exporter-termsandconditions.json, exporter-termsandconditionsNoWrapData.json) and the underlying test-content.json already have fd:tnc: true hardcoded, so there's no test exercising the branch where fd:tnc is absent — i.e. no test proves/documents whether fd:showAsPopup is expected to disappear in that case.
| Map<String, Object> properties = super.getProperties(); | ||
| if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) { | ||
| properties.put(CUSTOM_TNC_PROPERTY, true); | ||
| properties.put(SHOW_AS_POPUP_PROPERTY, isShowAsPopup()); |
There was a problem hiding this comment.
This ties fd:showAsPopup export to the presence of the fd:tnc resource property, which represents an unrelated concept (custom T&C content marker). isShowAsPopup() is independent of whether fd:tnc is set.
In practice fd:tnc is stamped by the component's _cq_template on newly authored nodes, but any existing/legacy T&C content authored before that (or content created without going through the template) won't have fd:tnc on the resource. For that content, fd:showAsPopup will simply be missing from the exported JSON even when "Show as popup" is checked in the dialog, so the runtime has no way to know it should render as a popup.
Suggest moving this line (and probably the whole showAsPopup property) outside the if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) block so it's always emitted, e.g.:
properties.put(SHOW_AS_POPUP_PROPERTY, isShowAsPopup());
if (resource.getValueMap().containsKey(CUSTOM_TNC_PROPERTY)) {
properties.put(CUSTOM_TNC_PROPERTY, true);
}
@sakshi-arora1 |
|
@sakshi-arora1 I have addressed review comments in below PR, closing this, as current PR is failing to sync branch from fork. It will have only exporter json baseline test failure due to addition of new property. |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: