-
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
[Wave Collect][Xero] Enforce 2FA for xero #44059
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
6532961
show confirm modal if 2fa isn't enabled
rushatgabhane d68cb2c
add dismiss
rushatgabhane 8329d45
add require 2fa modal
rushatgabhane 2481d2a
add blue bg
rushatgabhane 0e7cc39
cleanup and add margin
rushatgabhane 0a19025
more margin
rushatgabhane f710a3e
fix padding and margin for desktop and mobile
rushatgabhane cfcc93b
navigate to 2fa page
rushatgabhane fb58fad
add forward to param
rushatgabhane c844340
add forward to type
rushatgabhane 5799a37
navigate to forward to
rushatgabhane 8cf4612
Revert "navigate to forward to"
rushatgabhane 3c3a4d4
Revert "add forward to param"
rushatgabhane ccd36a5
add forward to param
rushatgabhane 04e5d53
add forward to type for 2fa
rushatgabhane 45c9812
add forward to link for xero
rushatgabhane d527edf
pass forward to as a prop from url
rushatgabhane a338137
navigate to the forwarded url in new tab
rushatgabhane e0dc00b
fix storybook
rushatgabhane 96ffb8e
rm unused imports
rushatgabhane 1f4e9f1
rm unused imports
rushatgabhane beae97b
add desc for 2fa
rushatgabhane fe7efba
add needsTwoFactorAuthSetup to account
rushatgabhane 9873c32
rename desc
rushatgabhane b7feae6
show 2fa modal if 2fa is required for acc
rushatgabhane e1f5e13
prettay that thing
rushatgabhane 8d9b210
check for 2fa on native
rushatgabhane 6d5c025
add bottom padding on native
rushatgabhane 8a6ac29
add bottom padding on native
rushatgabhane 4e02d3b
Update src/languages/en.ts
rushatgabhane 9fcd2f0
Update src/languages/es.ts
rushatgabhane 9aa057d
Merge branch 'main' into 2fa
rushatgabhane bd51726
fix merge conflict
rushatgabhane d3819a5
dismiss modal on 2fa
rushatgabhane 6f46e17
dismiss modal and fix unterminated strings
rushatgabhane 626c154
reconnect app on 2fa complete
rushatgabhane a7bdb92
Merge branch 'main' of github.com:rushatgabhane/exfy into 2fa
rushatgabhane 02670d3
run prettier
rushatgabhane 74d03d0
fix merge
rushatgabhane 859cf4a
Merge branch 'main' into 2fa
rushatgabhane 57e752e
add height for illustration
rushatgabhane 2290a74
default 2fa to false
rushatgabhane c4da238
Merge branch 'main' of github.com:rushatgabhane/exfy into 2fa
rushatgabhane dcddaa2
preserve personal details
rushatgabhane 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
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
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
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
import useStyleUtils from '@hooks/useStyleUtils'; | ||
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import CONST from '@src/CONST'; | ||
import Button from './Button'; | ||
import Lottie from './Lottie'; | ||
import LottieAnimations from './LottieAnimations'; | ||
import Modal from './Modal'; | ||
import SafeAreaConsumer from './SafeAreaConsumer'; | ||
import Text from './Text'; | ||
|
||
type RequireTwoFactorAuthenticationModalProps = { | ||
/** A callback to call when the form has been submitted */ | ||
onSubmit: () => void; | ||
|
||
/** A callback to call when the form has been closed */ | ||
onCancel?: () => void; | ||
|
||
/** Modal visibility */ | ||
isVisible: boolean; | ||
|
||
/** Describe what is showing */ | ||
description: string; | ||
|
||
/** | ||
* Whether the modal should enable the new focus manager. | ||
* We are attempting to migrate to a new refocus manager, adding this property for gradual migration. | ||
* */ | ||
shouldEnableNewFocusManagement?: boolean; | ||
}; | ||
|
||
function RequireTwoFactorAuthenticationModal({onCancel = () => {}, description, isVisible, onSubmit, shouldEnableNewFocusManagement}: RequireTwoFactorAuthenticationModalProps) { | ||
const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
const styles = useThemeStyles(); | ||
const {translate} = useLocalize(); | ||
const StyleUtils = useStyleUtils(); | ||
|
||
return ( | ||
<SafeAreaConsumer> | ||
{({safeAreaPaddingBottomStyle}) => ( | ||
<Modal | ||
onClose={onCancel} | ||
isVisible={isVisible} | ||
type={shouldUseNarrowLayout ? CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED : CONST.MODAL.MODAL_TYPE.CONFIRM} | ||
innerContainerStyle={{...styles.pb5, ...styles.pt3, ...styles.boxShadowNone}} | ||
shouldEnableNewFocusManagement={shouldEnableNewFocusManagement} | ||
> | ||
<View style={safeAreaPaddingBottomStyle}> | ||
<View | ||
style={[ | ||
styles.mh3, | ||
styles.br3, | ||
styles.cardSectionIllustration, | ||
styles.alignItemsCenter, | ||
StyleUtils.getBackgroundColorStyle(LottieAnimations.Safe.backgroundColor), | ||
]} | ||
> | ||
<Lottie | ||
source={LottieAnimations.Safe} | ||
style={styles.h100} | ||
webStyle={styles.h100} | ||
autoPlay | ||
loop | ||
/> | ||
</View> | ||
<View style={[styles.mt5, styles.mh5]}> | ||
<View style={[styles.gap2, styles.mb10]}> | ||
<Text style={[styles.textHeadlineH1]}>{translate('twoFactorAuth.pleaseEnableTwoFactorAuth')}</Text> | ||
<Text style={styles.textSupporting}>{description}</Text> | ||
</View> | ||
<Button | ||
large | ||
success | ||
pressOnEnter | ||
onPress={onSubmit} | ||
text={translate('twoFactorAuth.enableTwoFactorAuth')} | ||
/> | ||
</View> | ||
</View> | ||
</Modal> | ||
)} | ||
</SafeAreaConsumer> | ||
); | ||
} | ||
|
||
RequireTwoFactorAuthenticationModal.displayName = 'RequireTwoFactorAuthenticationModal'; | ||
|
||
export default RequireTwoFactorAuthenticationModal; |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
I think for narrow layout, another
FullScreenNavigator
is being pushed here because the top navigator isRightHandModalNavigator
. Dismissing RHP before navigating fixes it. Same forindex.native.tsx
.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.
@rushatgabhane
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.
Not convinced by this? @rushatgabhane
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.
@c3024 sorry, let me give this a try
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 works well! thank you