-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor ValidationStep Form #10946
Refactor ValidationStep Form #10946
Conversation
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.
Thanks for working on this! Left a few comments.
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.
Looks good! I left a few comments 👍🏽
Edit: Lol I didn't notice that @luacmartins already left some comments a few mins ago (Also I noticed some of them are similar 😄)
src/libs/actions/FormActions.js
Outdated
/** | ||
* @param {String} formID | ||
* @param {String} errors | ||
*/ | ||
function setErrors(formID, errors) { | ||
Onyx.merge(formID, {errors}); | ||
} | ||
|
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.
Why did we create this? I think that we should update the existing setErrorMessage
function to conform with the new format we have for errors. We are still early on in the form refactors so it shouldn't be hard to update other instances.
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.
Got it. I will work on it.
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.
done @luacmartins. Also updated my PR here to use errors
.
src/libs/actions/FormActions.js
Outdated
*/ | ||
function setErrorMessage(formID, error) { | ||
Onyx.merge(formID, {error}); | ||
function setErrorMessage(formID, errors) { |
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 think we should rename this to setErrors
since that better describes this method now and update other usages of it to pass an object instead of string. I think the only other usages are in Form.stories.js
and seems to use these args
Conflicts |
Yup coming from this PR, I'll work on merging the changes into the refactored form. |
@youssef-lr is this ready for another review? |
@luacmartins yes, I tested it and seems to work well. However, I'm slightly bothered by the flickering of the screen after we submit valid codes. The view switches back to the validation step for a second then switches to the success page. This is happening on main too, see the recording below: Screen.Recording.2022-09-29.at.19.26.13.mov |
@youssef-lr if this is on main, you could either try to solve the issue in this PR or log another issue and try to solve that separately. Up to you. |
@youssef-lr let me know when the conflicts are resolved and this is ready for another review! |
I will create a separate issue for this.
All set! |
src/libs/actions/FormActions.js
Outdated
@@ -10,9 +10,9 @@ function setIsLoading(formID, isLoading) { | |||
|
|||
/** | |||
* @param {String} formID | |||
* @param {Object} errors | |||
* @param {String} errors |
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.
This should be an object, right?
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.
woops yes, fixed.
@Justicea83 @marcochavezf bump! :) |
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.
LGTM!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @luacmartins in version: 1.2.12-0 🚀
|
@youssef-lr We are not able to test the last step in the PR Recording.1630.mp4 |
@kavimuru the tester should refresh the page and confirm that the amounts entered are still visible. They do not need to submit the form with these amounts, since the amounts are obviously wrong. |
🚀 Deployed to production by @AndrewGable in version: 1.2.12-4 🚀
|
…lidation_step_form Refactor ValidationStep Form
Details
Fixed Issues
$ #9582
Tests
Add a bank account to your account until you reach the validation step that asks for 3 amounts.
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
With a bank account that is awaiting validation codes, head to https://staging.new.expensify.com/bank-account/BankAccountStep
Screenshots
Web
Screen.Recording.2022-09-22.at.22.24.27.mov
Mobile Web
Desktop
iOS
Android