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

Fix "pattern" UI Component validation #11565

Merged
merged 1 commit into from
Oct 20, 2017
Merged

Conversation

bap14
Copy link

@bap14 bap14 commented Oct 19, 2017

Description

Convert param string to regular expression using constructor and test on the RegExp object.

Fixed Issues (if relevant)

  1. Pattern Validation via UI Component Fails to Interpret String as RegEx Pattern #9919: Pattern Validation via UI Component Fails to Interpret String as RegEx Pattern

Manual testing scenarios

  1. Create a custom UI Component form

  2. Add a validation item to an input field

  3. Specify a pattern validation rule with a custom regular expression pattern. E.g.

     <item name="validation" xsi:type="array">
         <item name="required-entry" xsi:type="boolean">true</item>
         <item name="no-whitespace" xsi:type="boolean">true</item>
         <item name="pattern" xsi:type="string">^[a-zA-Z][a-zA-Z0-9_.-]{3,}$</item>
     </item>
    
  4. View form in admin browser and enter valid and invalid values (e.g. 3sdf and asd3)

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Convert `param` string to regular expression using constructor and test on the `RegExp` object.
@vrann vrann self-assigned this Oct 20, 2017
@vrann vrann added this to the October 2017 milestone Oct 20, 2017
@vrann vrann added Release Line: 2.2 2.2.x bug report Area: Frontend Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 20, 2017
@magento-team magento-team merged commit 7b0e90a into magento:2.2-develop Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend bug report Progress: accept Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants