Split expense flow v2 Phase1#63092
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @lakchote has triggered a test app build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.1.55-0 🚀
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.1.56-2 🚀
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.1.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.1.58-4 🚀
|
| }; | ||
|
|
||
| const {report, participantParams, policyParams, transactionParams} = requestMoneyInformation; | ||
| const parsedComment = getParsedComment(transactionParams.comment ?? ''); |
There was a problem hiding this comment.
Coming from: #64061, we also need to use htmlToMarkdown here
|
|
||
| const firstIOU = iouActions.at(0); | ||
| if (firstIOU) { | ||
| const {updatedReportAction, iouReport} = prepareToCleanUpMoneyRequest(originalTransactionID, firstIOU, Permissions.canUseTableReportView(betas)); |
There was a problem hiding this comment.
This caused
We should delete the original transaction thread
| description: transactionDetails?.comment, | ||
| category: transactionDetails?.category, | ||
| tags: transaction?.tag ? [transaction?.tag] : [], | ||
| created: transactionDetails?.created ?? DateUtils.getDBTime(), |
There was a problem hiding this comment.
We should have formatted this. Not doing so caused #63712
|
Coming from #65324 If split isn't available, we should show |
|
|
||
| const existingTransactionID = splitExpense.transactionID; | ||
|
|
||
| const {transactionThreadReportID, createdReportActionIDForThread, onyxData, iouAction} = getMoneyRequestInformation({ |
There was a problem hiding this comment.
Coming from #72395, we need to handle split card expenses offline as well. Details here: #72395 (comment)
|
|
||
| const firstIOU = iouActions.at(0); | ||
| if (firstIOU) { | ||
| const {updatedReportAction, iouReport} = prepareToCleanUpMoneyRequest(originalTransactionID, firstIOU, Permissions.canUseTableReportView(betas)); |
There was a problem hiding this comment.
This caused #73386 as prepareToCleanUpMoneyRequest deletes all the IOU report actions if we are deleting the last expense inside the report.
More details: #73386 (comment)
| const {amount} = getTransactionDetails(reportTransaction) ?? {}; | ||
| if (!amount) { | ||
| return false; | ||
| } | ||
|
|
||
| const {isExpenseSplit, isBillSplit} = getOriginalTransactionWithSplitInfo(reportTransaction); | ||
| if (isExpenseSplit || isBillSplit) { | ||
| return false; | ||
| } | ||
|
|
||
| if (!isExpenseReportUtils(report)) { | ||
| return false; | ||
| } | ||
|
|
||
| if (report.stateNum && report.stateNum >= CONST.REPORT.STATE_NUM.APPROVED) { |
There was a problem hiding this comment.
There is an bug here which prevents showing this split action for scanned expenses when user edits the amount manually. #80516
| return canAddTransaction(report); | ||
| } | ||
|
|
||
| function isSplitAction(report: Report, reportTransactions: Transaction[], policy?: Policy): boolean { |
There was a problem hiding this comment.
We missed a case when the user submits an expense, then changes the submission frequency to Instant.
More details in:
#77663 (comment)
Explanation of Change
Implement Split expense flow (Phase 1)
Fixed Issues
$ #61027
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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
MacOS: Chrome / Safari
MacOS: Desktop