-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix blank country field #82950
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 country field #82950
Changes from 4 commits
6e1ca40
8f42e5b
fa0cb2c
6422746
0bec559
01f5db6
3228044
f5fde92
7b01f3e
336bf3b
a7d20da
92c8c17
4177b5f
f555d68
4181753
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ import ScrollView from '@components/ScrollView'; | |
| import Section from '@components/Section'; | ||
| import Text from '@components/Text'; | ||
| import TextLink from '@components/TextLink'; | ||
| import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; | ||
| import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
|
|
@@ -23,6 +24,7 @@ import useTheme from '@hooks/useTheme'; | |
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {getLatestError, getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {hasActiveAdminWorkspaces} from '@libs/PolicyUtils'; | ||
| import WorkspaceResetBankAccountModal from '@pages/workspace/WorkspaceResetBankAccountModal'; | ||
| import {goToWithdrawalAccountSetupStep, openPlaidView, updateReimbursementAccountDraft} from '@userActions/BankAccounts'; | ||
| import {openExternalLink} from '@userActions/Link'; | ||
|
|
@@ -100,6 +102,10 @@ function VerifiedBankAccountFlowEntryPoint({ | |
| const [reimbursementAccountOptionPressed] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT_OPTION_PRESSED, {canBeMissing: true}); | ||
| const isAccountValidated = account?.validated ?? false; | ||
|
|
||
| const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true}); | ||
| const {login: currentUserLogin} = useCurrentUserPersonalDetails(); | ||
| const isCurrentUserPolicyAdmin = hasActiveAdminWorkspaces(currentUserLogin, allPolicies); | ||
|
|
||
| const personalBankAccounts = bankAccountList ? Object.keys(bankAccountList).filter((key) => bankAccountList[key].accountType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) : []; | ||
|
|
||
| const removeExistingBankAccountDetails = () => { | ||
|
|
@@ -184,6 +190,14 @@ function VerifiedBankAccountFlowEntryPoint({ | |
| prepareNextStep(CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID); | ||
| }; | ||
|
|
||
| const navigateAfterReset = () => { | ||
| // we want to navigate after reset if the user comes from settings/wallet or settings/wallet/bank-account-purpose | ||
| if (!backTo.includes(ROUTES.SETTINGS_WALLET)) { | ||
| return; | ||
| } | ||
| Navigation.goBack(isCurrentUserPolicyAdmin ? ROUTES.SETTINGS_BANK_ACCOUNT_PURPOSE : ROUTES.SETTINGS_WALLET); | ||
|
Contributor
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. Does this mean that if user is not an admin, resetting the flow will close RHP and open wallet page?
Contributor
Author
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. yes, because non-admin should not have access to the purpose page |
||
| }; | ||
|
|
||
| return ( | ||
| <ScreenWrapper | ||
| includeSafeAreaPaddingBottom={false} | ||
|
|
@@ -279,6 +293,7 @@ function VerifiedBankAccountFlowEntryPoint({ | |
| onPress={() => openExternalLink(CONST.ENCRYPTION_AND_SECURITY_HELP_URL)} | ||
| style={[styles.flexRow, styles.alignItemsCenter]} | ||
| accessibilityLabel={translate('bankAccount.yourDataIsSecure')} | ||
| sentryLabel={CONST.SENTRY_LABEL.REIMBURSEMENT_ACCOUNT.YOUR_DATA_IS_SECURE} | ||
| > | ||
| <TextLink href={CONST.ENCRYPTION_AND_SECURITY_HELP_URL}>{translate('bankAccount.yourDataIsSecure')}</TextLink> | ||
| <View style={styles.ml1}> | ||
|
|
@@ -299,6 +314,7 @@ function VerifiedBankAccountFlowEntryPoint({ | |
| setNonUSDBankAccountStep={setNonUSDBankAccountStep} | ||
| setShouldShowContinueSetupButton={setShouldShowContinueSetupButton} | ||
| setIsResettingBankAccount={setIsResettingBankAccount} | ||
| navigateAfterReset={navigateAfterReset} | ||
| /> | ||
| )} | ||
| </ScreenWrapper> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,9 @@ type WorkspaceResetBankAccountModalProps = { | |||||
|
|
||||||
| /** Method to set the state of isResettingBankAccount */ | ||||||
| setIsResettingBankAccount?: (isResetting: boolean) => void; | ||||||
|
|
||||||
| /** Method to navigate back after resetting bank account from wallet */ | ||||||
|
||||||
| /** Method to navigate back after resetting bank account from wallet */ | |
| /** Method to navigate after resetting bank account */ |
Uh oh!
There was an error while loading. Please reload this page.