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

[Eligibility Questionnaire] Add form validation #327

Merged
merged 4 commits into from
Aug 5, 2021
Merged

Conversation

elenm
Copy link

@elenm elenm commented Aug 4, 2021

Pull Request Template

Issue

Addresses #225

  • This change addresses the issue in full
  • This change addresses only certain aspects of the issue
  • This change is a dependency for another issue
  • This change has a dependency from another issue

Description

Included in this change:

  • Moved the routing code from the button 'onClick' to the form 'onSubmit' method. This is because the 'onSubmit' method is only called after all page validation has passed. Previously, even if the form validation failed we were still routed to the next page.
  • Added validation to ensure that the user inputs a valid age.
  • Suppressed unbound-method lints
  • Fixes a bug where I wasn't setting the correct default value string for the income dropdown

Type of change

  • 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 not work as expected)
  • Prototype/POC (not to merge)
  • This change is a refactor/address technical debt
  • This change requires a documentation update
  • This change requires a SQL Script

How Can This Be Tested/Reviewed?

Please describe the tests that you ran to verify your changes. Provide instructions so we can review. Please also list any relevant details for your test configuration

  • Desktop View
  • Mobile View
  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have updated the changelog to include a description of my changes

image
image
image
image

@elenm elenm added the epic: eligibility questionnaire Tickets related to the eligibility questionnaire workstream label Aug 4, 2021
@elenm elenm requested review from ChelseaRucker and pfeeny5 August 4, 2021 19:03
Copy link

@pfeeny5 pfeeny5 left a comment

Choose a reason for hiding this comment

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

LGTM. All the errors worked correctly for me, and the code looked good.
Wonder if it might be worth checking on the age validation "on update" for the text box vs "on submit" from the button. With one field, this probably isn't an issue.

@elenm
Copy link
Author

elenm commented Aug 4, 2021

Thanks Patrick! Yeah I'll probably keep it "onSubmit" for age as well to be consistent with the other pages. Let me know if you feel strongly about doing it "onUpdate" though.

@elenm elenm merged commit 1bd7556 into main Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic: eligibility questionnaire Tickets related to the eligibility questionnaire workstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants