Skip to content

Commit f0c1725

Browse files
authored
Merge pull request #48362 from Expensify/beaman-showExpenseReportInLHNIfManagerNoParentAccess
Show report in LHN if user is expense report manager without access to parent policyChat
2 parents 2cb8354 + 410d6f6 commit f0c1725

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/libs/ReportUtils.ts

+5
Original file line numberDiff line numberDiff line change
@@ -7729,6 +7729,10 @@ function getApprovalChain(policy: OnyxEntry<Policy>, employeeAccountID: number,
77297729
return approvalChain;
77307730
}
77317731

7732+
function isSubmittedExpenseReportManagerWithoutParentAccess(report: OnyxEntry<Report>) {
7733+
return isExpenseReport(report) && report?.hasParentAccess === false && report?.managerID === currentUserAccountID && isProcessingReport(report);
7734+
}
7735+
77327736
export {
77337737
addDomainToShortMention,
77347738
completeShortMention,
@@ -7924,6 +7928,7 @@ export {
79247928
isEmptyReport,
79257929
isRootGroupChat,
79267930
isExpenseReport,
7931+
isSubmittedExpenseReportManagerWithoutParentAccess,
79277932
isExpenseRequest,
79287933
isExpensifyOnlyParticipantInReport,
79297934
isGroupChat,

src/libs/SidebarUtils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ function getOrderedReportIDs(
129129
return;
130130
}
131131
const isSystemChat = ReportUtils.isSystemChat(report);
132-
const shouldOverrideHidden = hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned;
132+
const isSubmittedExpenseReportManagerWithoutParentAccess = ReportUtils.isSubmittedExpenseReportManagerWithoutParentAccess(report);
133+
const shouldOverrideHidden =
134+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
135+
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || report.isPinned || isSubmittedExpenseReportManagerWithoutParentAccess;
133136
if (isHidden && !shouldOverrideHidden) {
134137
return;
135138
}

0 commit comments

Comments
 (0)