Skip to content
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

fix: Remove deprecated ReportActionUtils.getParentReportAction method #50211

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 0 additions & 14 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,6 @@ function isThreadParentMessage(reportAction: OnyxEntry<ReportAction>, reportID:
return childType === CONST.REPORT.TYPE.CHAT && (childVisibleActionCount > 0 || String(childReportID) === reportID);
}

/**
* Returns the parentReportAction if the given report is a thread/task.
*
* @deprecated Use Onyx.connect() or withOnyx() instead
*/
function getParentReportAction(report: OnyxInputOrEntry<Report>): OnyxEntry<ReportAction> {
if (!report?.parentReportID || !report.parentReportActionID) {
return undefined;
}
return allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`]?.[report.parentReportActionID];
}

/**
* Determines if the given report action is sent money report action by checking for 'pay' type and presence of IOUDetails object.
*/
Expand Down Expand Up @@ -1786,8 +1774,6 @@ export {
getNumberOfMoneyRequests,
getOneTransactionThreadReportID,
getOriginalMessage,
// eslint-disable-next-line deprecation/deprecation
getParentReportAction,
getRemovedFromApprovalChainMessage,
getReportAction,
getReportActionHtml,
Expand Down
5 changes: 5 additions & 0 deletions tests/actions/EnforceActionExportRestrictions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ describe('Task', () => {
// @ts-expect-error the test is asserting that it's undefined, so the TS error is normal
expect(Task.getParentReport).toBeUndefined();
});

it('does not export getParentReportAction', () => {
// @ts-expect-error the test is asserting that it's undefined, so the TS error is normal
expect(Task.getParentReportAction).toBeUndefined();
});
});

describe('OptionsListUtils', () => {
Expand Down
Loading