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(validation): support multilines regex #466
Conversation
Code Climate has analyzed commit ecdf652 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (45% is the threshold). This pull request will bring the total coverage in the repository to 38.2%. View more on Code Climate. |
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.
✅ Code review
✅ Automatic tests
✅ Manual tests
Great work on this one. 🥇
@@ -479,7 +479,7 @@ def add_validations(column_schema, column) | |||
regex = value.source | |||
|
|||
# NOTICE: Transform a Ruby regex into a JS one | |||
regex = regex.sub('\\A' , '^').sub('\\Z' , '$').sub('\\z' , '$') | |||
regex = regex.sub('\\A' , '^').sub('\\Z' , '$').sub('\\z' , '$').gsub(/\n+|\s+/, '') |
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.
The fix 🏆 !
|
||
uri_field = collection.fields.find { |field| field[:field] == 'uri' } | ||
uri_regex_validation = uri_field[:validations].find { |validation| validation[:type] == "is like"} | ||
expect(uri_regex_validation[:value].match('\n')).to eq(nil) |
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.
🤝
## [6.3.8](v6.3.7...v6.3.8) (2021-05-26) ### Bug Fixes * **validation:** support multilines regex ([#466](#466)) ([1daf0b1](1daf0b1))
🎉 This PR is included in version 6.3.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Pull Request checklist: