Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
2045675
Update translations to include dynamic links for workspace rules in m…
marcochavezf Nov 18, 2025
cd95612
Enhance modified expense messages with dynamic links for workspace ru…
marcochavezf Nov 18, 2025
9a65aaa
Capitalize "Category" in modified expense messages for consistency wi…
marcochavezf Nov 18, 2025
432737c
Enhance ModifiedExpenseMessage tests to verify policyID casing preser…
marcochavezf Nov 18, 2025
106fa9a
Refactor ModifiedExpenseMessageTest for improved readability by remov…
marcochavezf Nov 18, 2025
5ab4d8a
Update translations for 'basedOnMCC' in multiple languages to improve…
marcochavezf Nov 18, 2025
e13e9f7
Merge branch 'main' into marco-updateUrlMCCCategorization
marcochavezf Nov 20, 2025
f2fc723
Refactor Onyx connection to use connectWithoutView for POLICY_TAGS an…
marcochavezf Nov 20, 2025
c41117d
Refactor report action handling to use policy directly instead of pol…
marcochavezf Nov 20, 2025
cfbb31a
Update test case for ModifiedExpenseMessage to clarify workspace rule…
marcochavezf Nov 20, 2025
ccf04a9
Merge branch 'main' into marco-updateUrlMCCCategorization
marcochavezf Nov 24, 2025
fb570a7
Refactor category label handling in getForReportActionTemp function t…
marcochavezf Nov 24, 2025
2260f3a
Update category label handling in getForReportAction function to ensu…
marcochavezf Nov 24, 2025
3a5a1f5
Merge branch 'main' into marco-updateUrlMCCCategorization
marcochavezf Nov 25, 2025
74961e5
Fix capitalization in ModifiedExpenseMessageTest expected results
marcochavezf Nov 25, 2025
1668a1f
Merge branch 'main' into marco-updateUrlMCCCategorization
marcochavezf Nov 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`änderte das ${translatedChangedField} zu ${newMerchant} (zuvor ${oldMerchant}), wodurch der Betrag auf ${newAmountToDisplay} aktualisiert wurde (zuvor ${oldAmountToDisplay})`,
basedOnAI: 'basierend auf früheren Aktivitäten',
basedOnMCC: 'basierend auf Arbeitsbereichsregel',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `gemäß den <a href="${rulesLink}">Regeln des Arbeitsbereichs</a>` : 'gemäß der Arbeitsbereichsregel'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `für ${comment}` : 'Ausgabe'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Rechnungsbericht Nr. ${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} gesendet${comment ? `für ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ const translations = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`changed the ${translatedChangedField} to ${newMerchant} (previously ${oldMerchant}), which updated the amount to ${newAmountToDisplay} (previously ${oldAmountToDisplay})`,
basedOnAI: 'based on past activity',
basedOnMCC: 'based on workspace rule',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `based on <a href="${rulesLink}">workspace rules</a>` : 'based on workspace rule'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `for ${comment}` : 'expense'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Invoice Report #${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} sent${comment ? ` for ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}) =>
`cambió la ${translatedChangedField} a ${newMerchant} (previamente ${oldMerchant}), lo que cambió el importe a ${newAmountToDisplay} (previamente ${oldAmountToDisplay})`,
basedOnAI: 'basado en actividad pasada',
basedOnMCC: 'basado en regla del espacio de trabajo',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `basado en <a href="${rulesLink}">reglas del espacio de trabajo</a>` : 'basado en regla del espacio de trabajo'),
threadExpenseReportName: ({formattedAmount, comment}) => `${comment ? `${formattedAmount} para ${comment}` : `Gasto de ${formattedAmount}`}`,
invoiceReportName: ({linkedReportID}) => `Informe de facturación #${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}) => `${formattedAmount} enviado${comment ? ` para ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`a changé le ${translatedChangedField} en ${newMerchant} (précédemment ${oldMerchant}), ce qui a mis à jour le montant à ${newAmountToDisplay} (précédemment ${oldAmountToDisplay})`,
basedOnAI: "basé sur l'activité passée",
basedOnMCC: "basé sur la règle de l'espace de travail",
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `selon <a href="${rulesLink}">les règles de l'espace de travail</a>` : 'selon la règle de lespace de travail'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `pour ${comment}` : 'dépense'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Rapport de Facture n°${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} envoyé${comment ? `pour ${comment}` : ''}`,
Expand Down
3 changes: 2 additions & 1 deletion src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,8 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`ha cambiato il ${translatedChangedField} in ${newMerchant} (precedentemente ${oldMerchant}), il che ha aggiornato l'importo a ${newAmountToDisplay} (precedentemente ${oldAmountToDisplay})`,
basedOnAI: 'basato su attività passate',
basedOnMCC: 'basato su regola dello spazio di lavoro',
basedOnMCC: ({rulesLink}: {rulesLink: string}) =>
rulesLink ? `in base alle <a href="${rulesLink}">regole dello spazio di lavoro</a>` : 'in base alla regola dello spazio di lavoro',
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `per ${comment}` : 'spesa'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Rapporto Fattura n. ${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} inviato${comment ? `per ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`${translatedChangedField}を${newMerchant}に変更しました(以前は${oldMerchant})、これにより金額が${newAmountToDisplay}に更新されました(以前は${oldAmountToDisplay})。`,
basedOnAI: '過去のアクティビティに基づく',
basedOnMCC: 'ワークスペースルールに基づく',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `<a href="${rulesLink}">ワークスペースのルール</a>に基づいて` : 'ワークスペースのルールに基づく'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `${comment}用` : '経費'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `請求書レポート #${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} 送信済み${comment ? `${comment} のために` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`veranderde de ${translatedChangedField} naar ${newMerchant} (voorheen ${oldMerchant}), wat het bedrag bijwerkte naar ${newAmountToDisplay} (voorheen ${oldAmountToDisplay})`,
basedOnAI: 'op basis van eerdere activiteit',
basedOnMCC: 'op basis van werkruimteregel',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `op basis van <a href="${rulesLink}">werkruimteregels</a>` : 'gebaseerd op werkruimteregel'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `voor ${comment}` : 'uitgave'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Factuurrapport #${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} verzonden${comment ? `voor ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`zmienił ${translatedChangedField} na ${newMerchant} (wcześniej ${oldMerchant}), co zaktualizowało kwotę na ${newAmountToDisplay} (wcześniej ${oldAmountToDisplay})`,
basedOnAI: 'na podstawie wcześniejszej aktywności',
basedOnMCC: 'na podstawie reguły przestrzeni roboczej',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `na podstawie <a href="${rulesLink}">zasad obszaru roboczego</a>` : 'na podstawie reguły obszaru roboczego'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `dla ${comment}` : 'wydatek'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Raport faktury nr ${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} wysłano${comment ? `dla ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`alterou o ${translatedChangedField} para ${newMerchant} (anteriormente ${oldMerchant}), o que atualizou o valor para ${newAmountToDisplay} (anteriormente ${oldAmountToDisplay})`,
basedOnAI: 'com base em atividades passadas',
basedOnMCC: 'com base na regra do espaço de trabalho',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `com base nas <a href="${rulesLink}">regras do espaço de trabalho</a>` : 'com base na regra do espaço de trabalho'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `para ${comment}` : 'despesa'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `Relatório de Fatura nº ${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} enviado${comment ? `para ${comment}` : ''}`,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ const translations: TranslationDeepObject<typeof en> = {
updatedTheDistanceMerchant: ({translatedChangedField, newMerchant, oldMerchant, newAmountToDisplay, oldAmountToDisplay}: UpdatedTheDistanceMerchantParams) =>
`将${translatedChangedField}更改为${newMerchant}(之前为${oldMerchant}),这更新了金额为${newAmountToDisplay}(之前为${oldAmountToDisplay})`,
basedOnAI: '基于过去的活动',
basedOnMCC: '基于工作空间规则',
basedOnMCC: ({rulesLink}: {rulesLink: string}) => (rulesLink ? `基于 <a href="${rulesLink}">工作区规则</a>` : '基于工作区规则'),
threadExpenseReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} ${comment ? `为${comment}` : '费用'}`,
invoiceReportName: ({linkedReportID}: OriginalMessage<typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW>) => `发票报告 #${linkedReportID}`,
threadPaySomeoneReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} 已发送${comment ? `对于${comment}` : ''}`,
Expand Down
59 changes: 51 additions & 8 deletions src/libs/ModifiedExpenseMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PolicyTagLists, Report, ReportAction} from '@src/types/onyx';
import ROUTES from '@src/ROUTES';
import type {Policy, PolicyTagLists, Report, ReportAction} from '@src/types/onyx';
import {getDecodedCategoryName} from './CategoryUtils';
import {convertToDisplayString} from './CurrencyUtils';
import DateUtils from './DateUtils';
import {getEnvironmentURL} from './Environment/Environment';
// eslint-disable-next-line @typescript-eslint/no-deprecated
import {translateLocal} from './Localize';
import Log from './Log';
import Parser from './Parser';
import {getCleanedTagName, getSortedTagKeys} from './PolicyUtils';
import {getCleanedTagName, getPolicy, getSortedTagKeys, isPolicyAdmin} from './PolicyUtils';
import {getOriginalMessage, isModifiedExpenseAction} from './ReportActionsUtils';
// eslint-disable-next-line import/no-cycle
import {buildReportNameFromParticipantNames, getPolicyExpenseChatName, getPolicyName, getReportName, getRootParentReport, isPolicyExpenseChat, isSelfDM} from './ReportUtils';
import {getFormattedAttendees, getTagArrayFromName} from './TransactionUtils';

let allPolicyTags: OnyxCollection<PolicyTagLists> = {};
Onyx.connect({
Onyx.connectWithoutView({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcochavezf this is wrong. The functions using these values are connected to UI components. Please fix this ASAP, it is already causing problems with people following this anti-pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, working on this tomorrow morning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting up to date with the Onyx migration; it looks like the correct solution here is to migrate remaining callers (ReportActionItem.tsx, BrowserNotifications.ts, ReportUtils.ts, etc.) to use getForReportActionTemp, correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgolen AFAIK we need to update getForReportActionTemp to accept currentUserLogin as a parameter instead of reading it from Onyx.connect (because we added currentUserLogin in this PR). That would also updating both getForReportActionTemp and getForReportAction to accept a currentUserLogin parameter for this scope, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds right, yeah. I haven't dug into it super close though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great, I outlined a plan here, since this requires multiple files, and I think we need to update them gradually in different PRs

key: ONYXKEYS.COLLECTION.POLICY_TAGS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -31,6 +33,21 @@ Onyx.connect({
},
});

let environmentURL: string;
getEnvironmentURL().then((url: string) => (environmentURL = url));

let currentUserLogin = '';
Onyx.connectWithoutView({
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, value is undefined
if (!value) {
return;
}
currentUserLogin = value?.email ?? '';
},
});

/**
* Builds the partial message fragment for a modified field on the expense.
*/
Expand Down Expand Up @@ -283,15 +300,26 @@ function getForReportAction({
const hasModifiedCategory = isReportActionOriginalMessageAnObject && 'oldCategory' in reportActionOriginalMessage && 'category' in reportActionOriginalMessage;
if (hasModifiedCategory) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
let categoryLabel = translateLocal('common.category');
let categoryLabel = translateLocal('common.category').toLowerCase();

// Add attribution suffix based on source
if (reportActionOriginalMessage?.source === CONST.CATEGORY_SOURCE.AI) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnAI')}`;
} else if (reportActionOriginalMessage?.source === CONST.CATEGORY_SOURCE.MCC) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC')}`;
const policy = getPolicy(policyID);
const isAdmin = isPolicyAdmin(policy, currentUserLogin);

// For admins, create a hyperlink to the workspace rules page
if (isAdmin && policy?.id) {
const rulesLink = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policy.id)}`;
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC', {rulesLink})}`;
} else {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC', {rulesLink: ''})}`;
}
}

buildMessageFragmentForValue(
Expand All @@ -302,6 +330,8 @@ function getForReportAction({
setFragments,
removalFragments,
changeFragments,
// Don't convert to lowercase when we have source attribution (to preserve any HTML links)
false,
);
}

Expand Down Expand Up @@ -436,11 +466,13 @@ function getForReportAction({
*/
function getForReportActionTemp({
reportAction,
policy,
movedFromReport,
movedToReport,
policyTags,
}: {
reportAction: OnyxEntry<ReportAction>;
policy?: OnyxEntry<Policy>;
movedFromReport?: OnyxEntry<Report>;
movedToReport?: OnyxEntry<Report>;
policyTags: OnyxEntry<PolicyTagLists>;
Expand Down Expand Up @@ -531,15 +563,24 @@ function getForReportActionTemp({
const hasModifiedCategory = isReportActionOriginalMessageAnObject && 'oldCategory' in reportActionOriginalMessage && 'category' in reportActionOriginalMessage;
if (hasModifiedCategory) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
let categoryLabel = translateLocal('common.category');
let categoryLabel = translateLocal('common.category').toLowerCase();

// Add attribution suffix based on source
if (reportActionOriginalMessage?.source === CONST.CATEGORY_SOURCE.AI) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnAI')}`;
} else if (reportActionOriginalMessage?.source === CONST.CATEGORY_SOURCE.MCC) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC')}`;
const isAdmin = isPolicyAdmin(policy, currentUserLogin);

// For admins, create a hyperlink to the workspace rules page
if (isAdmin && policy?.id) {
const rulesLink = `${environmentURL}/${ROUTES.WORKSPACE_RULES.getRoute(policy.id)}`;
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC', {rulesLink})}`;
} else {
// eslint-disable-next-line @typescript-eslint/no-deprecated
categoryLabel += ` ${translateLocal('iou.basedOnMCC', {rulesLink: ''})}`;
}
}

buildMessageFragmentForValue(
Expand All @@ -550,6 +591,8 @@ function getForReportActionTemp({
setFragments,
removalFragments,
changeFragments,
// Don't convert to lowercase when we have source attribution (to preserve any HTML links)
false,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function BaseReportActionContextMenu({
const [originalReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`, {canBeMissing: true});
const isOriginalReportArchived = useReportIsArchived(originalReportID);
const policyID = report?.policyID;
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {canBeMissing: true});
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`, {canBeMissing: true});

const [movedFromReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(reportAction, CONST.REPORT.MOVE_TYPE.FROM)}`, {canBeMissing: true});
Expand Down Expand Up @@ -374,6 +375,7 @@ function BaseReportActionContextMenu({
movedFromReport,
movedToReport,
getLocalDateFromDatetime,
policy,
policyTags,
translate,
};
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ type ContextMenuActionPayload = {
movedFromReport?: OnyxEntry<ReportType>;
movedToReport?: OnyxEntry<ReportType>;
getLocalDateFromDatetime: LocaleContextProps['getLocalDateFromDatetime'];
policy?: OnyxEntry<Policy>;
policyTags: OnyxEntry<PolicyTagLists>;
translate: LocalizedTranslate;
};
Expand Down Expand Up @@ -541,6 +542,7 @@ const ContextMenuActions: ContextMenuAction[] = [
movedToReport,
childReport,
getLocalDateFromDatetime,
policy,
policyTags,
translate,
},
Expand All @@ -563,6 +565,7 @@ const ContextMenuActions: ContextMenuAction[] = [
} else if (isModifiedExpenseAction(reportAction)) {
const modifyExpenseMessage = getForReportActionTemp({
reportAction,
policy,
movedFromReport,
movedToReport,
policyTags,
Expand Down
Loading
Loading