Skip to content

Commit

Permalink
Updating type for button and actions core components (#1364)
Browse files Browse the repository at this point in the history
* Updating type for buttons

* Updating collateral for button

* Fixing collateral and test

* Fixing code and test

* Fixing test and keeping button disabled

* Adding code comments

* Updating read me and test

* Fixing reset test

---------

Co-authored-by: Muskan Gupta <[email protected]>
Co-authored-by: Muskan Gupta <[email protected]>
Co-authored-by: Rishi Mehta <[email protected]>
  • Loading branch information
4 people authored Sep 24, 2024
1 parent b154b88 commit 77886e9
Show file tree
Hide file tree
Showing 34 changed files with 742 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Reset Button"
jcr:description="Add an interactive button for invoking a Reset action."
sling:resourceSuperType="core/fd/components/form/button/v1/button"
sling:resourceSuperType="core/fd/components/form/actions/reset/v2/reset"
componentGroup="Core Components Examples - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Submit Button"
jcr:description="Add an interactive button for invoking a Submit action."
sling:resourceSuperType="core/fd/components/form/button/v1/button"
sling:resourceSuperType="core/fd/components/form/actions/submit/v2/submit"
componentGroup="Core Components Examples - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Button"
jcr:description="Add an interactive button for invoking an action such as Save, Reset, Submit, or navigate a form."
sling:resourceSuperType="core/fd/components/form/button/v1/button"
sling:resourceSuperType="core/fd/components/form/button/v2/button"
componentGroup="Core Components Examples - Adaptive Form"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<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="Page Component for the Core Components IT"
jcr:primaryType="cq:Component"
jcr:title="Page"
sling:resourceSuperType="forms-components-examples/components/page"
componentGroup=".hidden"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="core/wcm/components/commons/v1/templates/clientlib.html"
data-sly-use.formclientlibmanager="com.adobe.cq.forms.core.components.models.form.FormClientLibManager">
<sly data-sly-repeat="${formclientlibmanager.clientLibRefList}" data-sly-call="${clientlib.js @ categories=item, async=true}"/>
</sly>
<!-- Adding core.forms.components.it.runtime.all as we need to embed all component client libraries inside all due to inter dependency between them -->
<!-- core.forms.components.it.textinput.v1.runtime is embedded as part of core.forms.components.it.runtime.all -->
<sly data-sly-use.clientlib="core/wcm/components/commons/v1/templates/clientlib.html">
<sly data-sly-test="${!wcmmode.edit}" data-sly-call="${clientlib.js @ categories=['core.forms.components.runtime.base','core.forms.components.container.v2.runtime','core.forms.components.button.v1.runtime'], async=false}"/>
</sly>
<sly data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">
<sly data-sly-test="${page.data && page.dataLayerClientlibIncluded}" data-sly-call="${clientlib.js @ categories='core.forms.components.commons.v1.datalayer', async=true}"></sly>
</sly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<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="Page Component for the Core Components IT"
jcr:primaryType="cq:Component"
jcr:title="Page"
sling:resourceSuperType="forms-components-examples/components/page"
componentGroup=".hidden"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<sly data-sly-use.clientlib="core/wcm/components/commons/v1/templates/clientlib.html"
data-sly-use.formclientlibmanager="com.adobe.cq.forms.core.components.models.form.FormClientLibManager">
<sly data-sly-repeat="${formclientlibmanager.clientLibRefList}" data-sly-call="${clientlib.js @ categories=item, async=true}"/>
</sly>
<!-- Adding core.forms.components.it.runtime.all as we need to embed all component client libraries inside all due to inter dependency between them -->
<!-- core.forms.components.it.textinput.v1.runtime is embedded as part of core.forms.components.it.runtime.all -->
<sly data-sly-use.clientlib="core/wcm/components/commons/v1/templates/clientlib.html">
<sly data-sly-test="${!wcmmode.edit}" data-sly-call="${clientlib.js @ categories=['core.forms.components.runtime.base','core.forms.components.container.v2.runtime','core.forms.components.button.v1.runtime'], async=false}"/>
</sly>
<sly data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page">
<sly data-sly-test="${page.data && page.dataLayerClientlibIncluded}" data-sly-call="${clientlib.js @ categories='core.forms.components.commons.v1.datalayer', async=true}"></sly>
</sly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="sling:Folder"
lcFolder="{Long}0"
type="lcFolder"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<jcr:root xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="dam:Asset">
<jcr:content
jcr:lastModified="{Date}2021-12-02T15:12:59.947+05:30"
jcr:lastModified="{Date}2024-09-03T15:12:59.900+05:30"
jcr:primaryType="dam:AssetContent"
sling:resourceType="fd/fm/af/render"
guide="1"
Expand All @@ -16,6 +16,6 @@
dorType="none"
formmodel="none"
hasCustomThumbnail="{Boolean}false"
title="Adaptive Form V2 (IT)"/>
title="Adaptive Form V1 (IT)"/>
</jcr:content>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="sling:Folder"
lcFolder="{Long}0"
type="lcFolder"
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="dam:Asset">
<jcr:content
jcr:lastModified="{Date}2024-09-03T15:12:59.900+05:30"
jcr:primaryType="dam:AssetContent"
sling:resourceType="fd/fm/af/render"
guide="1"
type="guide">
<metadata
fd:version="2.1"
jcr:primaryType="nt:unstructured"
allowedRenderFormat="HTML"
author="admin"
availableInMobileApp="{Boolean}false"
dorType="none"
formmodel="none"
hasCustomThumbnail="{Boolean}false"
title="Adaptive Form V2 (IT)"/>
</jcr:content>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="sling:Folder"
hidden="true"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Page">
<jcr:content
cq:deviceGroups="[mobile/groups/responsive]"
cq:lastModified="{Date}2024-09-03T15:12:59.900+05:30"
cq:lastModifiedBy="admin"
cq:template="/conf/core-components-examples/settings/wcm/templates/af-blank-v2"
jcr:language="en"
jcr:primaryType="cq:PageContent"
jcr:title="Adaptive Form V1 (IT)"
sling:resourceType="forms-core-components-it/components/page-buttonv1">
<guideContainer
fd:version="2.1"
fieldType="form"
jcr:primaryType="nt:unstructured"
sling:resourceType="forms-components-examples/components/form/container">
<button-1
type="button"
jcr:primaryType="nt:unstructured"
name="button-1"
fieldType="button"
jcr:title="button-1"
enabled="{Boolean}true"
visible="{Boolean}true"
sling:resourceType="core/fd/components/form/button/v1/button"/>
<button-2
aria-label="basic-button"
type="button"
jcr:primaryType="nt:unstructured"
name="button-2"
jcr:title="button-2"
fieldType="button"
enabled="{Boolean}false"
visible="{Boolean}true"
sling:resourceType="core/fd/components/form/button/v1/button"/>
<button-3
class="cmp-button"
data-cmp-is="adaptiveFormButton"
aria-label="basic-button"
type="button"
jcr:primaryType="nt:unstructured"
name="button-3"
jcr:title="button-3"
fieldType="button"
enabled="{Boolean}true"
visible="{Boolean}false"
sling:resourceType="core/fd/components/form/button/v1/button"/>
<button-4
description="This is long description"
tooltip="This is short description"
tooltipVisible="true"
aria-label="basic-button-4"
type="button"
jcr:primaryType="nt:unstructured"
name="button-4"
jcr:title="button-4"
fieldType="button"
enabled="{Boolean}true"
visible="{Boolean}true"
sling:resourceType="core/fd/components/form/button/v1/button"/>
<button-5
jcr:lastModified="{Date}2023-01-30T14:02:55.708+05:30"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Navigate"
sling:resourceType="core/fd/components/form/button/v1/button"
dorExclusion="true"
fieldType="button"
name="button1675067564294">
<fd:rules
fd:click="[{&quot;nodeName&quot;:&quot;ROOT&quot;\,&quot;items&quot;:[{&quot;nodeName&quot;:&quot;STATEMENT&quot;\,&quot;choice&quot;:{&quot;nodeName&quot;:&quot;EVENT_SCRIPTS&quot;\,&quot;items&quot;:[{&quot;nodeName&quot;:&quot;EVENT_CONDITION&quot;\,&quot;choice&quot;:{&quot;nodeName&quot;:&quot;EVENT_AND_COMPARISON&quot;\,&quot;items&quot;:[{&quot;nodeName&quot;:&quot;COMPONENT&quot;\,&quot;value&quot;:{&quot;id&quot;:&quot;$form.button1675067564294&quot;\,&quot;type&quot;:&quot;BUTTON&quot;\,&quot;name&quot;:&quot;button1675067564294&quot;}}\,{&quot;nodeName&quot;:&quot;EVENT_AND_COMPARISON_OPERATOR&quot;\,&quot;choice&quot;:{&quot;nodeName&quot;:&quot;is clicked&quot;\,&quot;value&quot;:null}}\,{&quot;nodeName&quot;:&quot;PRIMITIVE_EXPRESSION&quot;\,&quot;choice&quot;:null}]}\,&quot;nested&quot;:false}\,{&quot;nodeName&quot;:&quot;Then&quot;\,&quot;value&quot;:null}\,{&quot;nodeName&quot;:&quot;BLOCK_STATEMENTS&quot;\,&quot;items&quot;:[{&quot;nodeName&quot;:&quot;BLOCK_STATEMENT&quot;\,&quot;choice&quot;:{&quot;nodeName&quot;:&quot;NAVIGATE_TO&quot;\,&quot;items&quot;:[{&quot;nodeName&quot;:&quot;URL_LITERAL&quot;\,&quot;value&quot;:&quot;https://www.google.com&quot;}\,{&quot;nodeName&quot;:&quot;in&quot;\,&quot;value&quot;:null}\,{&quot;nodeName&quot;:&quot;NAVIGATE_METHOD_OPTIONS&quot;\,&quot;choice&quot;:{&quot;nodeName&quot;:&quot;NEW_WINDOW&quot;\,&quot;items&quot;:[]}}]}}]}]}}]\,&quot;isValid&quot;:true\,&quot;enabled&quot;:true\,&quot;version&quot;:1\,&quot;script&quot;:[&quot;navigateTo('https://www.google.com'\, '_newwindow')&quot;]\,&quot;eventName&quot;:&quot;Click&quot;\,&quot;ruleType&quot;:&quot;&quot;\,&quot;description&quot;:&quot;&quot;}]"
jcr:primaryType="nt:unstructured"
validationStatus="valid"/>
<fd:events
jcr:primaryType="nt:unstructured"
click="[navigateTo('https://www.google.com'\, '_newwindow')]"/>
</button-5>
</guideContainer>
</jcr:content>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="sling:Folder"
hidden="true"/>
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
jcr:primaryType="cq:Page">
<jcr:content
cq:deviceGroups="[mobile/groups/responsive]"
cq:lastModified="{Date}2021-12-02T15:12:59.900+05:30"
cq:lastModified="{Date}2024-09-03T15:12:59.900+05:30"
cq:lastModifiedBy="admin"
cq:template="/conf/core-components-examples/settings/wcm/templates/af-blank-v2"
jcr:language="en"
jcr:primaryType="cq:PageContent"
jcr:title="Adaptive Form V2 (IT)"
sling:resourceType="forms-components-examples/components/page">
sling:resourceType="forms-core-components-it/components/page-buttonv2">
<guideContainer
fd:version="2.1"
fieldType="form"
Expand All @@ -23,7 +23,7 @@
jcr:title="button-1"
enabled="{Boolean}true"
visible="{Boolean}true"
sling:resourceType="forms-components-examples/components/form/button"/>
sling:resourceType="core/fd/components/form/button/v2/button"/>
<button-2
aria-label="basic-button"
type="button"
Expand All @@ -33,7 +33,7 @@
fieldType="button"
enabled="{Boolean}false"
visible="{Boolean}true"
sling:resourceType="forms-components-examples/components/form/button"/>
sling:resourceType="core/fd/components/form/button/v2/button"/>
<button-3
class="cmp-button"
data-cmp-is="adaptiveFormButton"
Expand All @@ -45,7 +45,7 @@
fieldType="button"
enabled="{Boolean}true"
visible="{Boolean}false"
sling:resourceType="forms-components-examples/components/form/button"/>
sling:resourceType="core/fd/components/form/button/v2/button"/>
<button-4
description="This is long description"
tooltip="This is short description"
Expand All @@ -58,13 +58,13 @@
fieldType="button"
enabled="{Boolean}true"
visible="{Boolean}true"
sling:resourceType="forms-components-examples/components/form/button"/>
sling:resourceType="core/fd/components/form/button/v2/button"/>
<button-5
jcr:lastModified="{Date}2023-01-30T14:02:55.708+05:30"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="Navigate"
sling:resourceType="forms-components-examples/components/form/button"
sling:resourceType="core/fd/components/form/button/v2/button"
dorExclusion="true"
fieldType="button"
name="button1675067564294">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured">
<reset/>
</jcr:root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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"
cq:icon="revert"
jcr:description="Reset Button"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Reset Button (v2)"
sling:resourceSuperType="core/fd/components/form/button/v2/button"
componentGroup=".core-adaptiveform"/>
Loading

0 comments on commit 77886e9

Please sign in to comment.