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: Hide paycheck report with error #45698

Merged
merged 9 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ function getOrderedReportIDs(
if (!report) {
return;
}
if (report?.type === CONST.REPORT.TYPE.PAYCHECK || report?.type === CONST.REPORT.TYPE.BILL) {
return;
}
const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`] ?? {};
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '-1', report?.parentReportActionID ?? '-1');
const doesReportHaveViolations = OptionsListUtils.shouldShowViolations(report, betas ?? [], transactionViolations);
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/SidebarFilterTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@
const report2: Report = {
...LHNTestUtils.getFakeReport(),
type: CONST.REPORT.TYPE.BILL,
errorFields: {
notFound: {
'1721083106781482': 'Report not found',

Check failure on line 293 in tests/unit/SidebarFilterTest.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Object Literal Property name `1721083106781482` must match one of the following formats: camelCase, UPPER_CASE, PascalCase
'1721140343800206': 'Report not found',

Check failure on line 294 in tests/unit/SidebarFilterTest.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Object Literal Property name `1721140343800206` must match one of the following formats: camelCase, UPPER_CASE, PascalCase
'1721149017870362': 'Report not found',

Check failure on line 295 in tests/unit/SidebarFilterTest.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Object Literal Property name `1721149017870362` must match one of the following formats: camelCase, UPPER_CASE, PascalCase
},
},
};
const report3: Report = LHNTestUtils.getFakeReport();
LHNTestUtils.getDefaultRenderedSidebarLinks(report1.reportID);
Expand Down
Loading