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

FORMS-13851 Support for language in date picker and number input #1169

Merged
merged 10 commits into from
Apr 18, 2024

Conversation

rismehta
Copy link
Collaborator

@rismehta rismehta commented Apr 8, 2024

@review @vdua
DOD(Yes)

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.

@rismehta rismehta changed the title FORMS-13851 Support for language in date picker and number input [WIP] FORMS-13851 Support for language in date picker and number input Apr 8, 2024
@rismehta rismehta changed the title [WIP] FORMS-13851 Support for language in date picker and number input FORMS-13851 Support for language in date picker and number input Apr 11, 2024
@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 90 100 100 73

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
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
landmark-one-main moderate
region moderate
target-size serious

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 80.81%. Comparing base (06d1f11) to head (a9a058b).

Files Patch % Lines
...obe/cq/forms/core/components/models/form/Base.java 0.00% 1 Missing ⚠️
...rms/core/components/models/form/FormContainer.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #1169      +/-   ##
============================================
+ Coverage     80.75%   80.81%   +0.05%     
- Complexity      773      782       +9     
============================================
  Files            91       91              
  Lines          2110     2116       +6     
  Branches        285      286       +1     
============================================
+ Hits           1704     1710       +6     
  Misses          252      252              
  Partials        154      154              

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

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 92 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
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
landmark-one-main moderate
region moderate
target-size serious

ContentPolicy policy = ComponentUtils.getPolicy((String) request.getAttribute(Value.CONTENTPATH_ATTRIBUTE),
resourceResolver);
resources.add(getResourceForDropdownDisplay(resourceResolver, "Select", ""));
if (policy != null) {
ValueMap props = policy.getProperties();
if (props != null) {
for (Map.Entry<String, Object> entry : props.entrySet()) {
if (entry.getKey().startsWith(ALLOWED_FORMAT)) {
if ((type.equals(FormMetaDataType.FORMATTERS) && entry.getKey().startsWith(ALLOWED_FORMAT)) ||
(type.equals(FormMetaDataType.LANG) && entry.getKey().startsWith(FormMetaDataType.LANG.getValue()))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest making private functions and using that here for readability, something like below

if (isFormattersPolicy(type, entry) || isLangPolicy(type, entry))

@@ -17,6 +17,8 @@
"enabled": false,
"readOnly": true,
"required": false,
"lang" : "it-IT",
"langDisplayValue" : "it-IT",
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is langDisplayValue ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is internal JCR structure of lang, since we have a drop down which does listing of all the OOTB lang and there is another text box which stores the value, hence there are two properties

cy.get(`#${numberInput6}`).find("input").clear().type(input).blur().then(x => {
expect(Number(model.getState().value)).to.equal(Number(input));
// Assert that the input value contains "121" and "212,000" regardless of the space type
cy.get(`#${numberInput6}`).find('input').invoke('val').should('match', /121.*212,000/);
Copy link
Collaborator

Choose a reason for hiding this comment

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

value should be 121.121,00 why are we using regex to match it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is some space in the display pattern, hence a regex is required to match

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally space should not come. With space the the correct regex should be 121\.\s*121,000

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed it.

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 93 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
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
landmark-one-main moderate
region moderate
target-size serious

@rismehta
Copy link
Collaborator Author

Merging since this is reviewed by @vdua

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 95 100 100 73

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 100 100 73

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
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
landmark-one-main moderate
region moderate
target-size serious

@rismehta rismehta merged commit c770451 into dev Apr 18, 2024
11 checks passed
@rismehta rismehta deleted the fieldlang branch April 18, 2024 04:44
Copy link
Contributor

@sakshi-arora1 sakshi-arora1 left a comment

Choose a reason for hiding this comment

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

In AF v1, this was supported by picture clause which gets honoured in DoR as well, the changes you did will create an inconsistency between web state (af) and DoR.
cc: @rismehta @vdua

github-actions bot pushed a commit that referenced this pull request Apr 18, 2024
* FORMS-13851 Support for language in date picker and number input
@review @vdua
DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
    @review @vdua
    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
        @review @vdua
        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
            @review @vdua
            DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                @review @vdua
                DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                    @review @vdua
                    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                        @review @vdua
                        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                            @review @vdua
                            DOD(Yes)

* Update space character for thousands separator in french lang

* FORMS-13851 Support for language in date picker and number input
                                @review @vdua
                                DOD(Yes)

---------

Co-authored-by: Varun Dua <vdua@adobe.com>
github-actions bot pushed a commit that referenced this pull request May 7, 2024
* FORMS-13851 Support for language in date picker and number input
@review @vdua
DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
    @review @vdua
    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
        @review @vdua
        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
            @review @vdua
            DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                @review @vdua
                DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                    @review @vdua
                    DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                        @review @vdua
                        DOD(Yes)

* FORMS-13851 Support for language in date picker and number input
                            @review @vdua
                            DOD(Yes)

* Update space character for thousands separator in french lang

* FORMS-13851 Support for language in date picker and number input
                                @review @vdua
                                DOD(Yes)

---------

Co-authored-by: Varun Dua <vdua@adobe.com>
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.

None yet

4 participants