usds / benefits-enrollment-prototype

https://usds.github.io/benefits-enrollment-prototype/
31 stars 13 forks source link

Design and build cleaner error validation #58

Open mollieru opened 7 years ago

mollieru commented 7 years ago

In response to https://github.com/usds/benefits-enrollment-prototype/issues/28 and https://github.com/usds/benefits-enrollment-prototype/issues/1

Work includes: [ ] come up w design pattern for error validation [ ] go through and ID all required fields [ ] create min and max inputs for date input fields (per https://github.com/usds/benefits-enrollment-prototype/issues/19) [ ] consider options for resolving https://github.com/usds/benefits-enrollment-prototype/issues/11 [ ] build code that is functional in all browsers

jaredcunha commented 7 years ago

Adding notes to this issue since it's something we'll handle over several commits, but wanted to outline exactly what I'm doing in case we ever need to revisit.

jaredcunha commented 7 years ago

First step in this was adding webshim polyfill library. At the moment, we will restrict this only to forms for performance reasons until we need otherwise.

The commit is here: https://github.com/usds/benefits-enrollment-prototype/commit/a24f257e64f467248eb4f0de1d25caad3a42bede

It adds A LOT of files, but we're only calling the forms shim. Those unused files should remain in case we need them. Keeping them will not have performance impacts.

jaredcunha commented 7 years ago

Added browser validation fixes. Since IE9 will avoid checkValidity(), it will fall back to the shim, meaning the styling might appear a little bit different than the styling in other browsers. I don't think this is a huge concern because it gets the job done.

https://github.com/usds/benefits-enrollment-prototype/commit/0d4c045543d992c87bd13404f7b8b898acbd7e64

jaredcunha commented 7 years ago

Note: We'll need to add a note about IE9 styling of validation messages… that IE9 should be validated by the application, not the client.

jaredcunha commented 7 years ago

Cleaned up error styling here: https://github.com/usds/benefits-enrollment-prototype/commit/4cc2c9e59a6f855aa7790473388878ae8f653098

jaredcunha commented 7 years ago

👍 @mollieru

jaredcunha commented 7 years ago

👎 @mollieru

jaredcunha commented 7 years ago

Okay @mollieru, I think this is all done with the exception of identifying all the required fields and what their error messages should be (if they require something more fancy).