From 6a6fe60295415a93938b50476af4681162b43ee5 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 20 Jun 2025 19:10:13 +0800 Subject: [PATCH 1/3] don't show rbr for participants --- src/libs/OptionsListUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 58f8075cd838..d3d7a84a6814 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -1058,6 +1058,7 @@ function getReportOption(participant: Participant): OptionData { option.isDisabled = isDraftReport(participant.reportID); option.selected = participant.selected; option.isSelected = participant.selected; + option.brickRoadIndicator = null; return option; } From 000de5cc59580a54e8fbefd65b10874134ab3f70 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 25 Jun 2025 00:14:49 +0800 Subject: [PATCH 2/3] don't show rbr in iou participants page --- src/libs/OptionsListUtils.ts | 3 +++ src/pages/iou/request/MoneyRequestParticipantsSelector.tsx | 1 + 2 files changed, 4 insertions(+) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 8ccccfe14038..91bc75d89339 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -225,6 +225,7 @@ type GetValidReportsConfig = { shouldSeparateSelfDMChat?: boolean; excludeNonAdminWorkspaces?: boolean; isPerDiemRequest?: boolean; + showRBR?: boolean; } & GetValidOptionsSharedConfig; type GetValidReportsReturnTypeCombined = { @@ -1585,6 +1586,7 @@ function getValidReports(reports: OptionList['reports'], config: GetValidReports shouldSeparateWorkspaceChat, excludeNonAdminWorkspaces, isPerDiemRequest = false, + showRBR = true, } = config; const topmostReportId = Navigation.getTopmostReportId(); @@ -1731,6 +1733,7 @@ function getValidReports(reports: OptionList['reports'], config: GetValidReports isSelected, isBold, lastIOUCreationDate, + brickRoadIndicator: showRBR ? option.brickRoadIndicator : null, }; if (shouldSeparateWorkspaceChat && newReportOption.isOwnPolicyExpenseChat && !newReportOption.private_isArchived) { diff --git a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx index d270f0fc5c98..fd537e919c27 100644 --- a/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx +++ b/src/pages/iou/request/MoneyRequestParticipantsSelector.tsx @@ -187,6 +187,7 @@ function MoneyRequestParticipantsSelector({ includeSelfDM: !isMovingTransactionFromTrackExpense(action) && iouType !== CONST.IOU.TYPE.INVOICE, canShowManagerMcTest: !hasBeenAddedToNudgeMigration && action !== CONST.IOU.ACTION.SUBMIT, isPerDiemRequest, + showRBR: false, }, ); From 581db070409447bfa7835073b40363a2b955c9f7 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 3 Jul 2025 20:20:55 +0800 Subject: [PATCH 3/3] add test --- tests/unit/OptionsListUtilsTest.ts | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/unit/OptionsListUtilsTest.ts b/tests/unit/OptionsListUtilsTest.ts index bea0aed94b5b..4132b61aac71 100644 --- a/tests/unit/OptionsListUtilsTest.ts +++ b/tests/unit/OptionsListUtilsTest.ts @@ -801,6 +801,98 @@ describe('OptionsListUtils', () => { // Then the result should include the admin room expect(adminRoomOption).toBeDefined(); }); + + it('should include brickRoadIndicator if showRBR is true', () => { + const reportID = '1455140530846319'; + const workspaceChat: SearchOption = { + item: { + chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, + currency: 'USD', + errorFields: {}, + lastActionType: 'CREATED', + lastReadTime: '2025-03-21 07:25:46.279', + lastVisibleActionCreated: '2024-12-15 21:13:24.317', + lastVisibleActionLastModified: '2024-12-15 21:13:24.317', + ownerAccountID: 0, + permissions: ['read', 'write'], + participants: {1: {notificationPreference: 'always'}}, + policyID: '52A5ABD88FBBD18F', + policyName: "A's Workspace", + reportID, + reportName: "A's Workspace chat", + type: 'chat', + writeCapability: 'all', + }, + text: "A's Workspace chat", + alternateText: "A's Workspace", + allReportErrors: {}, + subtitle: "A's Workspace", + participantsList: [], + reportID, + keyForList: '1455140530846319', + isDefaultRoom: true, + isChatRoom: true, + policyID: '52A5ABD88FBBD18F', + lastMessageText: '', + lastVisibleActionCreated: '2024-12-15 21:13:24.317', + notificationPreference: 'hidden', + brickRoadIndicator: CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR, + }; + const results = getValidOptions( + {reports: [workspaceChat], personalDetails: []}, + { + includeMultipleParticipantReports: true, + showRBR: true, + }, + ); + expect(results.recentReports.at(0)?.brickRoadIndicator).toBe(CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR); + }); + + it('should not include brickRoadIndicator if showRBR is false', () => { + const reportID = '1455140530846319'; + const workspaceChat: SearchOption = { + item: { + chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, + currency: 'USD', + errorFields: {}, + lastActionType: 'CREATED', + lastReadTime: '2025-03-21 07:25:46.279', + lastVisibleActionCreated: '2024-12-15 21:13:24.317', + lastVisibleActionLastModified: '2024-12-15 21:13:24.317', + ownerAccountID: 0, + permissions: ['read', 'write'], + participants: {1: {notificationPreference: 'always'}}, + policyID: '52A5ABD88FBBD18F', + policyName: "A's Workspace", + reportID, + reportName: "A's Workspace chat", + type: 'chat', + writeCapability: 'all', + }, + text: "A's Workspace chat", + alternateText: "A's Workspace", + allReportErrors: {}, + subtitle: "A's Workspace", + participantsList: [], + reportID, + keyForList: '1455140530846319', + isDefaultRoom: true, + isChatRoom: true, + policyID: '52A5ABD88FBBD18F', + lastMessageText: '', + lastVisibleActionCreated: '2024-12-15 21:13:24.317', + notificationPreference: 'hidden', + brickRoadIndicator: CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR, + }; + const results = getValidOptions( + {reports: [workspaceChat], personalDetails: []}, + { + includeMultipleParticipantReports: true, + showRBR: false, + }, + ); + expect(results.recentReports.at(0)?.brickRoadIndicator).toBe(null); + }); }); describe('getValidOptions() for chat room', () => {