Repository navigation
Remove report level actions from expense rows in Search #103588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
13f840c
912491d
336ccd2
25d486e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2154,12 +2154,17 @@ function getActions( | |
| } | ||
|
|
||
| const policy = getPolicyFromKey(data, report); | ||
| const isExportAvailable = isExportAction(report, currentUserLogin, policy, reportActions) && !isTransaction; | ||
| const isExportAvailable = !isTransaction && isExportAction(report, currentUserLogin, policy, reportActions); | ||
|
|
||
| if (isSettled(report) && !isExportAvailable) { | ||
| return [CONST.SEARCH.ACTION_TYPES.PAID]; | ||
| } | ||
|
|
||
| // Submit/Approve/Pay are report level actions, so expense rows only offer View. | ||
| if (isTransaction && !isInvoiceReport(report)) { | ||
| return [CONST.SEARCH.ACTION_TYPES.VIEW]; | ||
|
Comment on lines
+2164
to
+2165
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check looks at the report type, not the search type, so it also applies to The same reasoning probably applies to trips, but let's confirm with @trjExpensify or @mollfpr before merging 2026-10-09.18.21.03.mov
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yep 👍 |
||
| } | ||
|
|
||
| // We need to check both options for a falsy value since the transaction might not have an error but the report associated with it might. We return early if there are any errors for performance reasons, so we don't need to compute any other possible actions. | ||
|
|
||
| if (transaction?.errors || report?.errors) { | ||
|
apeyada marked this conversation as resolved.
Resolved
|
||
|
|
@@ -2183,8 +2188,7 @@ function getActions( | |
|
|
||
| const isChatReportArchived = isArchivedReport(data[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.chatReportID}`]); | ||
|
|
||
| // Submit/Approve/Pay can only be taken on transactions if the transaction is the only one on the report, otherwise `View` is the only option. | ||
| // If this condition is not met, return early for performance reasons | ||
| // Only invoice rows reach here. They get report actions only when the invoice has a single line. | ||
| if (isTransaction && !isOneTransactionReport(report)) { | ||
| return allActions.length > 0 ? allActions : [CONST.SEARCH.ACTION_TYPES.VIEW]; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.