Skip to content

Commit

Permalink
Fixing flaky test (adobe#1312)
Browse files Browse the repository at this point in the history
* Fixing flaky test

* updating quickstart docker

* Fixing flaky test
  • Loading branch information
rismehta authored and kum-sushil committed Jan 14, 2025
1 parent 57c8c09 commit 0da36ae
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@ private FormConstants() {

/* The resource type for the pre-selected the linked panel */
public final static String RT_FD_FORM_REVIEW_DATASOURCE_V1 = RT_FD_FORM_PREFIX + "review/v1/datasource";

public static final String RT_FD_FORM_PASSWORD_V1 = RT_FD_FORM_PREFIX + "password/v1/password";
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class PasswordImpl extends AbstractFieldImpl implements Password {

@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
@Nullable
private String validationPattern;
private String pattern;

@Override
public String getFieldType() {
Expand All @@ -64,38 +64,18 @@ public Integer getMaxLength() {
return maxLength;
}

@Override
public Long getMinimum() {
return minimum;
}

@Override
public Long getMaximum() {
return maximum;
}

@Override
public String getFormat() {
return displayFormat;
}

@Override
public String getValidationPattern() {
return validationPattern;
}

@Override
public Long getExclusiveMaximum() {
return (Long) exclusiveMaximumValue;
}

@Override
public Long getExclusiveMinimum() {
return (Long) exclusiveMinimumVaue;
public String getPattern() {
return pattern;
}

@PostConstruct
private void initTextInput() {
private void initPassword() {
exclusiveMaximumValue = ComponentUtils.getExclusiveValue(exclusiveMaximum, maximum, null);
exclusiveMinimumVaue = ComponentUtils.getExclusiveValue(exclusiveMinimum, minimum, null);
// in json either, exclusiveMaximum or maximum should be present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,16 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

package com.adobe.cq.forms.core.components.models.form;
package com.adobe.cq.forms.core.components.models.form;

import org.osgi.annotation.versioning.ConsumerType;

/**
* Interface for {@code Password} Sling Model used for the {@code /apps/core/fd/components/form/password/v1/password} component.
*
* @since com.adobe.cq.forms.core.components.models.form 2.0.0
*/
@ConsumerType
public interface Password extends Field, StringConstraint, NumberConstraint {

/**
* Returns the validation pattern (regex) for the password field.
*
* @return the validation pattern
* @since com.adobe.cq.forms.core.components.models.form 2.0.0
*/
String getValidationPattern();

}
import org.osgi.annotation.versioning.ConsumerType;

/**
* Interface for {@code Password} Sling Model used for the {@code /apps/core/fd/components/form/password/v1/password} component.
*
* @since com.adobe.cq.forms.core.components.models.form 5.11.0
*/
@ConsumerType
public interface Password extends Field, StringConstraint {

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
fieldLabel="Default value"
name="./default"
sling:hideResource="{Boolean}true"
wrapperClass="cmp-adaptiveform-password__value"/>

wrapperClass="cmp-adaptiveform-password__value"/>
</items>
</column>
</items>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
.cmp-adaptiveform-password__questionmark {

}


Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

#base=js
passwordview.js
togglepasswordvisibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*******************************************************************************
* 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.
******************************************************************************/

$(document).ready(function() {
$(document).on('click', '.ssnField .fisheye', function() {
var type = $(".ssnField").find("input").attr("type");
if (type == "text") {
$(".ssnField").find("input").attr("type", "password");
}

if (type == "password") {
$(".ssnField").find("input").attr("type", "text");
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
</div>
<div data-sly-call="${longDescription.longDescription @componentId=password.id, longDescription=password.description, bemBlock='cmp-adaptiveform-password'}" data-sly-unwrap></div>
<div data-sly-call="${errorMessage.errorMessage @componentId=password.id, bemBlock='cmp-adaptiveform-password'}" data-sly-unwrap></div>
</div>
</div>

0 comments on commit 0da36ae

Please sign in to comment.