Skip to content

Commit

Permalink
FORMS-8863 datalayer clientlib in Sites Page and xfpage if forms incl… (
Browse files Browse the repository at this point in the history
#1085)

* FORMS-8863 datalayer clientlib in Sites Page and xfpage if forms included and datalayer included

* rename proxy components, fix datalayuer test\

* rename proxy components

* FORMS-8863 add comments for datalayer in  forms

---------

Co-authored-by: barshatr <barshatr@adobe.com>
  • Loading branch information
barshat7 and barshatr authored Jun 12, 2023
1 parent 50990cb commit c207cf4
Show file tree
Hide file tree
Showing 30 changed files with 49 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Accordion (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Accordion"
jcr:title="Accordion"
sling:resourceSuperType="core/fd/components/form/accordion/v1/accordion"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:icon="publish"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Reset Button"
jcr:title="Reset Button"
jcr:description="Add an interactive button for invoking a Reset action."
sling:resourceSuperType="core/fd/components/form/button/v1/button"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:icon="publish"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Submit Button"
jcr:title="Submit Button"
jcr:description="Add an interactive button for invoking a Submit action."
sling:resourceSuperType="core/fd/components/form/button/v1/button"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Button (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Button"
jcr:title="Button"
sling:resourceSuperType="core/fd/components/form/button/v1/button"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Check Box Group (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Check Box Group"
jcr:title="Check Box"
sling:resourceSuperType="core/fd/components/form/checkboxgroup/v1/checkboxgroup"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Date Picker (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Date Picker"
jcr:title="Date Picker"
sling:resourceSuperType="core/fd/components/form/datepicker/v1/datepicker"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Drop-down List (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Drop-down List"
jcr:title="Drop-down List"
sling:resourceSuperType="core/fd/components/form/dropdown/v1/dropdown"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Email Input"
jcr:title="Email"
jcr:description="Add a field to capture Email IDs."
sling:resourceSuperType="core/fd/components/form/emailinput/v1/emailinput"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form File Attachment (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form File Attachment"
jcr:title="File Attachment"
sling:resourceSuperType="core/fd/components/form/fileinput/v1/fileinput"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Footer (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Footer"
jcr:title="Footer"
sling:resourceSuperType="core/fd/components/form/footer/v1/footer"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Container component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Container"
jcr:title="Form Container"
fd:version="2.1"
sling:resourceSuperType="core/fd/components/form/container/v2/container"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Tabs on Top (v1) component"
jcr:description="Adaptive Form Horizontal Tabs (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Tabs on Top"
jcr:title="Horizontal Tabs"
sling:resourceSuperType="core/fd/components/form/tabsontop/v1/tabsontop"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Image (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Image"
jcr:title="Image"
sling:resourceSuperType="core/fd/components/form/image/v1/image"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Number Input (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Number Input"
jcr:title="Numeric Box"
sling:resourceSuperType="core/fd/components/form/numberinput/v1/numberinput"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Header (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Header"
jcr:title="Header"
sling:resourceSuperType="core/fd/components/form/pageheader/v1/pageheader"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Panel (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Panel"
jcr:title="Panel"
sling:resourceSuperType="core/fd/components/form/panelcontainer/v1/panelcontainer"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Radio Button (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Radio Button"
jcr:title="Radio Button"
sling:resourceSuperType="core/fd/components/form/radiobutton/v1/radiobutton"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Telephone Input"
jcr:title="Phone"
jcr:description="Add a field to capture Telephone numbers."
sling:resourceSuperType="core/fd/components/form/telephoneinput/v1/telephoneinput"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Text (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Text"
jcr:title="Text"
sling:resourceSuperType="core/fd/components/form/text/v1/text"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Text Input (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Text Input"
jcr:title="Text Box"
sling:resourceSuperType="core/fd/components/form/textinput/v1/textinput"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Title (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Title"
jcr:title="Form Title"
sling:resourceSuperType="core/fd/components/form/title/v1/title"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Vertical Tabs component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Vertical Tabs"
jcr:title="Vertical Tabs"
sling:resourceSuperType="core/fd/components/form/verticaltabs/v1/verticaltabs"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Wizard (v1) component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Wizard"
jcr:title="Wizard"
sling:resourceSuperType="core/fd/components/form/wizard/v1/wizard"
componentGroup="${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Drafts and submissions Component for Forms Portal"
jcr:primaryType="cq:Component"
jcr:title="Drafts and submissions Component for Forms Portal"
jcr:title="Draft and Submissions"
sling:resourceSuperType="core/fd/components/formsportal/draftsandsubmissions/v1/draftsandsubmissions"
componentGroup="${appTitle} - Forms and Communications Portal"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Link Component for Forms and Communications Portal"
jcr:primaryType="cq:Component"
jcr:title="Link Component"
jcr:title="Link"
sling:resourceSuperType="core/fd/components/formsportal/link/v2/link"
componentGroup="${appTitle} - Forms and Communications Portal"/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Portal Lister for AEM Forms Portal"
jcr:primaryType="cq:Component"
jcr:title="Portal Lister for AEM Forms Portal"
jcr:title="Search and Lister "
sling:resourceSuperType="core/fd/components/formsportal/portallister/v1/portallister"
componentGroup="${appTitle} - Forms and Communications Portal"/>
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,13 @@
data-sly-test.hasForm="${symbol_dollar}{formstructparser.containsFormContainer}">
<sly data-sly-test="${symbol_dollar}{hasForm}" data-sly-call="${symbol_dollar}{clientlib.js @ categories='core.forms.components.runtime.all', async=true}"/>
</sly>
#if ( $datalayer == "y")
<!--/*
Below clientlibs are included from https://github.com/adobe/aem-core-forms-components/blob/master/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/page/v1/page/customfooterlibs.html#L24
These clientlibs are only included if Forms is enabled, and datalayer is activated by expicitely setting datalayer='y'.
*/-->
<sly data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">
<sly data-sly-test="${symbol_dollar}{page.data && page.dataLayerClientlibIncluded}" data-sly-call="${symbol_dollar}{ clientlib.js @ categories='core.forms.components.commons.v1.datalayer', async=true}"></sly>
</sly>
#end
#end

Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,14 @@
data-sly-test.hasForm="${symbol_dollar}{formstructparser.containsFormContainer}">
<sly data-sly-test="${symbol_dollar}{hasForm}" data-sly-call="${symbol_dollar}{clientlib.js @ categories='core.forms.components.runtime.all', async=true}"/>
</sly>
#if ( $datalayer == "y")
<!--/*
Below clientlibs are included from https://github.com/adobe/aem-core-forms-components/blob/master/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/page/v1/page/customfooterlibs.html#L24
These clientlibs are only included if Forms is enabled, and datalayer is activated by expicitely setting datalayer='y'.
*/-->
<sly data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">
<sly data-sly-test="${symbol_dollar}{page.data && page.dataLayerClientlibIncluded}" data-sly-call="${symbol_dollar}{ clientlib.js @ categories='core.forms.components.commons.v1.datalayer', async=true}"></sly>
</sly>
#end
#end

6 changes: 4 additions & 2 deletions src/main/archetype/ui.tests/test-module/specs/aem/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,10 @@ describe('AEM Forms OOTB Content Tests', () => {
});
});

#if ( $datalayer == "y" )
describe('DataLayer testing', () => {
const templatePath = '/conf/myformtemplate/settings/wcm/templates/blank-af-v2';

const templatePath = '/conf/${appId}/settings/wcm/templates/blank-af-v2';
it('Verify dataLayer for v2 template ' + templatePath, async function () {
await browser.url(`${aem.author.base_url}/${templatePath}/initial.html?wcmmode=disabled`);
let isDataLayerVerificationSuccessful = true;
Expand Down Expand Up @@ -324,5 +326,5 @@ describe('AEM Forms OOTB Content Tests', () => {
return isDataLayerVerificationSuccessful;
});
});

#end
});

0 comments on commit c207cf4

Please sign in to comment.