Skip to content
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

Password comp #1316

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Password comp #1316

wants to merge 10 commits into from

Conversation

devgurjar
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.50%. Comparing base (93cf3b0) to head (4747ab8).

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #1316      +/-   ##
============================================
+ Coverage     82.38%   82.50%   +0.12%     
- Complexity      946      959      +13     
============================================
  Files           105      106       +1     
  Lines          2430     2447      +17     
  Branches        332      334       +2     
============================================
+ Hits           2002     2019      +17     
  Misses          260      260              
  Partials        168      168              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 91 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the new field type in this PR ? Please sync with talmiz on this

@devgurjar
Copy link
Contributor Author

Can we use the new field type in this PR ? Please sync with talmiz on this

Yes we have used new field type in this PR, please refer to this commit
https://git.corp.adobe.com/livecycle/af2-docs/pull/211/files#diff-a2a39757552dd1988f477b116329eba154e51bff6f2530d575b16fe6c76cd833R192

@devgurjar
Copy link
Contributor Author

For opening and closing eye icon, we have changed code in theme
adobe/aem-forms-theme-canvas@17c7b85

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the comments, and only request a review once everything has been verified.

* @since com.adobe.cq.forms.core.components.models.form 5.9.6
*/
@ConsumerType
public interface Password extends Field, StringConstraint, NumberConstraint {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Password cannot have number constraint, please fix this. If you check the dialog, these number constraint properties are not present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed numberConstraint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component was written initially by ACS back in 2023. Just trying to fix it for completion purpose.

},
"number-password" : {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType" : "core/fd/components/form/textinput/v1/textinput",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this text input ? Also there is nothing called number password

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was added to cover methods coming from numberContraint, as I have removed it so no longer required. Removed from json as well

},
":type": "forms-components-examples/components/form/password"
},
"number-password-exclusive" : {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need so many content ? Looks like it is copy pasted from text input, let's only have relevant bits here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was added to cover methods coming from numberContraint, as I have removed it so no longer required. Removed from json as well

@@ -0,0 +1,45 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern we follow with exporter is that it should match the corresponding content from test-content.json, in this case, exporter-password-customer.json should match password-customized test content structure, whereas you have not done that. How did the test case even pass ?

"id": "password-477c777f4e",
"fieldType": "password",
"name": "password1708629052628",
"visible": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added these exporters, but there are no corresponding test cases (e.g., testJSONExport). Every file that's checked in should serve a specific purpose. Please ensure that everything is thoroughly verified before requesting a PR review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two new tests testExportedType and testJSONExport.

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 93 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still lot of issues. check comments

}

@PostConstruct
private void initTextInput() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be named as initPassword and not initTextInput

* @since com.adobe.cq.forms.core.components.models.form 5.9.6
*/
@ConsumerType
public interface Password extends Field, StringConstraint {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the version and bump package-info file

"readOnly": false,
"minLength": 5,
"maxLength": 10,
"maximum" : 16,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can the exporter have maximum and minimum values when it's not part of the interface? Is this test even functioning properly? Please ensure such issues are verified before requesting a re-review.

"id": "password-91417957c6",
"fieldType": "password",
"name": "password1732174214265",
"visible": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't add the default values for many properties to keep the JSON payload minimal. Its only added if its part of JCR, as per the following code, https://github.com/adobe/aem-core-forms-components/blob/master/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java#L241

Please verify this

Also, if it isn't working for other components fix the same.

@@ -0,0 +1,26 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’ve made the same mistake I highlighted in the previous review—these files are not even in used in the test (while it should have being)

Why did you request a re-review when the issue from my earlier comment has still not been addressed?

cq:lastModified="{Date}2024-03-12T12:04:40.719+05:30"
cq:lastModifiedBy="admin"
cq:template="/conf/core-components-examples/settings/wcm/templates/content-page"
jcr:description="Text Input"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the description Text Input when this is a password component ? Can you please fix these things at other places as well

jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/text/v2/text"
text="<p>A text input (text box) component allows a user to enter and edit a single or multiple lines of text, depending on the type attribute of the input element. The text input component can be placed within a form and is usually labeled with a helpful text that easily identifies its purpose.</p><p>These text input fields can be used in a variety of ways, such as for collecting information like names, email addresses, phone numbers, and other types of text data. Additionally, the text input component can have additional functionality, styling, and accessibility features that can make it more user-friendly, efficient and accessible.</p>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description should be as per password component, it still refers text input. Please sync with CHL team for this

By placing the class names `cmp-adaptiveform-password__label` and `cmp-adaptiveform-password__questionmark` within the `cmp-adaptiveform-password__label-container` class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements.

## Replace feature:
We support replace feature that allows replacing Password component to any of the below components:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified replace with all these components ?

}

#togglePasswordType(){
const widget = this.getWidget();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the indentation

* Html input type text
* @type {string}
*/
HTML_INPUT_TYPE_TEXT : "text",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this constant in public namespace, this file is exposed to customers, I don't think we need such constants for something we don't own ? Please have it inline in place where it is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants