-
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
Fix: Password form renders when adding bank account #11959
Conversation
BankAccounts.addPersonalBankAccount(selectedPlaidBankAccount, values.password); | ||
} | ||
|
||
render() { | ||
const shouldShowSuccess = lodashGet(this.props, 'personalBankAccount.shouldShowSuccess', false); | ||
const isPlaidBankAccountSelected = Boolean(this.state.selectedPlaidAccountID) && !_.isEmpty(this.getSelectedPlaidAccount()); |
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.
You can probably get rid of Boolean(this.state.selectedPlaidAccountID) &&
?
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.
Agree, !_.isEmpty(this.getSelectedPlaidAccount())
will do the job.
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.
Yes, but I think it will be better to short circuit and not call the function at all
Works well on |
Looks good and tests well C+ reviewed 🎀👀🎀
|
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.
There mught be easier solution proposed by @sobitneupane here #12077
What do you think of that @MonilBhavsar (I havent read much into this)
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.
What solution do we prefer this one or -> #12077
I feel like the contributor's solution is more straightforward, but the refacotring in this PR is also quite useful.
Thoughts? @MonilBhavsar @nkuoch @Beamanator ?
You mean the one in #12077? I think I indeed like 12077 better. |
@nkuoch yes that one, sorry. I will move ahead with that and we can keep the refactoring of the method in this one at least, I think that is still useful. |
That looks good to fix this issue. But don't we need the plaidAccountID intialized in the state. I see we're using it at various places in that file. Looking... |
I personally think we can close this PR now that the other one has been merge. We don't need plaidAccountID intialized in the state. I am the one who originally did it, but no need to. |
@MonilBhavsar agreeed, lets close this |
Okay, so closing this 👍 |
Details
Looks like when the bank account is deleted,
this.state.selectedPlaidAccountID
still holds the bank accountID and renders password field. The idea is to check if the bank account still exists before rendering password field or button.Could also clear the state in
componentDidUpdate()
(Please see 1st commit) But this sounds better. Let me know if you think the latter is better.Fixed Issues
$ #11874
PROPOSAL: N/A
Tests
PR Review Checklist
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 */
this
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 reviewer 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 */
this
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
Screenshots
Web
Screen.Recording.2022-10-19.at.3.33.39.PM.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android