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

FS-5018: remove html5 validation and add email validation #135

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

NarenderRajuB
Copy link
Contributor

@NarenderRajuB NarenderRajuB commented Feb 21, 2025

https://mhclgdigital.atlassian.net/browse/FS-5018

Change description

Remove HTML5 validation and add email address validation in backend

  • [ x] Unit tests and other appropriate tests added or updated
  • README and other documentation has been updated / added (if needed)
  • [x ] Commit messages are meaningful and follow good commit message guidelines (e.g. "FS-XXXX: Add margin to nav items preventing overlapping of logo")
image

Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

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

LGTM also please do a test. with an existing fund

Copy link
Collaborator

@wjrm500 wjrm500 left a comment

Choose a reason for hiding this comment

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

Hey @NarenderRajuB thanks for this, have tested locally by:

Behaviour was as expected 👍

However, I'm struggling to review the code a bit, so maybe you could help me out. My understanding was that the requirement here was effectively to take the EmailAddressField from the digital-form-builder base repo, copy paste it into Adapter and make some small tweak to add the desired validation.

Based on this, I'd expect a minimal diff between the base repo class and this one, and a clear explanation of what validation we're performing and how this has been implemented by the new code. This would make this PR easy to review.

What I see instead are a number of changes between the two classes e.g.,:

Base repo EmailAddressField:

getFormSchemaKeys() {
      return {
          [this.name]: this.formSchema,
      };
}

This new implementation:

getFormSchemaKeys() {
    return getFormSchemaKeys(this.name, "string", this);
}

Likewise there are other differences that I'm not sure about. So can I ask that you describe the approach you took here and explain any differences between the EmailAddressField in the base repo and the new implementation? Thanks

@NarenderRajuB
Copy link
Contributor Author

Hey @NarenderRajuB thanks for this, have tested locally by:

Behaviour was as expected 👍

However, I'm struggling to review the code a bit, so maybe you could help me out. My understanding was that the requirement here was effectively to take the EmailAddressField from the digital-form-builder base repo, copy paste it into Adapter and make some small tweak to add the desired validation.

Based on this, I'd expect a minimal diff between the base repo class and this one, and a clear explanation of what validation we're performing and how this has been implemented by the new code. This would make this PR easy to review.

What I see instead are a number of changes between the two classes e.g.,:

Base repo EmailAddressField:

getFormSchemaKeys() {
      return {
          [this.name]: this.formSchema,
      };
}

This new implementation:

getFormSchemaKeys() {
    return getFormSchemaKeys(this.name, "string", this);
}

Likewise there are other differences that I'm not sure about. So can I ask that you describe the approach you took here and explain any differences between the EmailAddressField in the base repo and the new implementation? Thanks

@NarenderRajuB
Copy link
Contributor Author

Hey @NarenderRajuB thanks for this, have tested locally by:

Behaviour was as expected 👍

However, I'm struggling to review the code a bit, so maybe you could help me out. My understanding was that the requirement here was effectively to take the EmailAddressField from the digital-form-builder base repo, copy paste it into Adapter and make some small tweak to add the desired validation.

Based on this, I'd expect a minimal diff between the base repo class and this one, and a clear explanation of what validation we're performing and how this has been implemented by the new code. This would make this PR easy to review.

What I see instead are a number of changes between the two classes e.g.,:

Base repo EmailAddressField:

getFormSchemaKeys() {
      return {
          [this.name]: this.formSchema,
      };
}

This new implementation:

getFormSchemaKeys() {
    return getFormSchemaKeys(this.name, "string", this);
}

Likewise there are other differences that I'm not sure about. So can I ask that you describe the approach you took here and explain any differences between the EmailAddressField in the base repo and the new implementation? Thanks

@wjrm500 i did followed the approach we are using for websitefield.ts

@NarenderRajuB NarenderRajuB force-pushed the bugfix/fs-5018-fix-html5-validation branch 2 times, most recently from ab1c074 to 6bac789 Compare February 25, 2025 23:15
Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

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

I think fair change so approving

Copy link
Collaborator

@wjrm500 wjrm500 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes @NarenderRajuB

@nuwan-samarasinghe nuwan-samarasinghe force-pushed the bugfix/fs-5018-fix-html5-validation branch from 6bac789 to a22e32d Compare February 27, 2025 15:29
@nuwan-samarasinghe nuwan-samarasinghe merged commit a536870 into main Feb 27, 2025
20 checks passed
@nuwan-samarasinghe nuwan-samarasinghe deleted the bugfix/fs-5018-fix-html5-validation branch February 27, 2025 15:49
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.

4 participants