-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 blank screen when showing the WorkspaceResetBankAccount modal #14726
Merged
Merged
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b21b39a
Display continue setup even when the reset modal is shown
MariaHCD ba9bd35
Add onConfirm callback when resetting workspace bank account
MariaHCD 63be74c
Make onConfirm an optional callback
MariaHCD 68132de
Show workspace bank account reset modal in the Enable and Validation …
MariaHCD eca45cf
Fix missing import
MariaHCD 4c9dd1f
Fix lint errors
MariaHCD 68ce2bf
Remove unnecessary condition
MariaHCD 46dec4a
Merge remote-tracking branch 'origin/main' into maria-workspace-bank-…
MariaHCD 593668a
Include WorkspaceResetBankAccountModal in ContinueBankAccountSetp
MariaHCD 7ae96ea
Remove unnecessary props
MariaHCD eaf6f6c
Update default for func prop
MariaHCD 982b971
Remove unnecessary if statement
MariaHCD 875d452
Add isLoading to resetFreePlanBankAccount
MariaHCD 17c81b6
Fix lint error and address review comment
MariaHCD e936a7c
Remove View to fix issue with blank screen on iOS
MariaHCD ce95ec9
Merge remote-tracking branch 'origin/main' into maria-workspace-bank-…
MariaHCD bfc75e8
Use ScreenWrapper component to avoid header being cut off on iOS
MariaHCD c3c505f
Fix lint error
MariaHCD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ function resetFreePlanBankAccount(bankAccountID) { | |
{ | ||
optimisticData: [ | ||
{ | ||
onyxMethod: 'set', | ||
onyxMethod: CONST.ONYX.METHOD.SET, | ||
key: ONYXKEYS.ONFIDO_TOKEN, | ||
value: '', | ||
}, | ||
|
@@ -44,12 +44,31 @@ function resetFreePlanBankAccount(bankAccountID) { | |
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
value: ReimbursementAccountProps.reimbursementAccountDefaultProps, | ||
}, | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
value: {isLoading: true}, | ||
}, | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.SET, | ||
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, | ||
value: {}, | ||
}, | ||
], | ||
successData: [ | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
value: {isLoading: false}, | ||
}, | ||
], | ||
failureData: [ | ||
{ | ||
onyxMethod: CONST.ONYX.METHOD.MERGE, | ||
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
value: {isLoading: false}, | ||
}, | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing comma |
||
}); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,18 @@ import ScreenWrapper from '../../components/ScreenWrapper'; | |
import Section from '../../components/Section'; | ||
import Text from '../../components/Text'; | ||
import withPolicy from '../workspace/withPolicy'; | ||
import * as ReimbursementAccountProps from './reimbursementAccountPropTypes'; | ||
import WorkspaceResetBankAccountModal from '../workspace/WorkspaceResetBankAccountModal'; | ||
import * as BankAccounts from '../../libs/actions/BankAccounts'; | ||
|
||
const propTypes = { | ||
/** Bank account currently in setup */ | ||
reimbursementAccount: ReimbursementAccountProps.reimbursementAccountPropTypes.isRequired, | ||
|
||
/** Callback to continue to the next step of the setup */ | ||
continue: PropTypes.func.isRequired, | ||
|
||
/** Callback to start over the setup */ | ||
/** Callback to reset the bank account */ | ||
startOver: PropTypes.func.isRequired, | ||
|
||
/** Policy values needed in the component */ | ||
|
@@ -67,13 +73,22 @@ const ContinueBankAccountSetup = props => ( | |
<MenuItem | ||
title={props.translate('workspace.bankAccount.startOver')} | ||
icon={Expensicons.RotateLeft} | ||
onPress={props.startOver} | ||
onPress={() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be on same line |
||
BankAccounts.requestResetFreePlanBankAccount(); | ||
}} | ||
shouldShowRightIcon | ||
wrapperStyle={[styles.cardMenuItem]} | ||
/> | ||
</Section> | ||
</ScrollView> | ||
</FullPageNotFoundView> | ||
|
||
{props.reimbursementAccount.shouldShowResetModal && ( | ||
<WorkspaceResetBankAccountModal | ||
reimbursementAccount={props.reimbursementAccount} | ||
onConfirm={props.startOver} | ||
/> | ||
)} | ||
</ScreenWrapper> | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As a note for myself and reviewers, adding
isLoading
here caused this side effect: #15114#15114 (comment)