Skip to content

Commit 213aad0

Browse files
authored
Merge pull request #61106 from jaydamani/gbr/partial-approval-fix2
fix missing GBR on partial approval
2 parents 4b46333 + c8ba49f commit 213aad0

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/LHNOptionsList/OptionRowLHN.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import {
3838
isPolicyExpenseChat,
3939
isSystemChat,
4040
isThread,
41-
requiresAttentionFromCurrentUser,
4241
} from '@libs/ReportUtils';
4342
import {showContextMenu} from '@pages/home/report/ContextMenu/ReportActionContextMenu';
4443
import FreeTrial from '@pages/settings/Subscription/FreeTrial';
@@ -141,7 +140,7 @@ function OptionRowLHN({
141140
}
142141

143142
const hasBrickError = optionItem.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
144-
const shouldShowGreenDotIndicator = !hasBrickError && requiresAttentionFromCurrentUser(optionItem, optionItem.parentReportAction);
143+
const shouldShowGreenDotIndicator = optionItem.shouldShowGreenDot === true;
145144
const textStyle = isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText;
146145
const textUnreadStyle = shouldUseBoldText(optionItem) ? [textStyle, styles.sidebarLinkTextBold] : [textStyle];
147146
const displayNameStyle = [styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, textUnreadStyle, style];

src/libs/ReportUtils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ type OptionData = {
693693
alternateText?: string;
694694
allReportErrors?: Errors;
695695
brickRoadIndicator?: ValueOf<typeof CONST.BRICK_ROAD_INDICATOR_STATUS> | '' | null;
696+
shouldShowGreenDot?: boolean;
696697
tooltipText?: string | null;
697698
alternateTextMaxLines?: number;
698699
boldStyle?: boolean;
@@ -3362,7 +3363,11 @@ function getReasonAndReportActionThatRequiresAttention(
33623363
const hasOnlyPendingTransactions = transactions.length > 0 && transactions.every((t) => isExpensifyCardTransaction(t) && isPending(t));
33633364

33643365
// Has a child report that is awaiting action (e.g. approve, pay, add bank account) from current user
3365-
if (optionOrReport.hasOutstandingChildRequest && !hasOnlyPendingTransactions) {
3366+
const policy = getPolicy(optionOrReport.policyID);
3367+
if (
3368+
(optionOrReport.hasOutstandingChildRequest === true || iouReportActionToApproveOrPay?.reportActionID) &&
3369+
(policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO || !hasOnlyPendingTransactions)
3370+
) {
33663371
return {
33673372
reason: CONST.REQUIRES_ATTENTION_REASONS.HAS_CHILD_REPORT_AWAITING_ACTION,
33683373
reportAction: iouReportActionToApproveOrPay,

src/libs/SidebarUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ function getOptionData({
475475
isAllowedToComment: true,
476476
isDeletedParentAction: false,
477477
isConciergeChat: false,
478+
shouldShowGreenDot: false,
478479
};
479480

480481
const participantAccountIDs = getParticipantsAccountIDsForDisplay(report);
@@ -523,6 +524,7 @@ function getOptionData({
523524
result.hasParentAccess = report.hasParentAccess;
524525
result.isConciergeChat = isConciergeChatReport(report);
525526
result.participants = report.participants;
527+
result.shouldShowGreenDot = result.brickRoadIndicator !== CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && requiresAttentionFromCurrentUser(report, parentReportAction);
526528

527529
const hasMultipleParticipants = participantPersonalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat || isExpenseReport(report);
528530
const subtitle = getChatRoomSubtitle(report);

0 commit comments

Comments
 (0)