Display a system message explaining report creation for moving unapproved expenses from the original report#78267
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
…report after partial approval
…NS to CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS
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.
|
|
@cristipaval can you trigger translation workflow for me on this PR? |
…NSACTIONS - Add test for isDeletedAction to verify it returns false for CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS actions with empty message array - Add comprehensive test suite for buildOptimisticCreatedReportForUnapprovedAction function - Add test for getCreatedReportForUnapprovedTransactionsMessage function - Tests verify all required properties including action name, IDs, optimistic flags, actor, and timestamp fields
just did it |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 38639ee1..76b91544 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -951,6 +951,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'als Copilot für',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`hat diesen Bericht erstellt, um alle Ausgaben aus <a href="${reportUrl}">${reportName}</a> aufzunehmen, die mit der von dir gewählten Frequenz nicht eingereicht werden konnten`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `hat diesen Bericht für alle zurückgehaltenen Ausgaben aus <a href="${reportUrl}">${reportName}</a> erstellt`,
},
mentionSuggestions: {
hereAlternateText: 'Alle in dieser Unterhaltung benachrichtigen',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 5fe5aaa8..3797530c 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -955,6 +955,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'en tant que copilote pour',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`a créé ce rapport pour regrouper toutes les dépenses de <a href="${reportUrl}">${reportName}</a> qui n'ont pas pu être soumises selon la fréquence que vous avez choisie`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `a créé ce rapport pour toutes les dépenses en attente depuis <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notifier tout le monde dans cette conversation',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 50fe5beb..aad74342 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -951,6 +951,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'come copilota per',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`ha creato questo rapporto per raccogliere tutte le spese di <a href="${reportUrl}">${reportName}</a> che non sono state inviate con la frequenza scelta`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `ha creato questo report per eventuali spese in sospeso da <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notifica tutti in questa conversazione',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 8b13494e..29a7cda0 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -950,6 +950,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'のコパイロットとして',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`選択した頻度では提出できなかった <a href="${reportUrl}">${reportName}</a> のすべての経費をまとめるためにこのレポートを作成しました`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `<a href="${reportUrl}">${reportName}</a> から保留中の経費のためにこのレポートを作成しました`,
},
mentionSuggestions: {
hereAlternateText: 'この会話の全員に通知',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index d461fa20..d6c15dcd 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -951,6 +951,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'als copiloot voor',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`heeft dit rapport aangemaakt om alle uitgaven van <a href="${reportUrl}">${reportName}</a> op te nemen die niet konden worden ingediend met de door jou gekozen frequentie`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `heeft dit rapport gemaakt voor uitgestelde uitgaven van <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Iedereen in dit gesprek op de hoogte stellen',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 859934be..dd28a837 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -950,6 +950,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'jako kopilot dla',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`utworzył ten raport, aby zawrzeć wszystkie wydatki z <a href="${reportUrl}">${reportName}</a>, które nie mogły zostać przesłane zgodnie z wybraną przez ciebie częstotliwością`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `utworzył ten raport dla wszystkich wstrzymanych wydatków z <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Powiadom wszystkich w tej konwersacji',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 4f67d07d..352e09b1 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -950,6 +950,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'como copiloto para',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`criou este relatório para agrupar todas as despesas de <a href="${reportUrl}">${reportName}</a> que não puderam ser enviadas na frequência que você escolheu`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `criou este relatório para quaisquer despesas retidas de <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notificar todos nesta conversa',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 23c246d3..bcf74d55 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -942,6 +942,8 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: '作为副驾驶用于',
harvestCreatedExpenseReport: ({reportUrl, reportName}: HarvestCreatedExpenseReportParams) =>
`创建了此报表以汇总 <a href="${reportUrl}">${reportName}</a> 中无法按您选择的频率提交的所有费用`,
+ createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
+ `为来自 <a href="${reportUrl}">${reportName}</a> 的所有暂挂报销创建了此报表`,
},
mentionSuggestions: {
hereAlternateText: '通知此对话中的所有人',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
I replied to all your feedback. It seems this is the last one #78267 (comment) |
| import type {ValueOf} from 'type-fest'; | ||
| import type {LocaleContextProps, LocalizedTranslate} from '@components/LocaleContextProvider'; | ||
| import usePrevious from '@hooks/usePrevious'; | ||
| import {isHarvestCreatedExpenseReport, isPolicyExpenseChat} from '@libs/ReportUtils'; |
There was a problem hiding this comment.
Please fix this import as well.
src/libs/ReportUtils.ts
Outdated
| const {originalID} = getOriginalMessage(parentReportAction) ?? {}; | ||
| const originalReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalID}`]; | ||
| // temporarily disabling rule for deprecated functions out of issue scope | ||
| // eslint-disable-next-line @typescript-eslint/no-deprecated |
There was a problem hiding this comment.
Please add single line comment for each eslint-disable that you have added. you can add the comment on the same line as disale rule line.
There was a problem hiding this comment.
This reverts commit 5897491.
|
BUG: The report created by partial payment also shows this message. Expected: Only partial approval creates the message. cc: @cristipaval Steps:
|
…report action - Add isApprovalFlow parameter (default false) to getReportFromHoldRequestsOnyxData - Only build optimistic created report action for approval flows, not payment flows - Centralize approval flow specific Onyx data updates in single block - Update return type to handle optional action ID - Fix type safety with explicit if statement instead of ternary
|
@parasharrajat I fixed this |
@hoangzinh Are we doing this? |
|
No, @parasharrajat. This was already handled in #78142 |
Screenshots🔲 iOS / native10.01.2026_01.05.57_REC.mp4🔲 iOS / Safari10.01.2026_00.46.17_REC.mp4🔲 MacOS / Chrome10.01.2026_00.30.13_REC.mp4🔲 Android / Chrome🔲 Android / native10.01.2026_15.54.40_REC.mp4 |
parasharrajat
left a comment
There was a problem hiding this comment.
Reviewer Checklist
- I have verified the author checklist is complete (all boxes are checked off).
- I verified the correct issue is linked in the
### Fixed Issuessection above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the steps for local testing are in the
Testssection - I verified the steps for Staging and/or Production testing are in the
QA stepssection - I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
- I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
- I verified the steps for local testing are in the
- I checked that screenshots or videos are included for tests on all platforms
- I included screenshots or videos for tests on all platforms
- I verified tests pass on all platforms & I tested again on:
- Android: Native
- Android: mWeb Chrome
- iOS: Native
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
- If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
- I verified proper code patterns were followed (see Reviewing the code)
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
toggleReportand notonIconClick). - I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g.
myBool && <MyComponent />. - I verified that comments were added to code that is not self explanatory
- I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
- I verified any copy / text shown in the product is localized by adding it to
src/languages/*files and using the translation method - I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
- I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the
Waiting for Copylabel for a copy review on the original GH to get the correct copy. - I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
- I verified the JSDocs style guidelines (in
STYLE.md) were followed
- I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e.
- If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like
Avatar, I verified the components usingAvatarhave been tested & I retested again) - I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
- If a new component is created I verified that:
- A similar component doesn't exist in the codebase
- All props are defined accurately and each prop has a
/** comment above it */ - The file is named correctly
- The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- The only data being stored in the state is data necessary for rendering and nothing else
- For Class Components, any internal methods passed to components event handlers are bound to
thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor) - Any internal methods bound to
thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick) - All JSX used for rendering exists in the render method
- The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
- If any new file was added I verified that:
- The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
- If a new CSS style is added I verified that:
- A similar style doesn't already exist
- The style can't be created with an existing StyleUtils function (i.e.
StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
- If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like
Avataris modified, I verified thatAvataris working as expected in all cases) - If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- If the PR modifies the form input styles:
- I verified that all the inputs inside a form are aligned with each other.
- I added
Designlabel so the design team can review the changes.
- If a new page is added, I verified it's using the
ScrollViewcomponent to make it scrollable when more elements are added to the page. - If the
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
🎀 👀 🎀 C+ reviewed
|
✋ 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/cristipaval in version: 9.3.0-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.3.0-8 🚀
|
| 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); | ||
| } |
There was a problem hiding this comment.
What i did:
- modified this if to
| 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); | |
| } | |
| if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS)) { | |
| console.log('SHOW THIS LOG') | |
| return 'Early return to test this' | |
| } |
- followed test steps from
QA
And this code was never executed and name of mentioned action was still correct. Is this code really needed?
There was a problem hiding this comment.
@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
Explanation of Change
Fixed Issues
$ #74577
PROPOSAL:
Tests
Same as QA
Offline tests
Same as QA
QA Steps
created this report for any held expense from #{original report}from "Concierge"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))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
Screen.Recording.2025-12-31.at.17.10.30.android.mov
Android: mWeb Chrome
Screen.Recording.2025-12-31.at.08.11.05.android.c.mov
iOS: Native
Screen.Recording.2025-12-31.at.17.29.12.mov
iOS: mWeb Safari
Screen.Recording.2025-12-31.at.17.25.33.ios.safari.mov
MacOS: Chrome / Safari
Screen.Recording.2025-12-31.at.08.04.57.web.mov