Repository navigation
[NO QA] make Travel Invoicing use 1:1:1 commands and implement verifying UI state #83481
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5a6f2a0
Add new API parameter types and update WRITE_COMMANDS
blimpich fbe3873
Add configureTravelInvoicingForPolicy and deactivateTravelInvoicing a…
blimpich b355be5
Update Travel Invoicing UI to use new 1:1:1 compliant actions
blimpich 088d582
Update unit tests for new Travel Invoicing commands
blimpich 04121c9
Fix prettier formatting in WorkspaceTravelInvoicingSection
blimpich 3e08b59
remove comments
blimpich 620c0ec
add verifying state to the travel invoicing flow
blimpich cd27a9c
create new shared component
blimpich 95b2a57
dry up frontend code
blimpich 9a0aa11
checkpoint
blimpich ba01c82
get verification screen showing
blimpich 6de109c
change copy
blimpich 2d9b85a
translations
blimpich 5d9d5bc
Merge branch 'main' into blimpich-fix111issueWithTravelInvoicing
blimpich 20d9624
Fix smart quotes in fr.ts causing TS syntax errors
blimpich b0d75bf
Revert getTravelSettings to require TRAVEL_US key
blimpich 676ad4c
Add missing translation keys to es.ts
blimpich 92fd024
Revert "Add missing translation keys to es.ts"
blimpich 2fd03c1
Add Spanish translation keys to es.ts
blimpich fecd7ca
remove useless comments
blimpich 7ce290b
make params readonly
blimpich a2797a9
Use isLoading instead of pendingFields for verification loading gate
blimpich 9529878
Merge branch 'main' into blimpich-fix111issueWithTravelInvoicing
blimpich 0cc5ef0
Merge branch 'main' into blimpich-fix111issueWithTravelInvoicing
blimpich 3cf1a08
fix import issues
blimpich 4f37245
address PR review feedback: add error handling, tighten types, fix guard
blimpich 08c123f
use getCardSettings and get rid of fallbacks for settlement account
blimpich af41f91
only use travel settings not root level settings
blimpich d65e6fe
Merge branch 'main' into blimpich-fix111issueWithTravelInvoicing
blimpich 4e0389b
get rid of getTravelSettings
blimpich 857615f
Resolve merge conflicts with main in TravelInvoicingUtilsTest
blimpich 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import React from 'react'; | ||
| import type {ValueOf} from 'type-fest'; | ||
| import useBottomSafeSafeAreaPaddingStyle from '@hooks/useBottomSafeSafeAreaPaddingStyle'; | ||
| import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import Navigation from '@navigation/Navigation'; | ||
| import variables from '@styles/variables'; | ||
| import CONST from '@src/CONST'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import BlockingView from './BlockingViews/BlockingView'; | ||
| import Button from './Button'; | ||
| import LottieAnimations from './LottieAnimations'; | ||
|
|
||
| type BankAccountVerificationViewProps = { | ||
| verificationState: ValueOf<typeof CONST.EXPENSIFY_CARD.VERIFICATION_STATE> | ''; | ||
| children: React.ReactNode; | ||
| onVerifiedButtonPress?: () => void; | ||
| verifiedButtonText?: string; | ||
| verifiedTitle?: string; | ||
| verifiedSubtitle?: string; | ||
| }; | ||
|
|
||
| function BankAccountVerificationView({verificationState, children, onVerifiedButtonPress, verifiedButtonText, verifiedTitle, verifiedSubtitle}: BankAccountVerificationViewProps) { | ||
| const {translate} = useLocalize(); | ||
| const styles = useThemeStyles(); | ||
| const illustrations = useMemoizedLazyIllustrations(['Puzzle']); | ||
| const bottomSafeAreaPaddingStyle = useBottomSafeSafeAreaPaddingStyle({addBottomSafeAreaPadding: true}); | ||
|
|
||
| if (!verificationState) { | ||
| return children; | ||
| } | ||
|
|
||
| switch (verificationState) { | ||
| case CONST.EXPENSIFY_CARD.VERIFICATION_STATE.LOADING: | ||
| return ( | ||
| <BlockingView | ||
| title={translate('workspace.expensifyCard.verifyingBankAccount')} | ||
| subtitle={translate('workspace.expensifyCard.verifyingBankAccountDescription')} | ||
| animation={LottieAnimations.ReviewingBankInfo} | ||
| animationStyles={styles.loadingVBAAnimation} | ||
| animationWebStyle={styles.loadingVBAAnimationWeb} | ||
| subtitleStyle={styles.textLabelSupporting} | ||
| containerStyle={styles.pb20} | ||
| addBottomSafeAreaPadding | ||
| /> | ||
| ); | ||
| case CONST.EXPENSIFY_CARD.VERIFICATION_STATE.ON_WAITLIST: | ||
| return ( | ||
| <> | ||
| <BlockingView | ||
| title={translate('workspace.expensifyCard.oneMoreStep')} | ||
| subtitle={translate('workspace.expensifyCard.oneMoreStepDescription')} | ||
| icon={illustrations.Puzzle} | ||
| subtitleStyle={styles.textLabelSupporting} | ||
| iconHeight={variables.cardPreviewHeight} | ||
| iconWidth={variables.cardPreviewHeight} | ||
| /> | ||
| <Button | ||
| success | ||
| large | ||
| text={translate('workspace.expensifyCard.goToConcierge')} | ||
| style={[styles.m5, bottomSafeAreaPaddingStyle]} | ||
| pressOnEnter | ||
| onPress={() => Navigation.navigate(ROUTES.CONCIERGE)} | ||
| /> | ||
| </> | ||
| ); | ||
| case CONST.EXPENSIFY_CARD.VERIFICATION_STATE.VERIFIED: | ||
| return ( | ||
| <> | ||
| <BlockingView | ||
| title={verifiedTitle ?? translate('workspace.expensifyCard.bankAccountVerified')} | ||
| subtitle={verifiedSubtitle ?? translate('workspace.expensifyCard.bankAccountVerifiedDescription')} | ||
| animation={LottieAnimations.Fireworks} | ||
| animationStyles={styles.loadingVBAAnimation} | ||
| animationWebStyle={styles.loadingVBAAnimationWeb} | ||
| subtitleStyle={styles.textLabelSupporting} | ||
| /> | ||
| <Button | ||
| success | ||
| large | ||
| text={verifiedButtonText ?? translate('workspace.expensifyCard.gotIt')} | ||
| style={[styles.m5, bottomSafeAreaPaddingStyle]} | ||
| pressOnEnter | ||
| onPress={onVerifiedButtonPress} | ||
| /> | ||
| </> | ||
| ); | ||
| default: | ||
| return children; | ||
| } | ||
| } | ||
|
|
||
| BankAccountVerificationView.displayName = 'BankAccountVerificationView'; | ||
|
|
||
| export default BankAccountVerificationView; |
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
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
6 changes: 6 additions & 0 deletions
6
src/libs/API/parameters/ConfigureTravelInvoicingForPolicyParams.ts
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,6 @@ | ||
| type ConfigureTravelInvoicingForPolicyParams = { | ||
| readonly policyID: string; | ||
| readonly settlementBankAccountID: number; | ||
| }; | ||
|
|
||
| export default ConfigureTravelInvoicingForPolicyParams; |
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,5 @@ | ||
| type DeactivateTravelInvoicingParams = { | ||
| readonly policyID: string; | ||
| }; | ||
|
|
||
| export default DeactivateTravelInvoicingParams; |
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.