From 0dc8a28146a2c74ac378d69dfe12cc503c4df552 Mon Sep 17 00:00:00 2001 From: Pankaj Girotra <126753223+girotraapankaj@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:09:59 +0530 Subject: [PATCH 1/4] FORMS-16142 Updated test case as auto save tab name has changed (#1378) --- ui.tests/test-module/specs/formcontainer.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.tests/test-module/specs/formcontainer.spec.js b/ui.tests/test-module/specs/formcontainer.spec.js index 584425d33c..71b881b0af 100644 --- a/ui.tests/test-module/specs/formcontainer.spec.js +++ b/ui.tests/test-module/specs/formcontainer.spec.js @@ -69,7 +69,7 @@ describe('Page/Form Authoring', function () { cy.openEditableToolbar(sitesSelectors.overlays.overlay.component + formContainerEditPathSelector); cy.invokeEditableAction("[data-action='CONFIGURE']"); // Open auto save tab - cy.get('.cmp-adaptiveform-container'+'__editdialog').contains('Auto-save').click({force:true}); + cy.get('.cmp-adaptiveform-container'+'__editdialog').contains('Drafts').click({force:true}); cy.get("coral-checkbox[name='./fd:enableAutoSave']").should("exist"); cy.get("coral-checkbox[name='./fd:enableAutoSave']").click({force:true}); cy.get("coral-select[name='./fd:autoSaveStrategyType']").should("exist"); From ceb51a26c2522d3cad329bdedb7e13448c52c857 Mon Sep 17 00:00:00 2001 From: Rishi Mehta <69448117+rismehta@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:10:18 +0530 Subject: [PATCH 2/4] RTE fix for WCM components (#1376) * Fixing issue * reverting test fix --- .../clientlibs/editorhook/js/toolbaractionhook.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/editorhook/js/toolbaractionhook.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/editorhook/js/toolbaractionhook.js index 9610ad0139..0f8c9fa567 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/editorhook/js/toolbaractionhook.js +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/clientlibs/editorhook/js/toolbaractionhook.js @@ -42,12 +42,15 @@ }; const correctEditableEditorType = function (editable, name) { - if (name == "EDIT") { - var hasRichTextLabel = editable.dom.find("[class$='__label']")[0] && editable.dom.find("[class$='__label']")[0].getAttribute("data-richtext") != null, - hasRichTextAttribute = editable.dom.find("[class$='__text']")[0] && editable.dom.find("[class$='__text']")[0].getAttribute("data-richtext") != null; - // We are checking for data-richtext in component to decide whether open rich-text inplace editor or plain text editor - if(!(hasRichTextLabel || hasRichTextAttribute)){ - editable.config.editConfig.inplaceEditingConfig.editorType="plaintext"; + if (name === "EDIT") { + const isAFComponent = editable.dom.find("[data-cmp-is^='adaptiveForm']")[0] != null; + if (isAFComponent) { + const hasRichTextLabel = editable.dom.find("[class$='__label']")[0] && editable.dom.find("[class$='__label']")[0].getAttribute("data-richtext") != null, + hasRichTextAttribute = editable.dom.find("[class$='__text']")[0] && editable.dom.find("[class$='__text']")[0].getAttribute("data-richtext") != null; + // We are checking for data-richtext in component to decide whether open rich-text inplace editor or plain text editor + if (!(hasRichTextLabel || hasRichTextAttribute)) { + editable.config.editConfig.inplaceEditingConfig.editorType = "plaintext"; + } } } }; From a0a589bf0f5aaa9a9a78a9660a41f508d78df255 Mon Sep 17 00:00:00 2001 From: Rishi Mehta <69448117+rismehta@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:14:08 +0530 Subject: [PATCH 3/4] Revert "FORMS-11259: Avoid dataRef parameter in Iframe when no value available (#991)" (#1379) This reverts commit b1444983b71891e0ecf4a66a2f7741b88e8332fb. --- .../fd/components/aemform/v2/aemform/aemform.html | 15 ++++++--------- .../aemEmbedContainer.runtime.spec.js | 9 --------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html index b0e55d34b1..90cdf0164e 100644 --- a/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html +++ b/ui.apps/src/main/content/jcr_root/apps/core/fd/components/aemform/v2/aemform/aemform.html @@ -68,15 +68,12 @@ - - - - + diff --git a/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js b/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js index f9b4e87dbb..2d02ff9d3f 100644 --- a/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js +++ b/ui.tests/test-module/specs/aemEmbedContainer/aemEmbedContainer.runtime.spec.js @@ -48,15 +48,6 @@ describe("Sites with Aem Embed Container", () => { cy.get('.cmp-adaptiveform-container').should('have.length', 1); cy.get('.cmp-adaptiveform-container').find('.cmp-adaptiveform-textinput__widget').should('have.length', 11); }) - - it('Test iframe src with dataRef', () => { - cy.visit(pagePath+"?dataRef='testingDataRef'") - cy.get('.cmp-aemform__iframecontent').should('have.attr', 'src').should('include', "?wcmmode=DISABLED&dataRef='testingDataRef'"); - }); - - it('Test iframe src without dataRef', () => { - cy.get('.cmp-aemform__iframecontent').should('have.attr', 'src').should('include', "?wcmmode=DISABLED"); - }); }) context('aem embed container in iframe mode with custom height ', function () { From 85c20f8a48fae5d2372089eefe047ab2298caf68 Mon Sep 17 00:00:00 2001 From: Rishi Mehta <69448117+rismehta@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:22:38 +0530 Subject: [PATCH 4/4] Updating js docs (#1380) --- ui.frontend/src/constants.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ui.frontend/src/constants.js b/ui.frontend/src/constants.js index c2b44d641d..c278bcabe8 100644 --- a/ui.frontend/src/constants.js +++ b/ui.frontend/src/constants.js @@ -37,7 +37,7 @@ export const Constants = { * @property {object} event - The event object. * @property {object} event.detail - Instance of FormContainer that is initialized. * @example - * document.on("AF_FormContainerInitialised" , function(event) { + * document.addEventListener("AF_FormContainerInitialised" , function(event) { * var formContainer = event.detail; * // Handle the event * }); @@ -50,10 +50,15 @@ export const Constants = { * @property {object} event - The event object. * @property {object} event.detail - Instance of child view that is added. * @example - * formcontainer.getFormElement().on("AF_PanelInstanceAdded" , function(event) { - * var childView = event.detail; + * document.addEventListener("AF_FormContainerInitialised" , function(event) { + * var formContainer = event.detail; * // Handle the event + * formcontainer.getFormElement().addEventListener("AF_PanelInstanceAdded" , function(event) { + * var childView = event.detail; + * // Handle the event + * }); * }); + * */ PANEL_INSTANCE_ADDED : "AF_PanelInstanceAdded", @@ -63,9 +68,13 @@ export const Constants = { * @property {object} event - The event object. * @property {object} event.detail - Instance of child view that was removed. * @example - * formcontainer.getFormElement().on("AF_PanelInstanceRemoved" , function(event) { - * var childView = event.detail; + * document.addEventListener("AF_FormContainerInitialised" , function(event) { + * var formContainer = event.detail; * // Handle the event + * formcontainer.getFormElement().addEventListener("AF_PanelInstanceRemoved" , function(event) { + * var childView = event.detail; + * // Handle the event + * }); * }); */ PANEL_INSTANCE_REMOVED : "AF_PanelInstanceRemoved", @@ -76,7 +85,7 @@ export const Constants = { * @property {object} event - The event object. * @property {object} event.detail - The locale that has loaded. * @example - * document.on("AF_LanguageInitialised" , function(event) { + * document.addEventListener("AF_LanguageInitialised" , function(event) { * var locale = event.detail; * // Handle the event * });