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

LHN - RBR is missing from the report when it fails to export to QBO #54981

Merged
Changes from 1 commit
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: 2 additions & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@
if ((Object.values(CONST.REPORT.UNSUPPORTED_TYPE) as string[]).includes(report?.type ?? '')) {
return;
}
const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '-1', report?.parentReportActionID ?? '-1');

Check failure on line 126 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Check failure on line 126 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const doesReportHaveViolations = ReportUtils.shouldDisplayViolationsRBRInLHN(report, transactionViolations);
const isHidden = ReportUtils.isHiddenForCurrentUser(report);
const isFocused = report.reportID === currentReportId;
const hasErrorsOtherThanFailedReceipt = ReportUtils.hasReportErrorsOtherThanFailedReceipt(report, doesReportHaveViolations, transactionViolations);
const isReportInAccessible = report?.errorFields?.notFound;
if (ReportUtils.isOneTransactionThread(report.reportID, report.parentReportID ?? '0', parentReportAction)) {

Check failure on line 132 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

return;
}
if (hasErrorsOtherThanFailedReceipt && !isReportInAccessible) {
Expand All @@ -155,7 +155,7 @@
if (
ReportUtils.shouldReportBeInOptionList({
report,
currentReportId: currentReportId ?? '-1',

Check failure on line 158 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

isInFocusMode,
betas,
policies: policies as OnyxCollection<Policy>,
Expand Down Expand Up @@ -200,13 +200,13 @@
};

const isPinned = report?.isPinned ?? false;
const reportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '-1', report?.parentReportActionID ?? '-1');

Check failure on line 203 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Check failure on line 203 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

const reportNameValuePairs = ReportUtils.getReportNameValuePairs(report?.reportID);
if (isPinned || ReportUtils.requiresAttentionFromCurrentUser(report, reportAction)) {
pinnedAndGBRReports.push(miniReport);
} else if (report?.hasErrorsOtherThanFailedReceipt) {
errorReports.push(miniReport);
} else if (hasValidDraftComment(report?.reportID ?? '-1')) {

Check failure on line 209 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

draftReports.push(miniReport);
} else if (ReportUtils.isArchivedRoom(report, reportNameValuePairs)) {
archivedReports.push(miniReport);
Expand Down Expand Up @@ -239,7 +239,7 @@
// Now that we have all the reports grouped and sorted, they must be flattened into an array and only return the reportID.
// The order the arrays are concatenated in matters and will determine the order that the groups are displayed in the sidebar.

const LHNReports = [...pinnedAndGBRReports, ...errorReports, ...draftReports, ...nonArchivedReports, ...archivedReports].map((report) => report?.reportID ?? '-1');

Check failure on line 242 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check


Performance.markEnd(CONST.TIMING.GET_ORDERED_REPORT_IDS);
return LHNReports;
Expand All @@ -256,7 +256,8 @@
hasViolations: boolean,
transactionViolations?: OnyxCollection<TransactionViolation[]>,
): ReasonAndReportActionThatHasRedBrickRoad | null {
const {errors, reportAction} = ReportUtils.getAllReportActionsErrorsAndReportActionThatRequiresAttention(report, reportActions);
const {reportAction} = ReportUtils.getAllReportActionsErrorsAndReportActionThatRequiresAttention(report, reportActions);
const errors = ReportUtils.getAllReportErrors(report, reportActions);
const hasErrors = Object.keys(errors).length !== 0;

if (ReportUtils.shouldDisplayViolationsRBRInLHN(report, transactionViolations)) {
Expand Down Expand Up @@ -385,7 +386,7 @@
result.iouReportID = report.iouReportID;
result.keyForList = String(report.reportID);
result.hasOutstandingChildRequest = report.hasOutstandingChildRequest;
result.parentReportID = report.parentReportID ?? '-1';

Check failure on line 389 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

result.isWaitingOnBankAccount = report.isWaitingOnBankAccount;
result.notificationPreference = ReportUtils.getReportNotificationPreference(report);
result.isAllowedToComment = ReportUtils.canUserPerformWriteAction(report);
Expand Down Expand Up @@ -518,7 +519,7 @@
}

if (!hasMultipleParticipants) {
result.accountID = personalDetail?.accountID ?? -1;

Check failure on line 522 in src/libs/SidebarUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

result.login = personalDetail?.login ?? '';
result.phoneNumber = personalDetail?.phoneNumber ?? '';
}
Expand Down
Loading