Skip to content

Conversation

@pavi41
Copy link
Contributor

@pavi41 pavi41 commented Jun 27, 2024

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.

@codecov
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.68%. Comparing base (2a3af21) to head (c65f065).

Files Patch % Lines
...omponents/internal/models/v2/form/TitleImplV2.java 80.64% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #1292      +/-   ##
============================================
+ Coverage     81.67%   81.68%   +0.01%     
- Complexity      853      873      +20     
============================================
  Files            97       99       +2     
  Lines          2259     2293      +34     
  Branches        304      312       +8     
============================================
+ Hits           1845     1873      +28     
- Misses          255      257       +2     
- Partials        159      163       +4     

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

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 96 100 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 100 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

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 100 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 96 100 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.

Lots of issues. Please check comments, I will do another review in the next iteration

* Retrieves the text value to be displayed.
*
* @return the text value to be displayed, or {@code null} if no value can be returned
* @since com.adobe.cq.forms.core.components.models.form 0.0.1;
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 java docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

// import com.adobe.cq.forms.core.components.models.form.BaseConstraint.Type;

@ConsumerType
public interface FormTitle extends FormComponent {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please mention in comments on why this was copied from WCM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

// import com.adobe.cq.forms.core.components.models.form.BaseConstraint.Type;

@ConsumerType
public interface FormTitle extends FormComponent {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add java doc for all functions, interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented!

* @return the element type
* @since com.adobe.cq.forms.core.components.models.form 0.0.1;
*/
default String getFormat() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should rename this to getHTMLElementType rather than format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented!

* Returns the HTML element type (h1-h6) used for the markup.
*
* @return the element type
* @since com.adobe.cq.forms.core.components.models.form 0.0.1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please bump package-info file and update the version here accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!


@Override
public String getName() {
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name is mandatory if a component is a form component, please check other implementation. We should also expose this in dialog

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented!

Copy link
Collaborator

@vdua vdua Jul 10, 2024

Choose a reason for hiding this comment

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

Why the title component should have a name. We have the chance to enable unnamed fields now, though we do not need to expose it but we can fix in our code wherever we have a hard restriction on name property

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the title component should have a name. We have the chance to enable unnamed fields now, though we do not need to expose it but we can fix in our code wherever we have a hard restriction on name property

In the core components, the name is mandatory as per the initial design, even though af-core does not enforce this requirement. While we can remove the name from the title component, doing so would prevent dynamic changes to the title component's text. Currently, we don't have a use case for this dynamic capability, so I'm okay with not implementing it.

@ScriptVariable(injectionStrategy = InjectionStrategy.OPTIONAL)
@JsonIgnore
@Nullable
private Style currentStyle;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add current style in AbstractFormComponent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented!

private Resource resource;

@ScriptVariable(injectionStrategy = InjectionStrategy.OPTIONAL)
@JsonIgnore
Copy link
Collaborator

Choose a reason for hiding this comment

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

JsonIgnore should be part of getters, you don't need it 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.

Done!


@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "format")
@Nullable
private String format;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should only inject things required for title here, other base properties/method should derive from parent class

@Nullable
private String title;

@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "format")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename this, and add it in the ReservedProperties class, you can check other class for references

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented!

@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

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

@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

cy.get(titlePolicy).click({force: true});
cy.get(bemDesignDialog).contains('Title').click();
cy.get('[name="./type"]').eq(0).click({ force: true }).then(() => {
cy.get('._coral-Menu-item').contains(defaultValue).click({ force: true });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't make use of private coral selectors in the spec, the spec would break in release/650

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed!

cy.get('[placeholder="New policy"]').eq(1).type("Default policy");
cy.get('[title="Done"]').click();
}).then(() => {
cy.openSiteAuthoring(authoringPagePath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you improve the test case to make use of the policy configured in design dialog in the form editor via title's edit dialog ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

});

it('check edit dialog availability of Title', function () {
testTitleEditDialog(titleEditPathSelector, titleDrop, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can also write a runtime test case for v2 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

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.

check comments

@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

@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

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

@rismehta rismehta merged commit 22b0a56 into dev Aug 6, 2024
@rismehta rismehta deleted the title/fieldtype branch August 6, 2024 10:23
dmaurya929 pushed a commit that referenced this pull request Aug 13, 2024
Co-authored-by: Pavitra Khatri <pavitrakhatri@Pavitras-MacBook-Pro.local>
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.

5 participants