-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implemented validation for EditProfileVC #73
base: main
Are you sure you want to change the base?
Conversation
- Cannot save unless all fields are filled and valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before I approve this PR, I need to see what this PR is actually doing. At this moment, I am confused on how you are invalidating. Will the save button be grayed out and disabled? Will they still be able to save but an error pops up? Will the textfields be outlined red?
Please provide a screenshot of what you implemented as well as a more detailed description about how you are preventing the user. I would also communicate this with design to see how they want to deal with this.
let snack = snackTextField.getText(), !snack.isEmpty, | ||
let song = songTextField.getText(), !song.isEmpty, | ||
let stop = stopTextField.getText(), !stop.isEmpty else { | ||
print("Error: Please complete all fields") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am really against having these error statements printed out because it clutters the console and is unnecessary as the UI should tell you if it's invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the button color change and updated the PR. Richie said that he would change the custom text fields, so displaying the error would be dealt with later. The print statements are just temporary in place of that for now.
self.stop = stop | ||
|
||
guard let nameArray = nameTextField.getText()?.split(separator: " "), nameArray.count == 2 else { | ||
print("Error: Name field does not contain first and last name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also want to communicate with @rs929 about having the successful print statements for every network request. I was guilty of doing this before, but I now realize that it clogs up the console and makes it difficult to debug, especially since you can have tons of network requests. If you don't see an error message then you can assume that it succeeded.
@tiffany-pann Let me know what you think as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this notification but I agree, perhaps we can just comment out for now and re-comment if we need to debug networking
- Created text field completion function that returns whether the fields are filled out and the name field contains both first and last name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚙🚙
Overview
Implemented validation for the edit profile page.
Changes Made
Edit Profile Page
EditProfileViewController
, modifiedsaveEdit
so that the user is unable to save their edits if any of the following apply:textFieldsComplete
, and if so, changes the opacity of the button to its respective state usingsetSaveButtonColor
.Test Coverage
Screenshots
Validation
edit-profile-validation.mp4