[TS Migration] Define a concise way to access or default to an inexistent record#42634
Conversation
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
src/pages/workspace/reimburse/WorkspaceRateAndUnitPage/InitialPage.tsx
Outdated
Show resolved
Hide resolved
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-native-2024-06-04_14.55.53.mp4Android: mWeb Chromeandroid-chrome-2024-06-04_15.16.24.mp4iOS: Nativeios-native-2024-06-04_11.45.41.mp4iOS: mWeb Safariios-safari-2024-06-04_13.02.27.mp4MacOS: Chrome / Safaridesktop-chrome-2024-06-04_11.10.19.mp4MacOS: Desktopdesktop-app-2024-06-04_11.17.21.mp4 |
This comment was marked as resolved.
This comment was marked as resolved.
|
@jjcoffee lets do proper testing and PR on this and once you cannot find any regressions, we will create a build and ask Applause to do a full regression testing |
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
|
@jjcoffee comment resolved :D |
This comment was marked as resolved.
This comment was marked as resolved.
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
|
@jjcoffee done! |
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
|
@blimpich ts issue resolved and merge conflicts too |
|
Ad-hoc build has been triggered. Hopefully ready soon. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
@jjcoffee new build ready for you to test. Thank you! |
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
|
@blimpich I think we're good to go! I've confirmed all issues are resolved, with the following caveats:
Resolved
|
…s-migration/Define-concise-way-to-access-or-default-to-an-inexistent-record
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel! Workspace - The default data in the Tax ID number field is "-1"Version Number: v1.4.78-4 adhoc Action Performed:
Expected Result:The field should be empty. Actual Result:The default data in the Tax ID number field is "-1". Workaround:Unknown Platforms:Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 1.4.84-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.84-3 🚀
|
| const defaultCompanyTaxId = reimbursementAccount?.achData?.companyTaxID ?? ''; | ||
| const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? 0; | ||
| const defaultCompanyTaxId = reimbursementAccount?.achData?.companyTaxID ?? '-1'; | ||
| const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? -1; |
There was a problem hiding this comment.
This change raise regression #45073 has fixed, due to companyTaxID is a string, so the fallback value must be an empty string
| // We don't allow IOU actions if an Expensify account is a participant of the report, unless the policy that the report is on is owned by an Expensify account | ||
| const doParticipantsIncludeExpensifyAccounts = lodashIntersection(reportParticipants, CONST.EXPENSIFY_ACCOUNT_IDS).length > 0; | ||
| const isPolicyOwnedByExpensifyAccounts = report?.policyID ? CONST.EXPENSIFY_ACCOUNT_IDS.includes(getPolicy(report?.policyID ?? '')?.ownerAccountID ?? 0) : false; | ||
| const isPolicyOwnedByExpensifyAccounts = report?.policyID ? CONST.EXPENSIFY_ACCOUNT_IDS.includes(getPolicy(report?.policyID ?? '-1')?.ownerAccountID ?? -1) : false; |
There was a problem hiding this comment.
This caused #44985 as a side effect. A simple change like this couldn't have prevented the bug though – it required a little deeper fix.

Details
Fixed Issues
$ #39125
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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.mp4
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4