-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Display a system message explaining report creation for moving unapproved expenses from the original report #78267
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
e98112b
1bbd178
4bea7d8
7b62e22
e4d363e
0559212
93ebb7a
17db23a
d40c3f0
8c4ae37
d35ecea
60f6713
00a9101
a60b4cd
34e066d
a54536e
2b152ea
692884b
8655fff
e4cd3b4
041ea61
b7e5ea3
73cf60c
5275fe0
a2a05b4
26d5a40
f541d57
3d93827
5897491
e7e030d
d852c7d
edeccd4
5dde21f
f66d87e
26a038c
8bde79a
8f628e6
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 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -177,6 +177,7 @@ import { | |||||||||||||||||||||||||||||
| getCardIssuedMessage, | ||||||||||||||||||||||||||||||
| getChangedApproverActionMessage, | ||||||||||||||||||||||||||||||
| getCompanyCardConnectionBrokenMessage, | ||||||||||||||||||||||||||||||
| getCreatedReportForUnapprovedTransactionsMessage, | ||||||||||||||||||||||||||||||
| getDefaultApproverUpdateMessage, | ||||||||||||||||||||||||||||||
| getDismissedViolationMessageText, | ||||||||||||||||||||||||||||||
| getExportIntegrationLastMessageText, | ||||||||||||||||||||||||||||||
|
|
@@ -5853,6 +5854,14 @@ function getReportName( | |||||||||||||||||||||||||||||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||||||||||||||||||||||||||||||
| return getWorkspaceCustomUnitRateDeletedMessage(translateLocal, parentReportAction); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS)) { | ||||||||||||||||||||||||||||||
| const {originalID} = getOriginalMessage(parentReportAction) ?? {}; | ||||||||||||||||||||||||||||||
| const originalReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalID}`]; | ||||||||||||||||||||||||||||||
| // eslint-disable-next-line @typescript-eslint/no-deprecated -- temporarily disabling rule for deprecated functions out of issue scope | ||||||||||||||||||||||||||||||
| const reportName = getReportName(originalReport); | ||||||||||||||||||||||||||||||
| // eslint-disable-next-line @typescript-eslint/no-deprecated -- temporarily disabling rule for deprecated functions out of issue scope | ||||||||||||||||||||||||||||||
| return getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, translateLocal); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+5857
to
+5864
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. What i did:
Suggested change
And this code was never executed and name of mentioned action was still correct. Is this code really needed?
Contributor
Author
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. @sosek108 It's the report thread name. If you're refactoring it, it will be covered by this test App/tests/ui/components/HeaderViewTest.tsx Lines 135 to 136 in 24fd24e
Screen.Recording.2026-02-26.at.16.34.33.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. Thanks for confirming |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if (isChatThread(report)) { | ||||||||||||||||||||||||||||||
| if (!isEmptyObject(parentReportAction) && isTransactionThread(parentReportAction)) { | ||||||||||||||||||||||||||||||
|
|
@@ -7258,6 +7267,41 @@ function buildOptimisticUnapprovedReportAction(amount: number, currency: string, | |||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Builds an optimistic CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS system report action. | ||||||||||||||||||||||||||||||
| * Used to inform users that a new report was created for held/unapproved transactions. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| function buildOptimisticCreatedReportForUnapprovedAction( | ||||||||||||||||||||||||||||||
| reportID: string, | ||||||||||||||||||||||||||||||
| originalReportID: string | undefined, | ||||||||||||||||||||||||||||||
| ): ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS> { | ||||||||||||||||||||||||||||||
| const createdTime = DateUtils.getDBTime(); | ||||||||||||||||||||||||||||||
| const actor = getAccountIDsByLogins([CONST.EMAIL.CONCIERGE]).at(0); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||
| actionName: CONST.REPORT.ACTIONS.TYPE.CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS, | ||||||||||||||||||||||||||||||
| actorAccountID: actor, | ||||||||||||||||||||||||||||||
| avatar: getDefaultAvatarURL({accountID: actor, accountEmail: CONST.EMAIL.CONCIERGE}), | ||||||||||||||||||||||||||||||
| created: createdTime, | ||||||||||||||||||||||||||||||
| lastModified: createdTime, | ||||||||||||||||||||||||||||||
| message: [], | ||||||||||||||||||||||||||||||
| originalMessage: { | ||||||||||||||||||||||||||||||
| originalID: originalReportID, | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| reportActionID: rand64(), | ||||||||||||||||||||||||||||||
| reportID, | ||||||||||||||||||||||||||||||
| pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||||||||||||||||||||||||||||||
| isOptimisticAction: true, | ||||||||||||||||||||||||||||||
| shouldShow: true, | ||||||||||||||||||||||||||||||
| person: [ | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| text: CONST.DISPLAY_NAME.EXPENSIFY_CONCIERGE, | ||||||||||||||||||||||||||||||
| type: 'TEXT', | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Builds an optimistic MOVED report action with a randomly generated reportActionID. | ||||||||||||||||||||||||||||||
| * This action is used when we move reports across workspaces. | ||||||||||||||||||||||||||||||
|
|
@@ -12809,6 +12853,7 @@ export { | |||||||||||||||||||||||||||||
| buildOptimisticAddCommentReportAction, | ||||||||||||||||||||||||||||||
| buildOptimisticApprovedReportAction, | ||||||||||||||||||||||||||||||
| checkBulkRejectHydration, | ||||||||||||||||||||||||||||||
| buildOptimisticCreatedReportForUnapprovedAction, | ||||||||||||||||||||||||||||||
| buildOptimisticUnapprovedReportAction, | ||||||||||||||||||||||||||||||
| buildOptimisticCancelPaymentReportAction, | ||||||||||||||||||||||||||||||
| buildOptimisticChangedTaskAssigneeReportAction, | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.