Skip to content

Commit 4a55a33

Browse files
TalmizAhmedDeep Prakash Dewanji
andauthored
Encode formDefinition with jsonString context (#1242)
* Encode formDefinition with jsonString context * Encode formDefinition with jsonString context * updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request * Encode formDefinition with jsonString context * updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request * updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request * updated the proxy component to point to v2 version of page and wrote a test case to check the json emitted in case of eds servlet originated request --------- Co-authored-by: Deep Prakash Dewanji <[email protected]>
1 parent e0481b5 commit 4a55a33

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/page/.content.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
jcr:description="Page Component for the Forms Components Library"
44
jcr:primaryType="cq:Component"
55
jcr:title="Page"
6-
sling:resourceSuperType="core/fd/components/page/v1/page"
6+
sling:resourceSuperType="core/fd/components/page/v2/page"
77
componentGroup=".hidden"/>

it/config/src/main/content/jcr_root/apps/system/config/com.adobe.granite.toggle.impl.dev.DynamicToggleProviderImpl.cfg.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"FT_FORMS-12052",
1818
"FT_FORMS-13209",
1919
"FT_FORMS-11581",
20-
"FT_FORMS-14545"
20+
"FT_FORMS-14545",
21+
"FT_SITES-19631"
2122
]
2223
}

it/content/src/main/content/jcr_root/content/forms/af/core-components-it/samples/page/afv2/.content.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
jcr:language="en"
1010
jcr:primaryType="cq:PageContent"
1111
jcr:title="Page Edge Delivery"
12-
sling:configRef="/conf/forms/afv2/"
12+
sling:configRef="/conf/core-components-it/samples/customfunctionedgedelivery/"
13+
cq:conf="/conf/core-components-it"
1314
sling:resourceType="core/fd/components/page/v2/page">
1415
<guideContainer
1516
fd:version="2.1"

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/container.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
data-sly-test.isEdgeDeliveryRequest="${formUtil.edgeDeliveryRequest}">
2222
<div>
2323
<div>
24-
<pre>
25-
<code>${formstructparser.formDefinition}</code>
26-
</pre>
24+
<pre>
25+
<code>"${formstructparser.formDefinition @ context='jsonString'}"</code>
26+
</pre>
2727
</div>
2828
</div>
2929
</div>

ui.tests/test-module/specs/page/pagev2.runtime.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,23 @@ describe("Form with Page component version 2", () => {
3030
cy.get("html body main form").should("exist");
3131
})
3232
})
33+
34+
describe("Form with Page component version 2 for eds rendering", () => {
35+
const pagePath = "/bin/franklin.delivery/adobe-rnd/aem-boilerplate-forms/main/content/forms/af/core-components-it/samples/page/afv2.html"
36+
beforeEach(() => {
37+
cy.openPage(pagePath);
38+
});
39+
40+
it(" form should get rendered with main tag in body and should have pre code tags ", () => {
41+
cy.get("html body main div div div pre code").should("exist");
42+
cy.get("html body main div div div pre code").then(($codeEle)=>{
43+
const encodedJson=$codeEle.get()[0].innerHTML;
44+
const formJson=JSON.parse(JSON.parse(encodedJson));
45+
expect(formJson).to.have.property("id");
46+
expect(formJson).to.have.property("fieldType");
47+
expect(formJson).to.have.property(":items");
48+
expect(formJson).to.have.property("title");
49+
50+
})
51+
})
52+
})

0 commit comments

Comments
 (0)