fix: UNREPORTEDTRANSACTION report action not show and no Explain sparkle link#87704
fix: UNREPORTEDTRANSACTION report action not show and no Explain sparkle link#87704Beamanator merged 1 commit intoExpensify:mainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@bernhardoj Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/Videos |
| const {fromReportID, reasoning} = unreportedTransactionOriginalMessage as OriginalMessageUnreportedTransaction; | ||
| if (reasoning) { |
There was a problem hiding this comment.
just curious, would it be better to use hasReasoning here?
| const {fromReportID, reasoning} = unreportedTransactionOriginalMessage as OriginalMessageUnreportedTransaction; | |
| if (reasoning) { | |
| const {fromReportID} = unreportedTransactionOriginalMessage as OriginalMessageUnreportedTransaction; | |
| if (hasReasoning(reportAction)) { |
There was a problem hiding this comment.
Oh, didn't know that existed. It basically does the same thing, checking whether reasoning exists or not.
The only difference is, hasReasoning accepts any type of action as the param, so it needs to check first whether the originalMessage contains reasoning or not.
App/src/libs/ReportActionsUtils.ts
Lines 4578 to 4581 in a327fc2
But in our case, we already checked the action name before, even though we typecast the original message unreportedTransactionOriginalMessage as OriginalMessageUnreportedTransaction;, which is honestly not the best way.
App/src/libs/ReportActionsUtils.ts
Lines 1241 to 1245 in a327fc2
If we want to remove the typecast, we need to create a new function to narrow down the type
function isUnreportedTransactionAction(reportAction: OnyxInputOrEntry<ReportAction>): reportAction is ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION> {
return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION);
}
...
if (isUnreportedTransactionAction(reportAction)) {
const unreportedTransactionOriginalMessage = getOriginalMessage(reportAction);
const fromReportID = unreportedTransactionOriginalMessage?.fromReportID;
const reasoning = unreportedTransactionOriginalMessage?.reasoning;
if (reasoning) {There was a problem hiding this comment.
aah i like your reasoning, thanks - let's keep it as is!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.3.60-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes required. This PR is a code-level bug fix in The existing help site articles (Approve-Expenses, Understanding-Report-Statuses-and-Actions) already cover expense rejection behavior accurately. |
|
This PR failing because of the issue #88139 |
|
ok from my checks it doesn't look like that issue was caused by this PR, this PR's test steps just pointed it out |





Explanation of Change
Fixed Issues
$#87239
PROPOSAL:#87239 (comment)
Tests
Preconditions:
moved this expense. Explain.Offline tests
QA Steps
Preconditions:
moved this expense. Explain.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov