-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Test Drive Expensify: Phase 2] Front end changes #60997
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
marcaaron
merged 83 commits into
Expensify:main
from
callstack-internal:pac-guerreiro/feature/60745-test-drive-phase-2
May 23, 2025
Merged
Changes from all commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
2cd21fc
feat(testdrive): enable access to employees
pac-guerreiro c55cffb
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 308ce55
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro ca74842
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 46f353f
chore(testdrive): update translations
pac-guerreiro 0369c99
chore: address eslint issues
pac-guerreiro e2e89e4
chore(testdrive): update onyx onboarding choices
pac-guerreiro 52aa813
fix(testdrive): wrong default value
pac-guerreiro 678cb3b
chore(testdrive): apply suggestions
pac-guerreiro d0453f9
refactor(testdrive): reuse same logic to set McTest and Test Drive re…
pac-guerreiro 17a6fcf
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro cb80a7a
fix(testdrive): employee test drive modal description missing
pac-guerreiro 369711e
refactor(testdrive): navigation after onboarding to display test driv…
pac-guerreiro 50cc556
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 187c921
fix(testdrive): keyboard overlapping boss email input
pac-guerreiro cc436b3
fix(testdrive): keyboard not dismissed when pressing outside boss ema…
pac-guerreiro f4d1143
refactor(testdrive): apply suggestions
pac-guerreiro 52a724f
chore(testdrive): add missing argument for asset extension
pac-guerreiro a38bdf9
fix(testdrive): modal not showing after onboarding on iOS
pac-guerreiro 1c17d0a
refactor(testdrive): apply suggestions
pac-guerreiro 82633fe
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 9fd512e
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 7e36ce6
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 11b2d04
chore(testdrive): apply suggestions
pac-guerreiro ae7c184
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro f75219f
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro e8811a3
refactor(testdrive): apply suggestions
pac-guerreiro fa00548
chore(testdrive): add translation for existing boss account error
pac-guerreiro 21c287d
chore(testdrive): unify inner container styles between admin and empl…
pac-guerreiro 5a502ac
fix(testdrive): stuck in test drive after boss email validation
pac-guerreiro 87fc69e
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 9fccf57
chore(testdrive): add spanish translations for scan receipt
pac-guerreiro 8e12955
fix(testdrive): spacing between modal title and description
pac-guerreiro a6809ed
feat(testdrive): add loading state when starting an employee test drive
pac-guerreiro 81d1608
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 4ecc884
refactor(testdrive): apply suggestions
pac-guerreiro 0694962
fix(testdrive): loading spinner disappearing before navigating to tes…
pac-guerreiro 67468f0
chore(testdrive): remove optimistic comment once request is successful
pac-guerreiro 8472cbe
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 16be5f4
fix(testdrive): missing offline feedback
pac-guerreiro ff1f503
fix(testdrive): not displaying first name on optimistic comment
pac-guerreiro 734f3d0
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 71dd8f9
chore(testdrive): resolve eslint and jest issues
pac-guerreiro b14fc40
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 1f8ded6
fix(testdrive): ability to update test drive receipt
pac-guerreiro 019d90b
fix(testdrive): offline indicator getting overlapped by confirm button
pac-guerreiro e0e935b
fix(testdrive): spacing above keyboard
pac-guerreiro 43af5c1
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 557430b
refactor(testdrive): apply suggestions
pac-guerreiro 7ddd8d9
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro da8cdec
chore(testdrive): rename test cases to make them more clear
pac-guerreiro cf53050
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro a230544
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 150334d
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 77ddc05
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 6ab8eb9
chore(testdrive): add testDriveCommentReportActionID request param
pac-guerreiro 82514e2
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro a314966
refactor: apply suggestions
pac-guerreiro e5b3076
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro 43eeb13
feat(testdrive): update fake receipt asset with less negative space
pac-guerreiro 2d12cff
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
pac-guerreiro f1e790c
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
fabioh8010 50a0610
Send correct guidedSetupData in RequestMoney API
fabioh8010 24beb78
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 849d9fe
Merge branch 'main' into pac-guerreiro/feature/60745-test-drive-phase-2
fabioh8010 5d16b50
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 9acabfd
Change non admins to see the test drive bottom up modal
fabioh8010 dd45d91
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 edd36de
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 42b0662
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 242d2f2
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 48825f2
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 a15dc49
Fix test drive task message for employees
fabioh8010 fdf785d
Keep the previously boss email in the field when boing back from IOU …
fabioh8010 44dc4fc
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 5efc220
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 377ef77
Send guidedSetupData to CreateWorkspace API if admin is test drive re…
fabioh8010 f2ec950
Change F1 imagery
fabioh8010 4acd836
Dont show Free Trial banner for previously Test Drive Receivers
fabioh8010 bc243dc
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 a5b2e01
Fix lint
fabioh8010 518071d
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 3f4df18
Merge remote-tracking branch 'origin/main' into pac-guerreiro/feature…
fabioh8010 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,11 +18,15 @@ import CONST from '@src/CONST'; | |
| import type IconAsset from '@src/types/utils/IconAsset'; | ||
| import Button from './Button'; | ||
| import CheckboxWithLabel from './CheckboxWithLabel'; | ||
| import FormAlertWithSubmitButton from './FormAlertWithSubmitButton'; | ||
| import ImageSVG from './ImageSVG'; | ||
| import Lottie from './Lottie'; | ||
| import LottieAnimations from './LottieAnimations'; | ||
| import type DotLottieAnimation from './LottieAnimations/types'; | ||
| import Modal from './Modal'; | ||
| import OfflineIndicator from './OfflineIndicator'; | ||
| import RenderHTML from './RenderHTML'; | ||
| import ScrollView from './ScrollView'; | ||
| import Text from './Text'; | ||
| import VideoPlayer from './VideoPlayer'; | ||
|
|
||
|
|
@@ -98,6 +102,24 @@ type BaseFeatureTrainingModalProps = { | |
|
|
||
| /** Whether the modal image is a SVG */ | ||
| shouldRenderSVG?: boolean; | ||
|
|
||
| /** Whether the modal description is written in HTML */ | ||
| shouldRenderHTMLDescription?: boolean; | ||
|
|
||
| /** Whether the modal will be closed on confirm */ | ||
| shouldCloseOnConfirm?: boolean; | ||
|
|
||
| /** Whether the modal should avoid the keyboard */ | ||
| avoidKeyboard?: boolean; | ||
|
|
||
| /** Whether the modal content is scrollable */ | ||
| shouldUseScrollView?: boolean; | ||
|
|
||
| /** Whether the modal is displaying a confirmation loading spinner (useful when fetching data from API during confirmation) */ | ||
| shouldShowConfirmationLoader?: boolean; | ||
|
|
||
| /** Whether the user can confirm the tutorial while offline */ | ||
| canConfirmWhileOffline?: boolean; | ||
| }; | ||
|
|
||
| type FeatureTrainingModalVideoProps = { | ||
|
|
@@ -155,6 +177,12 @@ function FeatureTrainingModal({ | |
| imageHeight, | ||
| isModalDisabled = true, | ||
| shouldRenderSVG = true, | ||
| shouldRenderHTMLDescription = false, | ||
| shouldCloseOnConfirm = true, | ||
| avoidKeyboard = false, | ||
| shouldUseScrollView = false, | ||
| shouldShowConfirmationLoader = false, | ||
| canConfirmWhileOffline = true, | ||
| }: FeatureTrainingModalProps) { | ||
| const styles = useThemeStyles(); | ||
| const StyleUtils = useStyleUtils(); | ||
|
|
@@ -297,9 +325,11 @@ function FeatureTrainingModal({ | |
| }, [onClose, willShowAgain]); | ||
|
|
||
| const closeAndConfirmModal = useCallback(() => { | ||
| closeModal(); | ||
| if (shouldCloseOnConfirm) { | ||
| closeModal(); | ||
| } | ||
| onConfirm?.(); | ||
| }, [onConfirm, closeModal]); | ||
| }, [shouldCloseOnConfirm, onConfirm, closeModal]); | ||
|
|
||
| /** | ||
| * Extracts values from the non-scraped attribute WEB_PROP_ATTR at build time | ||
|
|
@@ -309,14 +339,17 @@ function FeatureTrainingModal({ | |
| */ | ||
| useLayoutEffect(parseFSAttributes, []); | ||
|
|
||
| const Wrapper = shouldUseScrollView ? ScrollView : View; | ||
|
|
||
| return ( | ||
| <Modal | ||
| avoidKeyboard={avoidKeyboard} | ||
| isVisible={isModalVisible} | ||
| type={onboardingIsMediumOrLargerScreenWidth ? CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE : CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED} | ||
| onClose={closeModal} | ||
| innerContainerStyle={{ | ||
| boxShadow: 'none', | ||
| paddingBottom: 20, | ||
| ...(shouldUseScrollView ? styles.pb0 : styles.pb5), | ||
| paddingTop: onboardingIsMediumOrLargerScreenWidth ? undefined : MODAL_PADDING, | ||
| ...(onboardingIsMediumOrLargerScreenWidth | ||
| ? // Override styles defined by MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE | ||
|
|
@@ -329,8 +362,9 @@ function FeatureTrainingModal({ | |
| ...modalInnerContainerStyle, | ||
| }} | ||
| > | ||
| <View | ||
| <Wrapper | ||
| style={[styles.mh100, onboardingIsMediumOrLargerScreenWidth && StyleUtils.getWidthStyle(width)]} | ||
| contentContainerStyle={shouldUseScrollView ? styles.pb5 : undefined} | ||
| fsClass={CONST.FULL_STORY.UNMASK} | ||
| testID={CONST.FULL_STORY.UNMASK} | ||
| > | ||
|
|
@@ -341,7 +375,13 @@ function FeatureTrainingModal({ | |
| {!!title && !!description && ( | ||
| <View style={[onboardingIsMediumOrLargerScreenWidth ? [styles.gap1, styles.mb8] : [styles.mb10], contentInnerContainerStyles]}> | ||
| {typeof title === 'string' ? <Text style={[styles.textHeadlineH1]}>{title}</Text> : title} | ||
| <Text style={styles.textSupporting}>{description}</Text> | ||
| {shouldRenderHTMLDescription ? ( | ||
| <Text> | ||
| <RenderHTML html={description} /> | ||
| </Text> | ||
|
Comment on lines
+379
to
+381
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. Coming from #63274 , we shouldn’t wrap
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. |
||
| ) : ( | ||
| <Text style={styles.textSupporting}>{description}</Text> | ||
| )} | ||
| {secondaryDescription.length > 0 && <Text style={[styles.textSupporting, styles.mt4]}>{secondaryDescription}</Text>} | ||
| {children} | ||
| </View> | ||
|
|
@@ -363,17 +403,19 @@ function FeatureTrainingModal({ | |
| text={helpText} | ||
| /> | ||
| )} | ||
| <Button | ||
| large | ||
| success | ||
| pressOnEnter | ||
| onPress={closeAndConfirmModal} | ||
| text={confirmText} | ||
| <FormAlertWithSubmitButton | ||
| onSubmit={closeAndConfirmModal} | ||
| isLoading={shouldShowConfirmationLoader} | ||
| buttonText={confirmText} | ||
| enabledWhenOffline={canConfirmWhileOffline} | ||
| /> | ||
| {!canConfirmWhileOffline && <OfflineIndicator />} | ||
| </View> | ||
| </View> | ||
| </Wrapper> | ||
| </Modal> | ||
| ); | ||
| } | ||
|
|
||
| export default FeatureTrainingModal; | ||
|
|
||
| export type {FeatureTrainingModalProps}; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import React from 'react'; | ||
| import {InteractionManager} from 'react-native'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import BaseTestDriveModal from './BaseTestDriveModal'; | ||
|
|
||
| function AdminTestDriveModal() { | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const navigate = () => { | ||
| InteractionManager.runAfterInteractions(() => { | ||
| Navigation.navigate(ROUTES.TEST_DRIVE_DEMO_ROOT); | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <BaseTestDriveModal | ||
| description={translate('testDrive.modal.description')} | ||
| onConfirm={navigate} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| AdminTestDriveModal.displayName = 'AdminTestDriveModal'; | ||
|
|
||
| export default AdminTestDriveModal; |
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.
There is a difference in View and ScrollView. In ScrollView there is an extra space that kinda hides the submit button, can we remove it?
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.
@s77rt this is what I get with the current changes:
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.
Yeah I'm referring to that extra space above the keyboard. Can it be removed?
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 is coming from the 20px bottom padding that is passed to the modal in
innerContainerStyle. I think we would need to keep the currentViewand add another wrapper that could be eitherScrollVieworFragment. This is needed because we have to satisfy two conditions: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 have not tested this well but what I found working is the following:
Wrapperto beScrollVieworFragmentand wrap the whole existingViewUh oh!
There was an error while loading. Please reload this page.
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.
@s77rt I tried these changes and they seem to do the trick:

Results:
442856461-da088978-99ad-4f32-8d25-cff102d804e3.mov
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.
Nice! Let's go with that but please confirm that this does not generate errors as we are passing
contentContainerStyleto aWrapperthat could be aViewwhich does not support this prop.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.
@s77rt I didn't see any console log with my changes, so it should be safe 😄
P.S: I added a condition so
contentContainerStyleis undefined whenshouldUseScrollViewis false