-
Notifications
You must be signed in to change notification settings - Fork 64
V2 version of Title #1292
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
V2 version of Title #1292
Conversation
d40f36f to
14748ed
Compare
e8c1722 to
4f21f01
Compare
Codecov ReportAttention: Patch coverage is
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. |
f679b33 to
a6b6486
Compare
b5a4af3 to
cad143c
Compare
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
b5a4af3 to
c59cd3a
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
rismehta
left a comment
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.
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; |
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.
Please fix the java docs
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.
Done!
| // import com.adobe.cq.forms.core.components.models.form.BaseConstraint.Type; | ||
|
|
||
| @ConsumerType | ||
| public interface FormTitle extends FormComponent { |
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.
Please mention in comments on why this was copied from WCM
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.
Done!
| // import com.adobe.cq.forms.core.components.models.form.BaseConstraint.Type; | ||
|
|
||
| @ConsumerType | ||
| public interface FormTitle extends FormComponent { |
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.
Please add java doc for all functions, interfaces
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.
Implemented!
| * @return the element type | ||
| * @since com.adobe.cq.forms.core.components.models.form 0.0.1; | ||
| */ | ||
| default String getFormat() { |
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.
We should rename this to getHTMLElementType rather than format
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.
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; |
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.
Please bump package-info file and update the version here accordingly
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.
Done!
|
|
||
| @Override | ||
| public String getName() { | ||
| return null; |
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.
Name is mandatory if a component is a form component, please check other implementation. We should also expose this in dialog
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.
Implemented!
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.
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
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.
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; |
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.
Add current style in AbstractFormComponent
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.
Implemented!
| private Resource resource; | ||
|
|
||
| @ScriptVariable(injectionStrategy = InjectionStrategy.OPTIONAL) | ||
| @JsonIgnore |
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.
JsonIgnore should be part of getters, you don't need it here
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.
Done!
|
|
||
| @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "format") | ||
| @Nullable | ||
| private String format; |
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.
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") |
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.
Please rename this, and add it in the ReservedProperties class, you can check other class for references
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.
Implemented!
09eae89 to
1263e84
Compare
c7f77a7 to
07003d2
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
13a8f0e to
32d5ec6
Compare
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
| 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 }); |
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.
Please don't make use of private coral selectors in the spec, the spec would break in release/650
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.
Removed!
| cy.get('[placeholder="New policy"]').eq(1).type("Default policy"); | ||
| cy.get('[title="Done"]').click(); | ||
| }).then(() => { | ||
| cy.openSiteAuthoring(authoringPagePath); |
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.
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 ?
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.
Done!
| }); | ||
|
|
||
| it('check edit dialog availability of Title', function () { | ||
| testTitleEditDialog(titleEditPathSelector, titleDrop, true); |
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.
Can also write a runtime test case for v2 ?
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.
Done!
rismehta
left a comment
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.
check comments
d912437 to
16ee208
Compare
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
b5d4555 to
c65f065
Compare
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Co-authored-by: Pavitra Khatri <pavitrakhatri@Pavitras-MacBook-Pro.local>
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: