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

Student address requirements #501

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raissaji
Copy link
Contributor

Summary

This pull request removes the address parsing condition within isAddress. It also removes the requirement that the input be at least 3 characters long in RiderModalInfo.tsx. Now, any address input that is not empty or spaces will be valid. This is to resolve the inconsistent add/edit behavior noted in PR #425 regarding the address field.

Test Plan

Screen Shot 2024-03-12 at 9 34 10 PM

Attempting to submit an address input of just spaces will alert the error message.

Screen Shot 2024-03-12 at 9 34 28 PM

Attempting to submit an empty address input will also alert the error message.

Screen Shot 2024-03-12 at 9 35 19 PM

Previously, the input "300 Day Hall" wouldn't have worked. Now, 300 Day Hall is parsed and appended with ", Ithaca, NY 14850" to be a valid address.

Notes

Breaking Changes

None

@raissaji raissaji requested a review from a team as a code owner March 13, 2024 01:45
@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 23.

@raissaji raissaji changed the title Rj353/student address requirements Student address requirements Apr 16, 2024
@@ -165,7 +165,7 @@ const RiderModalInfo = ({
aria-required="true"
ref={register({
required: true,
pattern: /^[a-zA-Z0-9\s,.'-]{3,}$/,
validate: (value) => value.trim() !== '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Raissa, you did a great job on this PR as your code was both simple and correct. Just a sidenote, but if you wanted to do this with regex, you could use: pattern : /^(?!\s*$).+/, which represents strings with at least one non empty character.

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