Repository navigation
[TS migration] Migrate 'ValidateCodeForm' component to TypeScript - #35404
tylerkaraszewski merged 23 commits into
Conversation
| type WithToggleVisibilityViewProps = { | ||
| /** Whether the content is visible. */ | ||
| isVisible: boolean; | ||
| isVisible?: boolean; |
There was a problem hiding this comment.
Yes, it's used in BaseValidateCodeForm.tsx and if not optional, it will cause type errors in ValidateCodeForm/ as the component expects isVisible prop which actually comes from a HOC.
There was a problem hiding this comment.
- BaseValidateCodeForm expects
isVisibleto have typebooleansince we always set it in withToggleVisibilityView - ValidateCodeForm expects
isVisibleto have typeboolean | undefined
So I think we should revert the change here to make the prop required and modify ValidateCodeFormProps to make it accept an optional isVisible prop.
We pass isVisible to ValidateCodeForm in SignInPage
App/src/pages/signin/SignInPage.js
Line 282 in a839310
|
@s77rt I updated the PR, thanks for your comments! |
|
@JKobrynski Did you get a chance to check #35404 (comment)? |
|
FYI @JKobrynski is OOO from Feb 12th to Feb 16th. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb-1.movMacOS: Desktopdesktop.mov |
|
@s77rt PR updated! |
s77rt
left a comment
There was a problem hiding this comment.
Forgot to submit those two non-blockers comments
| const timerRef = useRef<NodeJS.Timeout>(); | ||
|
|
||
| const hasError = Boolean(account) && !isEmptyObject(account?.errors) && !needToClearError; | ||
| const hasError = !isEmptyObject(account) && !isEmptyObject(account?.errors) && !needToClearError; |
There was a problem hiding this comment.
| const hasError = !isEmptyObject(account) && !isEmptyObject(account?.errors) && !needToClearError; | |
| const hasError = !!account && !isEmptyObject(account.errors) && !needToClearError; |
NAB. Truthy check is enough as we. have the empty object check on errors
| return ( | ||
| <View style={[styles.changeExpensifyLoginLinkContainer, styles.mt3]}> | ||
| {!isEmptyObject(credentials?.login) && <Text style={styles.mr1}>{translate('loginForm.notYou', {user: formatPhoneNumber(credentials?.login)})}</Text>} | ||
| {!!credentials?.login && <Text style={styles.mr1}>{translate('loginForm.notYou', {user: credentials?.login ? formatPhoneNumber(credentials.login) : ''})}</Text>} |
There was a problem hiding this comment.
| {!!credentials?.login && <Text style={styles.mr1}>{translate('loginForm.notYou', {user: credentials?.login ? formatPhoneNumber(credentials.login) : ''})}</Text>} | |
| {!!credentials?.login && <Text style={styles.mr1}>{translate('loginForm.notYou', {user: formatPhoneNumber(credentials.login)})}</Text>} |
credentials.login is guaranteed to be a string at this point
|
Can you also check the failing typescript tests (one is related to this PR. for the other try merge main) |
|
@s77rt updated! |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #31978 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 1.4.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
Fixed Issues
$ #31978
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as Tests section above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android-compressed.webm
Android: mWeb Chrome
chrome-compressed.webm
iOS: Native
ios-compressed.mp4
iOS: mWeb Safari
safari-compressed.mp4
MacOS: Chrome / Safari
web-compresseed.mov
MacOS: Desktop
desktop-compressed.mov