fix: prevent editing money request in case create failure#46376
Conversation
|
Little bit confused about the last three testing steps:
As we're disabling editing the request until the error (and request) are dismissed. |
|
Sorry @Ollyws. I updated the test steps. |
|
@dominictb It seems that editing is disabled on all requests: Screen.Recording.2024-07-30.at.11.56.41.mov |
|
@Ollyws this doesn't look right. Lemme check and get back to you later. |
|
@Ollyws sorry, I might mistakenly put an extra '!'. Remove it now and everything should work fine. |
Reviewer Checklist
Screenshots/VideosAndroid: Native01_Android_Native.mp4Android: mWeb Chrome02_Android_Chrome.mp4iOS: Native03_iOS_Native.mp4iOS: mWeb Safari04_iOS_Safari.mp4MacOS: Chrome / Safari05_MacOS_Chrome.mp4MacOS: Desktop06_MacOS_Desktop.mp4 |
neil-marcellini
left a comment
There was a problem hiding this comment.
Thank for the fix, I think it all looks pretty good. I added some non blocking suggestions, which you could address in a follow up if you like. If so please DM me on Slack so I can review.
| } | ||
|
|
||
| const transaction = linkedTransaction ?? getLinkedTransaction(reportAction ?? undefined); | ||
| if (!transaction?.transactionID || (transaction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD && !isEmptyObject(transaction.errors))) { |
There was a problem hiding this comment.
NAB: It would capture the intent better and be easier to read if we extract the if statement condition into a variable called transactionFailedToCreate. Alternatively we could explain with a comment.
| const originalMessage = parentReportAction && ReportActionsUtils.isMoneyRequestAction(parentReportAction) ? ReportActionsUtils.getOriginalMessage(parentReportAction) : undefined; | ||
| return originalMessage?.IOUTransactionID ?? '-1'; | ||
| }, [parentReportAction]); | ||
| const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`); |
There was a problem hiding this comment.
NAB: To match the previous behavior using withOnyx should we render null if the transaction status is loading from Onyx?
|
✋ 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/neil-marcellini in version: 9.0.15-4 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.0.15-9 🚀
|
Details
Fixed Issues
$ #44459
PROPOSAL: #44459 (comment)
Tests
Xicon to clear the errorVerify that: After step 8, the user couldn't edit the money request. After step 9, the errored money request is cleaned up properly and the user is navigated back to the relevant report screen
Offline tests
QA Steps
Xicon to clear the errorVerify that: After step 8, the user couldn't edit the money request. After step 9, the errored money request is cleaned up properly and the user is navigated back to the relevant report screen
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
compressed_android.mov.mp4
Android: mWeb Chrome
compressed_android.mov.mp4
iOS: Native
compressed_ios.mov.mp4
iOS: mWeb Safari
compressed_ios.mov.mp4
MacOS: Chrome / Safari
compressed_web.mov.mp4
MacOS: Desktop
compressed_web.mov.mp4