Skip to content

Commit 07da915

Browse files
Forms 16285 wcmmode removed publish (#1392)
* removed wcm mode from the embed container iframe * removed wcm mode from the embed container iframe II * wcm mode param remvoed from the embed src * refactored * test cases added * test case fixed --------- Co-authored-by: Rajat Khurana <[email protected]>
1 parent 6345fc2 commit 07da915

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@
7070
<sly data-sly-test.formLocaleString="${form.locale || 'en'}"/>
7171
<iframe title="${form.title}"
7272
role="${form.roleAttribute || ''}"
73+
data-sly-set.dataRef="?${['dataRef=', request.requestParameterMap['dataRef'][0].toString] @ join=''}"
7374
class="cmp-aemform__iframecontent"
74-
src="${request.contextPath}${resource.path}.iframe.${formLocaleString}.html?dataRef=${request.requestParameterMap['dataRef'] != null ? request.requestParameterMap['dataRef'][0].toString : '' @ context='attribute'}${!wcmmode.edit ? '&wcmmode={0}':'' @ format=[wcmmode.toString]}"
75+
src="${request.contextPath}${resource.path}.iframe.${formLocaleString}.html${request.requestParameterMap['dataRef'] != null ? dataRef : '' @ context='attribute'}"
76+
width="100%;"
7577
width="100%;"
7678
data-form-page-path="${form.formEditPagePath}"></iframe>
7779
<sly data-sly-test="${form.useIframe != 'false' && form.height == 'auto'}"

ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.cy.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ describe("Sites with Aem Embed Container", () => {
4848
cy.get('.cmp-adaptiveform-container').should('have.length', 1);
4949
cy.get('.cmp-adaptiveform-container').find('.cmp-adaptiveform-textinput__widget').should('have.length', 11);
5050
})
51+
52+
it('Test iframe src with dataRef', () => {
53+
cy.get('.cmp-aemform__iframecontent').should('have.attr', 'src').should('not.include', "wcmmode");
54+
});
5155
})
5256

5357
context('aem embed container in iframe mode with custom height ', function () {
@@ -124,5 +128,6 @@ describe("Sites with Aem Embed Container", () => {
124128
expect(fragmentTextInputModel.getState().value).to.equal(input)
125129
})
126130
})
131+
127132
})
128133
})

0 commit comments

Comments
 (0)