Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import RenderHTML from '@components/RenderHTML';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import {getCreatedReportForUnapprovedTransactionsMessage, getOriginalMessage} from '@libs/ReportActionsUtils';
import {getCreatedReportForUnapprovedTransactionsMessage, getOriginalMessage, isOriginalReportDeleted} from '@libs/ReportActionsUtils';
import {getReportName} from '@libs/ReportNameUtils';
import ReportActionItemBasicMessage from '@pages/inbox/report/ReportActionItemBasicMessage';
import type CONST from '@src/CONST';
Expand All @@ -17,9 +17,9 @@ type CreatedReportForUnapprovedTransactionsActionProps = {
function CreatedReportForUnapprovedTransactionsAction({action}: CreatedReportForUnapprovedTransactionsActionProps) {
const {originalID} = getOriginalMessage(action) ?? {};
const {translate} = useLocalize();
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${originalID}`);
const reportName = getReportName(report);
const htmlContent = `<comment><muted-text>${getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, translate)}</muted-text></comment>`;
const [originalReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${originalID}`);
const reportName = getReportName(originalReport);
const htmlContent = `<comment><muted-text>${getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, isOriginalReportDeleted(action, originalReport), translate)}</muted-text></comment>`;

return (
<ReportActionItemBasicMessage>
Expand Down
6 changes: 4 additions & 2 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'als Copilot für',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`hat diesen Bericht erstellt, um alle Ausgaben aus <a href="${reportUrl}">${reportName}</a> aufzunehmen, die nicht mit der von dir gewählten Häufigkeit eingereicht werden konnten`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`erstellte diesen Bericht für alle zurückgehaltenen Ausgaben aus <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `hat diesen Bericht für alle zurückgehaltenen Ausgaben aus dem gelöschten Bericht #${reportID} erstellt`
Comment thread
hoangzinh marked this conversation as resolved.
: `hat diesen Bericht für alle zurückgehaltenen Ausgaben aus <a href="${reportUrl}">${reportName}</a> erstellt`,
},
mentionSuggestions: {
hereAlternateText: 'Alle in dieser Unterhaltung benachrichtigen',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,10 @@ const translations = {
asCopilot: 'as copilot for',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`created this report to hold all expenses from <a href="${reportUrl}">${reportName}</a> that couldn't be submitted on your chosen frequency`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`created this report for any held expenses from <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `created this report for any held expenses from deleted report #${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `created this report for any held expenses from <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notify everyone in this conversation',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'como copiloto de',
harvestCreatedExpenseReport: (reportUrl, reportName) =>
`creó este informe para contener todos los gastos de <a href="${reportUrl}">${reportName}</a> que no se pudieron enviar con la frecuencia que elegiste`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`creó este informe para cualquier gasto retenido de <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `creó este informe para cualquier gasto retenido del informe eliminado #${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `creó este informe para cualquier gasto retenido de <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notificar a todos en esta conversación',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'en tant que copilote pour',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`a créé cette note de frais pour regrouper toutes les dépenses de <a href="${reportUrl}">${reportName}</a> qui n'ont pas pu être soumises à la fréquence que vous avez choisie`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`a créé cette note de frais pour toutes les dépenses en attente de <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `a créé cette note de frais pour toutes les dépenses retenues de la note de frais supprimée n°${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `a créé cette note de frais pour toutes les dépenses retenues provenant de <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notifier tout le monde dans cette conversation',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'come copilota per',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`ha creato questo report per raccogliere tutte le spese da <a href="${reportUrl}">${reportName}</a> che non potevano essere inviate con la frequenza scelta`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`ha creato questo report per tutte le spese in sospeso da <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `ha creato questo rendiconto per tutte le spese in sospeso dal rendiconto eliminato n. ${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `ha creato questo report per tutte le spese in sospeso da <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notifica tutti in questa conversazione',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: '共同操縦者として',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`選択した頻度で提出できなかった、<a href="${reportUrl}">${reportName}</a> のすべての経費を保持するためにこのレポートを作成しました`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`<a href="${reportUrl}">${reportName}</a> から保留中の経費を対象としてこのレポートを作成しました`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `削除されたレポート #${reportID} に保留されていた経費のためにこのレポートを作成しました`
Comment thread
hoangzinh marked this conversation as resolved.
: `<a href="${reportUrl}">${reportName}</a> の保留中経費すべてに対してこのレポートを作成しました`,
},
mentionSuggestions: {
hereAlternateText: 'この会話の全員に通知',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'als copiloot voor',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`heeft dit rapport gemaakt om alle uitgaven van <a href="${reportUrl}">${reportName}</a> te bewaren die niet konden worden ingediend op de door jou gekozen frequentie`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`heeft dit rapport gemaakt voor uitgestelde uitgaven van <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `heeft dit rapport gemaakt voor alle vastgehouden uitgaven uit verwijderd rapport nr. ${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `heeft dit rapport gemaakt voor alle vastgehouden uitgaven van <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Laat iedereen in dit gesprek een melding krijgen',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ type ReportArchiveReasonsInvoiceReceiverPolicyDeletedParams = {
type CreatedReportForUnapprovedTransactionsParams = {
reportUrl: string;
reportName: string;
reportID: string;
isReportDeleted: boolean;
};

type WorkspacesListRouteParams = {
Expand Down
6 changes: 4 additions & 2 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'jako drugi pilot dla',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`utworzył(-a) ten raport, aby zawierał wszystkie wydatki z <a href="${reportUrl}">${reportName}</a>, których nie można było złożyć z wybraną przez Ciebie częstotliwością`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`utworzył/-a ten raport dla wszystkich wstrzymanych wydatków z <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `utworzono ten raport dla wszystkich wstrzymanych wydatków z usuniętego raportu nr ${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `utworzył(-a) ten raport dla wszystkich wstrzymanych wydatków z <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Powiadom wszystkich w tej konwersacji',
Expand Down
6 changes: 4 additions & 2 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,10 @@ const translations: TranslationDeepObject<typeof en> = {
asCopilot: 'como copiloto de',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) =>
`criou este relatório para manter todas as despesas de <a href="${reportUrl}">${reportName}</a> que não puderam ser enviadas na frequência escolhida por você`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`criou este relatório para quaisquer despesas em espera de <a href="${reportUrl}">${reportName}</a>`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
isReportDeleted
? `criou este relatório para quaisquer despesas retidas do relatório excluído nº ${reportID}`
Comment thread
hoangzinh marked this conversation as resolved.
: `criou este relatório para quaisquer despesas retidas de <a href="${reportUrl}">${reportName}</a>`,
},
mentionSuggestions: {
hereAlternateText: 'Notificar todas as pessoas nesta conversa',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,8 @@ const translations: TranslationDeepObject<typeof en> = {
reportAction: {
asCopilot: '作为副驾驶,用于',
harvestCreatedExpenseReport: (reportUrl: string, reportName: string) => `创建了此报销单,用于保存所有来自 <a href="${reportUrl}">${reportName}</a> 且无法按照你选择的频率提交的费用`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName}: CreatedReportForUnapprovedTransactionsParams) =>
`从<a href="${reportUrl}">${reportName}</a>创建了此报表,用于查看任何被暂扣的报销费用`,
createdReportForUnapprovedTransactions: ({reportUrl, reportName, reportID, isReportDeleted}: CreatedReportForUnapprovedTransactionsParams) =>
Comment thread
hoangzinh marked this conversation as resolved.
isReportDeleted ? `为已删除报销单 #${reportID} 中的所有暂挂报销创建了此报销单` : `为从<a href="${reportUrl}">${reportName}</a>中被暂挂的任何报销创建了此报表`,
},
mentionSuggestions: {
hereAlternateText: '通知此会话中的所有人',
Expand Down
3 changes: 3 additions & 0 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ function validateReportActionDraftProperty(key: keyof ReportAction, value: strin
case 'isAttachmentWithText':
case 'isNewestReportAction':
case 'isOptimisticAction':
case 'isOriginalReportDeleted':
return validateBoolean(value);
case 'created':
case 'lastModified':
Expand Down Expand Up @@ -769,6 +770,7 @@ function validateReportActionDraftProperty(key: keyof ReportAction, value: strin
childReportNotificationPreference: CONST.RED_BRICK_ROAD_PENDING_ACTION,
isNewestReportAction: CONST.RED_BRICK_ROAD_PENDING_ACTION,
isOptimisticAction: CONST.RED_BRICK_ROAD_PENDING_ACTION,
isOriginalReportDeleted: CONST.RED_BRICK_ROAD_PENDING_ACTION,
adminAccountID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
whisperedToAccountIDs: CONST.RED_BRICK_ROAD_PENDING_ACTION,
reportActionTimestamp: CONST.RED_BRICK_ROAD_PENDING_ACTION,
Expand Down Expand Up @@ -1279,6 +1281,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string)
childReportNotificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE,
isNewestReportAction: 'boolean',
isOptimisticAction: 'boolean',
isOriginalReportDeleted: 'boolean',
adminAccountID: 'number',
whisperedToAccountIDs: 'array',
reportActionTimestamp: 'string',
Expand Down
16 changes: 14 additions & 2 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 91 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand All @@ -100,7 +100,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 103 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -109,13 +109,13 @@
});

let isNetworkOffline = false;
Onyx.connect({

Check warning on line 112 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NETWORK,
callback: (val) => (isNetworkOffline = val?.isOffline ?? false),
});

let deprecatedCurrentUserAccountID: number | undefined;
Onyx.connect({

Check warning on line 118 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, value is undefined
Expand Down Expand Up @@ -4109,9 +4109,20 @@
return translate('reportAction.harvestCreatedExpenseReport', reportUrl, reportName);
}

function getCreatedReportForUnapprovedTransactionsMessage(reportID: string | undefined, reportName: string, translate: LocalizedTranslate): string {
/**
* Check if the original report referenced by a report action is deleted.
*/
function isOriginalReportDeleted(action: OnyxEntry<ReportAction>, originalReport: OnyxEntry<Report>): boolean {
// isOriginalReportDeleted is set to true when the original report is deleted from the backend. We can fall back to check if the report is optimistically deleted on the frontend side.
return !!action?.isOriginalReportDeleted || originalReport?.pendingFields?.preview === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
}

function getCreatedReportForUnapprovedTransactionsMessage(reportID: string | undefined, reportName: string, isReportDeleted: boolean, translate: LocalizedTranslate): string {
if (reportID === undefined) {
return '';
}
const reportUrl = getReportURLForCurrentContext(reportID);
return translate('reportAction.createdReportForUnapprovedTransactions', {reportUrl, reportName});
return translate('reportAction.createdReportForUnapprovedTransactions', {reportUrl, reportName, reportID, isReportDeleted});
}

function getDynamicExternalWorkflowRoutedMessage(
Expand Down Expand Up @@ -4605,6 +4616,7 @@
getWorkspaceCategoriesUpdatedMessage,
getHarvestCreatedExpenseReportMessage,
getCreatedReportForUnapprovedTransactionsMessage,
isOriginalReportDeleted,
isSystemUserMentioned,
withDEWRoutedActionsArray,
withDEWRoutedActionsObject,
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ReportNameUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
isMoneyRequestAction,
isMovedAction,
isOldDotReportAction,
isOriginalReportDeleted,
isRenamedAction,
isReportActionAttachment,
isTagModificationAction,
Expand Down Expand Up @@ -141,7 +142,7 @@

let allPersonalDetails: OnyxEntry<PersonalDetailsList>;

Onyx.connect({

Check warning on line 145 in src/libs/ReportNameUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value;
Expand Down Expand Up @@ -787,7 +788,7 @@
const originalReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${originalID}`];
const reportName = computeReportName(originalReport, reports, policies, transactions, allReportNameValuePairs, personalDetailsList, reportActions, currentUserAccountID);
// eslint-disable-next-line @typescript-eslint/no-deprecated
return getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, translateLocal);
return getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, isOriginalReportDeleted(parentReportAction, originalReport), translateLocal);
}

if (isTaskReport(report)) {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@
};

let conciergeReportIDOnyxConnect: OnyxEntry<string>;
Onyx.connect({

Check warning on line 1024 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportIDOnyxConnect = value;
Expand All @@ -1029,7 +1029,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 1032 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -1047,7 +1047,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 1050 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (currentUserAccountID) {
Expand All @@ -1059,7 +1059,7 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 1062 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
Expand All @@ -1068,7 +1068,7 @@
let allPolicies: OnyxCollection<Policy>;
let hasPolicies: boolean;
let policiesArray: Policy[] = [];
Onyx.connect({

Check warning on line 1071 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -5759,7 +5759,7 @@
// eslint-disable-next-line @typescript-eslint/no-deprecated -- temporarily disabling rule for deprecated functions out of issue scope
const reportName = getReportName({report: originalReport});
// eslint-disable-next-line @typescript-eslint/no-deprecated -- temporarily disabling rule for deprecated functions out of issue scope
return getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, translateLocal);
return getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, !!parentReportAction.isOriginalReportDeleted, translateLocal);
}

if (isTaskReport(report)) {
Expand Down
11 changes: 9 additions & 2 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ import {
isMoneyRequestAction,
isMovedAction,
isOldDotReportAction,
isOriginalReportDeleted,
isReimbursementDeQueuedOrCanceledAction,
isReimbursementQueuedAction,
isRenamedAction,
Expand Down Expand Up @@ -1061,8 +1062,14 @@ const ContextMenuActions: ContextMenuAction[] = [
setClipboardMessage(displayMessage);
} else if (isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.CREATED_REPORT_FOR_UNAPPROVED_TRANSACTIONS)) {
const {originalID} = getOriginalMessage(reportAction) ?? {};
const reportName = getReportName(getReportOrDraftReport(originalID));
const displayMessage = getCreatedReportForUnapprovedTransactionsMessage(originalID, reportName, translate);
const originalReportOfUnapprovedTransaction = getReportOrDraftReport(originalID);
const reportName = getReportName(originalReportOfUnapprovedTransaction);
const displayMessage = getCreatedReportForUnapprovedTransactionsMessage(
originalID,
reportName,
isOriginalReportDeleted(reportAction, originalReportOfUnapprovedTransaction),
translate,
);
setClipboardMessage(displayMessage);
} else if (content) {
setClipboardMessage(
Expand Down
Loading
Loading