-
Notifications
You must be signed in to change notification settings - Fork 61
Adding Password Component #1946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shravani-0811
wants to merge
2
commits into
master
Choose a base branch
from
password-component
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,18 @@ default boolean isMultiLine() { | |
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Returns {@code true} if the password show/hide visibility toggle should be rendered, otherwise {@code false}. | ||
| * Only relevant when the field's {@code fieldType} is {@code password}. | ||
| * | ||
| * @return {@code true} if the visibility toggle should be rendered, otherwise {@code false} | ||
| * @since com.adobe.cq.forms.core.components.models.form 2.0.0 | ||
| */ | ||
| @JsonIgnore | ||
| default boolean isShowHidePasswordEnabled() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be json ignore, might be required in headless, this should be fd: prefixed, since it is OOTB property |
||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * Returns {@code "off"} if autocomplete if disabled, otherwise {@code "on"} or values listed @see | ||
| * <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete">here</a> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
bundles/af-core/src/test/resources/form/textinput/exporter-password-textinput.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "id": "passwordinput-5c6da9d601", | ||
| "fieldType": "password", | ||
| "name": "abc", | ||
| "type": "string", | ||
| "minLength": 8, | ||
| "maxLength": 20, | ||
| "label": { | ||
| "value": "def" | ||
| }, | ||
| "properties": { | ||
| "fd:path": "/content/password-textinput" | ||
| }, | ||
| "events": { | ||
| "custom:setProperty": [ | ||
| "$event.payload" | ||
| ] | ||
| }, | ||
| ":type": "core/fd/components/form/passwordinput/v1/passwordinput" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ontent/jcr_root/apps/forms-components-examples/components/form/passwordinput/.content.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: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 Password Input" | ||
| jcr:description="Add a field to capture passwords, with an optional show/hide toggle." | ||
| sling:resourceSuperType="core/fd/components/form/passwordinput/v1/passwordinput" | ||
| componentGroup="Core Components Examples - Adaptive Form"/> |
6 changes: 6 additions & 0 deletions
6
...nt/jcr_root/apps/forms-components-examples/components/form/passwordinput/_cq_template.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?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" xmlns:cq="http://www.day.com/jcr/cq/1.0" | ||
| jcr:primaryType="nt:unstructured" | ||
| jcr:title="Password Input" | ||
| autocomplete="new-password" | ||
| fieldType="password"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
...cr_root/content/core-components-examples/library/adaptive-form/passwordinput/.content.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| <?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:lastModified="{Date}2026-07-29T00:00:00.000+00:00" | ||
| cq:lastModifiedBy="admin" | ||
| cq:tags="[]" | ||
| cq:template="/conf/core-components-examples/settings/wcm/templates/content-page" | ||
| jcr:description="Password Input" | ||
| jcr:primaryType="cq:PageContent" | ||
| jcr:title="Password Input" | ||
| sling:resourceType="forms-components-examples/components/page"> | ||
| <root | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="wcm/foundation/components/responsivegrid"> | ||
| <responsivegrid | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="wcm/foundation/components/responsivegrid"> | ||
| <text_1740702242 | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core/wcm/components/text/v2/text" | ||
| text="<h1>Password Input<sub>v1</sub></h1>" | ||
| textIsRich="true"/> | ||
| <text | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core/wcm/components/text/v2/text" | ||
| text="<p>The Adaptive Form Password Input Core Component is used to collect passwords from users. It renders a masked text box with an optional show/hide visibility toggle button, and supports the same length and pattern validations as the Text Input component.</p>" | ||
| textIsRich="true"/> | ||
| <teaser | ||
| jcr:primaryType="nt:unstructured" | ||
| jcr:description="<p>GitHub</p>
" | ||
| jcr:title="Technical Documentation" | ||
| sling:resourceType="core-components-examples/components/teaser" | ||
| actionsEnabled="false" | ||
| descriptionFromPage="false" | ||
| fileReference="/content/dam/core-components-examples/library/github-logo.svg" | ||
| linkURL="https://github.com/adobe/aem-core-forms-components/tree/master/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/passwordinput/v1/passwordinput" | ||
| textIsRich="true" | ||
| titleFromPage="false"/> | ||
| <title_865328581 | ||
| jcr:primaryType="nt:unstructured" | ||
| jcr:title="Examples" | ||
| sling:resourceType="core/wcm/components/title/v2/title" | ||
| type="h2"/> | ||
| <title_290384409 | ||
| jcr:primaryType="nt:unstructured" | ||
| jcr:title="Standard" | ||
| sling:resourceType="core/wcm/components/title/v2/title" | ||
| type="h3"/> | ||
| <text_1337506762 | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core/wcm/components/text/v2/text" | ||
| text="<p>A simple Password Input with the show/hide toggle enabled.</p>" | ||
| textIsRich="true"/> | ||
| <demo | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="forms-components-examples/components/demo"> | ||
| <component | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="forms-components-examples/components/demo/component"> | ||
| <guideContainer | ||
| fd:version="2.1" | ||
| fieldType="form" | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="forms-components-examples/components/form/container"> | ||
| <container | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="forms-components-examples/components/demo/component"> | ||
| <passwordinput_demo | ||
| jcr:title="Password" | ||
| fieldType="password" | ||
| jcr:primaryType="nt:unstructured" | ||
| description="<p>This is a long description.</p>" | ||
| tooltip="<p>This is a short description.</p>" | ||
| tooltipVisible="true" | ||
| minLength="{Long}8" | ||
| showHidePassword="{Boolean}true" | ||
| sling:resourceType="forms-components-examples/components/form/passwordinput"/> | ||
| </container> | ||
| </guideContainer> | ||
| </component> | ||
| <info | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core-components-examples/components/tabs"> | ||
| <properties | ||
| cq:panelTitle="Properties" | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core-components-examples/components/demo/properties" | ||
| reference="../../component/guideContainer/container"/> | ||
| <markup | ||
| cq:panelTitle="Markup" | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core-components-examples/components/demo/markup" | ||
| reference="../../component/guideContainer/container"/> | ||
| <json | ||
| cq:panelTitle="JSON" | ||
| jcr:primaryType="nt:unstructured" | ||
| sling:resourceType="core-components-examples/components/demo/json" | ||
| reference="../../component/guideContainer/container"/> | ||
| </info> | ||
| </demo> | ||
| </responsivegrid> | ||
| </root> | ||
| </jcr:content> | ||
| </jcr:root> |
7 changes: 7 additions & 0 deletions
7
..._root/content/dam/formsanddocuments/core-components-it/samples/passwordinput/.content.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| /> |
20 changes: 20 additions & 0 deletions
20
...content/dam/formsanddocuments/core-components-it/samples/passwordinput/basic/.content.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?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: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> |
5 changes: 5 additions & 0 deletions
5
...n/content/jcr_root/content/forms/af/core-components-it/samples/passwordinput/.content.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"/> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should create something specific for password, with time, if we enhance password, contract might be leaked into text/telephone etc