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

Issue: Domain name validation #6475 Fixed #9496

Closed
wants to merge 2 commits into from

Conversation

pasha42
Copy link
Contributor

@pasha42 pasha42 commented Feb 23, 2021

Hello,

This pull request will fix following issue

In the following Pull request >> #7733
@petersg83 (#7733 (review)) have mentioned to integrate the following package - https://github.com/peerigon/parse-domain.

As mentioned I have integrated the same in the strapi-helper-plugin

This is my first PR. Kindly let me know If it needs any modifications or changes.

@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #9496 (93a0bc8) into master (e21f06d) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9496      +/-   ##
==========================================
- Coverage   35.96%   35.95%   -0.01%     
==========================================
  Files        1335     1335              
  Lines       14722    14726       +4     
  Branches     1467     1468       +1     
==========================================
  Hits         5295     5295              
- Misses       8511     8514       +3     
- Partials      916      917       +1     
Flag Coverage Δ
front 27.38% <0.00%> (-0.01%) ⬇️
unit 55.54% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...admin/src/containers/ApplicationInfosPage/index.js 70.58% <ø> (ø)
...dmin/src/components/BooleanBox/icons/CTSelected.js 100.00% <ø> (ø)
...in/src/components/BooleanBox/icons/CTUnselected.js 100.00% <ø> (ø)
...dmin/src/components/BooleanBox/icons/STSelected.js 100.00% <ø> (ø)
...in/src/components/BooleanBox/icons/STUnselected.js 100.00% <ø> (ø)
...e-builder/admin/src/components/BooleanBox/index.js 100.00% <ø> (ø)
...-upload/admin/src/containers/SettingsPage/index.js 0.00% <0.00%> (ø)
...sions/admin/src/containers/Roles/ListPage/index.js 0.00% <0.00%> (ø)
packages/strapi-utils/lib/sanitize-entity.js 94.36% <0.00%> (-2.74%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd80972...b37a9ca. Read the comment docs.

Copy link
Contributor

@petersg83 petersg83 left a comment

Choose a reason for hiding this comment

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

Thank you! I let the front developers review it :)

type === 'email' &&
!emailRegex.test(value) &&
!(parseDomainResult.type === ParseResultType.Listed)
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you gather the two ifs please ?
Something like:

if (type === 'email') {
  parseDomainResult = parseDomain(value);

  if (!emailRegex.test(value) || parseDomainResult.type !== ParseResultType.Listed) {
    errors.push({ id: 'components.Input.error.validation.email' });
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@petersg83
Yeah, I'll modify the same as nested if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@petersg83
Mentioned changes are committed.

Nested If added inside the domain name validation
@soupette
Copy link
Contributor

Hello @pasha42 thank you for your contribution, however this file is not used anymore in the application we are planning on cleaning the strapi-helper-plugin. The file you are looking for might be this one.

I am closing this pull request, feel free to reopen a new one.

Again, thank you very much for taking the time to contribute to the project.

@soupette soupette closed this Feb 25, 2021
pasha42 added a commit to pasha42/strapi that referenced this pull request Feb 25, 2021
soupette added a commit that referenced this pull request Mar 3, 2021
alexandrebodin pushed a commit that referenced this pull request Mar 3, 2021
…#9496" (#9588)

* Revert "Issue: Domain name validation #6475 Fixed. With Ref to Previous PR #9496 (#9521)"

This reverts commit 3781ca2.

* Update yarn.lock

Signed-off-by: soupette <cyril.lpz@gmail.com>
This was referenced Mar 12, 2021
This was referenced Mar 12, 2021
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

3 participants