Repository navigation
Show scan status bar when one of the receipt is scanning in expense report - #42240
Conversation
rojiphil
left a comment
There was a problem hiding this comment.
@bernhardoj
I have suggested a small change to use optional chaining operator at one place to be on the safer side. Please have a look.
Otherwise LGTM. Tests well too.
| const isDraft = ReportUtils.isOpenExpenseReport(moneyRequestReport); | ||
| const [isConfirmModalVisible, setIsConfirmModalVisible] = useState(false); | ||
|
|
||
| const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport.reportID).some((transaction) => TransactionUtils.isReceiptBeingScanned(transaction)); |
There was a problem hiding this comment.
| const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport.reportID).some((transaction) => TransactionUtils.isReceiptBeingScanned(transaction)); | |
| const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).some((transaction) => TransactionUtils.isReceiptBeingScanned(transaction)); |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari42240-web-safari.mp442240-web-safari-ioureport.mp4Android: Native4220-android-native.mp4Android: mWeb Chrome4220-mweb-chrome.mp4iOS: Native42240-ios-native.mp4iOS: mWeb Safari42240-mweb-safari.mp4MacOS: Desktop4220-desktop.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
Thanks @bernhardoj
LGTM and tests well.
|
@bernhardoj There are conflicts here. Can you please resolve them? |
|
Conflicts solved |
| onBackButtonPress={onBackButtonPress} | ||
| // Shows border if no buttons or next steps are showing below the header | ||
| shouldShowBorderBottom={!(shouldShowAnyButton && shouldUseNarrowLayout) && !(shouldShowNextStep && !shouldUseNarrowLayout) && !allHavePendingRTERViolation} | ||
| shouldShowBorderBottom={!isMoreContentShown && !allHavePendingRTERViolation} |
There was a problem hiding this comment.
@bernhardoj hmm.. Looks like I am missing something here. Can you please help me understand why we need to replace the existing conditions with isMoreContentShown? Both seem to be different.
There was a problem hiding this comment.
I'm trying to simplify it. We need to set shouldShowBorderBottom to false if hasScanningReceipt is true, but instead of appending it to the existing condition (&& !hasScanningReceipt), I just replaced it with isMoreContentShown.
Without simplifying:
!(shouldShowAnyButton && shouldUseNarrowLayout) && !(shouldShowNextStep && !shouldUseNarrowLayout) && !hasScanningReceipt && !allHavePendingRTERViolation
isMoreContentShown condition
shouldShowNextStep || hasScanningReceipt || (shouldShowAnyButton && shouldUseNarrowLayout)
If we reverse this (!isMoreContentShown), it becomes,
!shouldShowNextStep && !hasScanningReceipt && !(shouldShowAnyButton && shouldUseNarrowLayout)
repositioned:
!(shouldShowAnyButton && shouldUseNarrowLayout) && !shouldShowNextStep && !hasScanningReceipt
You can see that hasScanningReceipt and shouldShowAnyButton condition is the same. The only difference is shouldShowNextStep.
Next step component is put outside of the HeaderWithBackButton, no matter whether it's shouldUseNarrowLayout or not which has its own border bottom.
App/src/components/MoneyReportHeader.tsx
Lines 335 to 339 in 8375abe
App/src/components/MoneyReportHeader.tsx
Line 303 in 8375abe
So, we don't want the extra border bottom from the HeaderWithBackButton anymore.
|
@thienlnam All yours for review. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.4.77-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
Details
We want to show the scanning status bar below the header when there is a scanning receipt.
Fixed Issues
$ #40828
PROPOSAL: #40828 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Screen.Recording.2024-05-16.at.13.17.18.1.mov
MacOS: Chrome / Safari
MacOS: Desktop
Screen.Recording.2024-05-16.at.13.14.42.mov