-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: show connection status and last sync time for bank accounts and cards #93852
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
Open
marufsharifi
wants to merge
91
commits into
Expensify:main
Choose a base branch
from
marufsharifi:feat/show-connection-status-and-last-sync-for-bank-accounts-and-cards
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
bb6895c
feat: show connection status and last sync time for bank accounts and…
marufsharifi 987214e
prettier fix
marufsharifi d7ca6d1
fix wallet connection status row UI
marufsharifi b17ae30
Extract shared connection status badge
marufsharifi 33715ba
Remove unlock magic string
marufsharifi faf19f9
Share policy ID helper
marufsharifi e33e3d2
Gate disabled bank account CTA
marufsharifi 75e8fc0
reuse state helper
marufsharifi 32cffdd
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi a6e4064
Extract shared inline status message
marufsharifi 8fe9a87
Extract connection status message component
marufsharifi 51754b3
add translations
marufsharifi 8e7c788
Fix shared helper imports
marufsharifi 77db8a5
fix prettier
marufsharifi c61844c
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi f6e03c4
Reuse connection status message component
marufsharifi 43d695d
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 108c35b
fix workflow status message styling
marufsharifi 220b4c7
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi ca5d61f
fix wallet workflow status spacing
marufsharifi 840a49b
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 31d8ac8
fix workflow status spacing
marufsharifi 23af402
Gate connection status by beta
marufsharifi 2c2f1dd
Fix connection message theme colors
marufsharifi b38f1c1
keep connection status layout aligned
marufsharifi 22bf0e6
fix connectionStatusMessage lint
marufsharifi a20ad2e
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi cd874ff
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 628c771
polish wallet connection status message styling
marufsharifi f709b61
polish workflow bank account hover layout
marufsharifi b4c09c1
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 12686d1
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi a96efa2
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 42d8fe2
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 45d941d
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 5876c88
gate wallet row hover by beta status
marufsharifi 4d9a4df
extract shared bank account helpers
marufsharifi 795f9d5
refactor duplicated wallet card loop
marufsharifi 23e1677
fix fmt
marufsharifi e62e177
beta enabled
marufsharifi f17b0b5
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi fdf3131
gate workflows payment row by beta
marufsharifi 5fcf847
preserve default badge with connection status
marufsharifi ab65a9a
preserve frozen badge over status pill
marufsharifi f3d9a90
limit card sync text to feed cards
marufsharifi e44cff9
cleanup connection status message styles
marufsharifi 2383d88
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 6264682
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi dc65e1a
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 668a57b
fix duplicate status badges
marufsharifi 660dca2
restore add-details CTA in beta
marufsharifi 5b7e21c
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 8f29a68
fix deprecated icon prop
marufsharifi 5b419c5
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi ab4477a
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 8da02c0
skip incomplete status for missing bank state
marufsharifi 15525d0
preserve beta error fallbacks
marufsharifi bf07d4a
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 9769047
skip last sync for CSV cards
marufsharifi 8300bec
clean up status row logic
marufsharifi c85bab0
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 7636520
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 5c77002
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 5899f02
fix card status and sync dates
marufsharifi a35a9b6
normalize extracted policy IDs
marufsharifi d104021
fix connection message i18n
marufsharifi b928338
preserve card title fallback
marufsharifi e6c9251
preserve card offline errors
marufsharifi 273cbf7
clean up status helpers
marufsharifi f56363e
dedupe card connection errors
marufsharifi 6b50e5e
dedupe workflow bank menu item
marufsharifi 3d1aaa8
add bank status unit tests
marufsharifi a24faa5
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 70023a3
fix personal card rbr fallback
marufsharifi 2530a1c
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 9dd2ce2
align card connection rbr logic
marufsharifi f53a070
order import fixed
marufsharifi 6c0fe38
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi a424754
fix native RBR text alignment
marufsharifi 530982b
guard card domain policy lookup
marufsharifi 4d5f680
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi a6d3132
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi e9e9df6
fix connection message HTML alignment
marufsharifi 32ba661
test policy domain parsing
marufsharifi 87dbaec
test card connection status logic
marufsharifi b889636
fix spellcheck
marufsharifi e0f36ca
remove unused export
marufsharifi d2f460c
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 5919ab5
add wallet connection beta
marufsharifi 36f7944
use card status flags
marufsharifi f3cf9a1
Merge branch 'main' into feat/show-connection-status-and-last-sync-fo…
marufsharifi 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 hidden or 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 hidden or 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,39 @@ | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
|
|
||
| import Badge from './Badge'; | ||
| import Tooltip from './Tooltip'; | ||
|
|
||
| type ConnectionStatusBadgeProps = { | ||
| text: string; | ||
| tone?: 'default' | 'success' | 'danger'; | ||
| tooltipText?: string; | ||
| }; | ||
|
|
||
| function ConnectionStatusBadge({text, tone = 'default', tooltipText}: ConnectionStatusBadgeProps) { | ||
| const styles = useThemeStyles(); | ||
|
|
||
| const badge = ( | ||
| <Badge | ||
| text={text} | ||
| success={tone === 'success'} | ||
| error={tone === 'danger'} | ||
| isCondensed | ||
| badgeStyles={[styles.ml0]} | ||
| /> | ||
| ); | ||
|
|
||
| if (!tooltipText) { | ||
| return badge; | ||
| } | ||
|
|
||
| return ( | ||
| <Tooltip text={tooltipText}> | ||
| <View>{badge}</View> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
|
|
||
| export default ConnectionStatusBadge; | ||
This file contains hidden or 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,89 @@ | ||
| import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; | ||
| import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import type {ComponentProps} from 'react'; | ||
|
|
||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
|
|
||
| import Button from './Button'; | ||
| import Icon from './Icon'; | ||
| import RenderHTML from './RenderHTML'; | ||
|
|
||
| type ConnectionStatusMessageProps = { | ||
| message?: string; | ||
| actionText?: string; | ||
| onActionPress?: () => void; | ||
| isActionDisabled?: boolean; | ||
| statusTone?: 'default' | 'success' | 'danger'; | ||
| onLinkPress?: ComponentProps<typeof RenderHTML>['onLinkPress']; | ||
| shouldIncludeHorizontalPadding?: boolean; | ||
| }; | ||
|
|
||
| function ConnectionStatusMessage({ | ||
| message, | ||
| actionText, | ||
| onActionPress, | ||
| isActionDisabled = false, | ||
| statusTone = 'default', | ||
| onLinkPress, | ||
| shouldIncludeHorizontalPadding = true, | ||
| }: ConnectionStatusMessageProps) { | ||
| const icons = useMemoizedLazyExpensifyIcons(['DotIndicator']); | ||
| const theme = useTheme(); | ||
| const styles = useThemeStyles(); | ||
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
|
|
||
| if (!message && !actionText) { | ||
| return null; | ||
| } | ||
|
|
||
| let statusMessageRowPadding; | ||
| if (shouldIncludeHorizontalPadding) { | ||
| statusMessageRowPadding = shouldUseNarrowLayout ? styles.ph5 : styles.ph8; | ||
| } | ||
| const shouldShowActionButton = !!actionText && !!onActionPress; | ||
| const isDangerStatus = statusTone === 'danger'; | ||
| const messageTag = isDangerStatus ? 'rbr' : 'muted-text-label'; | ||
| const messageHTML = `<${messageTag}>${message ?? ''}</${messageTag}>`; | ||
| const messageContent = ( | ||
| <View style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}> | ||
| {isDangerStatus && ( | ||
| <View style={[styles.offlineFeedbackErrorDot, styles.mr2]}> | ||
| <Icon | ||
| src={icons.DotIndicator} | ||
| fill={theme.danger} | ||
| /> | ||
| </View> | ||
| )} | ||
| <View style={[styles.flex1, styles.flexRow]}> | ||
| <RenderHTML | ||
| html={messageHTML} | ||
| onLinkPress={onLinkPress} | ||
| /> | ||
| </View> | ||
| </View> | ||
| ); | ||
|
|
||
| const actionButton = shouldShowActionButton ? ( | ||
| <Button | ||
| small | ||
| danger | ||
| style={styles.alignSelfStart} | ||
| text={actionText} | ||
| onPress={onActionPress} | ||
| isDisabled={isActionDisabled} | ||
| /> | ||
| ) : null; | ||
|
|
||
| return ( | ||
| <View style={[statusMessageRowPadding, styles.flexRow, styles.alignItemsCenter, styles.gap3]}> | ||
| {messageContent} | ||
| <View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>{actionButton}</View> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export default ConnectionStatusMessage; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Do we have 'default' case?
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,
defaultis used for the neutralVerifyingbank account status.