+ jcr:title="Password"/>
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
index 27631c55e6..50764aff9f 100644
--- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/.content.xml
@@ -3,4 +3,4 @@
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[core.forms.components.password.v1.runtime]"
- dependencies="[core.forms.components.runtime.base,core.forms.components.container.v2.runtime]"/>
+ dependencies="[core.forms.components.runtime.base]"/>
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
index 966dd5f42b..54d4b4ba2e 100644
--- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/clientlibs/site/js/passwordview.js
@@ -87,17 +87,19 @@
});
}
- #togglePasswordType(){
- const widget = this.getWidget();
- if(widget.value){
- const widget = this.getWidget();
- if (widget.type === "password") {
- widget.type = "text";
- } else {
- widget.type = "password";
- }
- }
- }
+ #togglePasswordType(){
+ const widget = this.getWidget();
+ if(widget.value){
+ const widget = this.getWidget();
+ if (widget.type === "password") {
+ widget.type = "text";
+ this.getEyeIcon().classList.add('open');
+ } else {
+ widget.type = "password";
+ this.getEyeIcon().classList.remove('open');
+ }
+ }
+ }
}
FormView.Utils.setupField(({element, formContainer}) => {
diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
index 21f798bd59..0ddf556261 100644
--- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
+++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/password/v1/password/password.html
@@ -48,7 +48,7 @@
placeholder="${password.placeHolder}"
pattern="${password.validationPattern}"
dir="auto"
- aria-label="password" />
+ aria-label="${password.label.visible != false ? '' : password.label.value}" />
diff --git a/ui.frontend/src/constants.js b/ui.frontend/src/constants.js
index 7b6ad2a910..a74dc91e20 100644
--- a/ui.frontend/src/constants.js
+++ b/ui.frontend/src/constants.js
@@ -374,7 +374,7 @@ export const Constants = {
* @memberof module:FormView~Constants
* @namespace FIELD_TYPE
*/
- FIELD_TYPE: FIELD_TYPE
+ FIELD_TYPE: FIELD_TYPE,
/**
* Html input type text
diff --git a/ui.tests/test-module/specs/password/password.authoring.spec.js b/ui.tests/test-module/specs/password/password.authoring.cy.js
similarity index 97%
rename from ui.tests/test-module/specs/password/password.authoring.spec.js
rename to ui.tests/test-module/specs/password/password.authoring.cy.js
index e35344b029..a6e4552e99 100644
--- a/ui.tests/test-module/specs/password/password.authoring.spec.js
+++ b/ui.tests/test-module/specs/password/password.authoring.cy.js
@@ -53,7 +53,7 @@ describe('Page - Authoring', function () {
cy.get(".cmp-adaptiveform-password__minlength").invoke('css', 'display').should('equal', 'block');
cy.get(".cmp-adaptiveform-base__placeholder").parent('div').invoke('css', 'display').should('equal', 'block');
cy.get('.cmp-adaptiveform-password__editdialog').contains('Validation').click({force: true}).then(() => {
- cy.get("[name='./validationPattern']").should('have.length', 1);
+ cy.get("[name='./pattern']").should('have.length', 1);
cy.get("[name='./validatePictureClauseMessage']").should('have.length', 1);
cy.get('.cq-dialog-cancel').click();
cy.deleteComponentByPath(passwordDrop);
@@ -82,7 +82,7 @@ describe('Page - Authoring', function () {
// Check If Dialog Options Are Visible
cy.get(".cmp-adaptiveform-base__editdialogbasic [name='./name']")
.should("exist")
- .should("have.value", "password_copy_1");
+ .should("have.value", "Password_copy_1");
cy.get("coral-dialog.is-open coral-dialog-footer button[variant='default']").click();
cy.deleteComponentByPath(passwordDrop);
cy.deleteComponentByPath(passwordDrop + "_copy");
@@ -117,7 +117,7 @@ describe('Page - Authoring', function () {
testPasswordBehaviour(passwordEditPathSelector, passwordDrop);
})
- it.skip('pasted component should have unique name', function () {
+ it('pasted component should have unique name', function () {
testCopyPasteComponent(passwordEditPathSelector, passwordEditPathSelectorCopy, passwordDrop);
})
})
diff --git a/ui.tests/test-module/specs/password/password.runtime.spec.js b/ui.tests/test-module/specs/password/password.runtime.cy.js
similarity index 94%
rename from ui.tests/test-module/specs/password/password.runtime.spec.js
rename to ui.tests/test-module/specs/password/password.runtime.cy.js
index 236da69a6a..7163223cf1 100644
--- a/ui.tests/test-module/specs/password/password.runtime.spec.js
+++ b/ui.tests/test-module/specs/password/password.runtime.cy.js
@@ -158,5 +158,12 @@ describe("Form Runtime with Password", () => {
})
})
+
+ it("should show required error message on entering wrong validation pattern of password", () =>{
+ const [passwordbox11, passwordbox11FieldView] = Object.entries(formContainer._fields)[10];
+ cy.get(`#${passwordbox11}`).find("input").clear().type(1).blur().then(x => {
+ cy.get(`#${passwordbox11}`).find(".cmp-adaptiveform-password__errormessage").should('have.text',"Please enter valid password")
+ })
+ })
})