Skip to content

Commit

Permalink
Merge pull request #29155 from rojiphil/27878-lhn-report-partial-display
Browse files Browse the repository at this point in the history
exclude reports in LHN that has no report type
  • Loading branch information
chiragsalian authored Oct 16, 2023
2 parents 956664c + e984d27 commit 7b484e5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3073,6 +3073,7 @@ function shouldReportBeInOptionList(report, currentReportId, isInGSDMode, betas,
if (
!report ||
!report.reportID ||
!report.type ||
report.isHidden ||
(report.participantAccountIDs &&
report.participantAccountIDs.length === 0 &&
Expand Down
1 change: 1 addition & 0 deletions tests/ui/UnreadIndicatorsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ describe('Unread Indicators', () => {
lastVisibleActionCreated: DateUtils.getDBTime(utcToZonedTime(NEW_REPORT_FIST_MESSAGE_CREATED_DATE, 'UTC').valueOf()),
lastMessageText: 'Comment 1',
participantAccountIDs: [USER_C_ACCOUNT_ID],
type: CONST.REPORT.TYPE.CHAT,
},
},
{
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/OptionsListUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('OptionsListUtils', () => {
participantAccountIDs: [2, 1],
reportName: 'Iron Man, Mister Fantastic',
hasDraft: true,
type: CONST.REPORT.TYPE.CHAT,
},
2: {
lastReadTime: '2021-01-14 11:25:39.296',
Expand All @@ -26,6 +27,7 @@ describe('OptionsListUtils', () => {
reportID: 2,
participantAccountIDs: [3],
reportName: 'Spider-Man',
type: CONST.REPORT.TYPE.CHAT,
},

// This is the only report we are pinning in this test
Expand All @@ -36,6 +38,7 @@ describe('OptionsListUtils', () => {
reportID: 3,
participantAccountIDs: [1],
reportName: 'Mister Fantastic',
type: CONST.REPORT.TYPE.CHAT,
},
4: {
lastReadTime: '2021-01-14 11:25:39.298',
Expand All @@ -44,6 +47,7 @@ describe('OptionsListUtils', () => {
reportID: 4,
participantAccountIDs: [4],
reportName: 'Black Panther',
type: CONST.REPORT.TYPE.CHAT,
},
5: {
lastReadTime: '2021-01-14 11:25:39.299',
Expand All @@ -52,6 +56,7 @@ describe('OptionsListUtils', () => {
reportID: 5,
participantAccountIDs: [5],
reportName: 'Invisible Woman',
type: CONST.REPORT.TYPE.CHAT,
},
6: {
lastReadTime: '2021-01-14 11:25:39.300',
Expand All @@ -60,6 +65,7 @@ describe('OptionsListUtils', () => {
reportID: 6,
participantAccountIDs: [6],
reportName: 'Thor',
type: CONST.REPORT.TYPE.CHAT,
},

// Note: This report has the largest lastVisibleActionCreated
Expand All @@ -70,6 +76,7 @@ describe('OptionsListUtils', () => {
reportID: 7,
participantAccountIDs: [7],
reportName: 'Captain America',
type: CONST.REPORT.TYPE.CHAT,
},

// Note: This report has no lastVisibleActionCreated
Expand All @@ -80,6 +87,7 @@ describe('OptionsListUtils', () => {
reportID: 8,
participantAccountIDs: [12],
reportName: 'Silver Surfer',
type: CONST.REPORT.TYPE.CHAT,
},

// Note: This report has an IOU
Expand All @@ -92,6 +100,7 @@ describe('OptionsListUtils', () => {
reportName: 'Mister Sinister',
iouReportID: 100,
hasOutstandingIOU: true,
type: CONST.REPORT.TYPE.CHAT,
},

// This report is an archived room – it does not have a name and instead falls back on oldPolicyName
Expand All @@ -105,6 +114,7 @@ describe('OptionsListUtils', () => {
oldPolicyName: "SHIELD's workspace",
chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT,
isOwnPolicyExpenseChat: true,
type: CONST.REPORT.TYPE.CHAT,

// This indicates that the report is archived
stateNum: 2,
Expand Down Expand Up @@ -179,6 +189,7 @@ describe('OptionsListUtils', () => {
reportID: 11,
participantAccountIDs: [999],
reportName: 'Concierge',
type: CONST.REPORT.TYPE.CHAT,
},
};

Expand All @@ -191,6 +202,7 @@ describe('OptionsListUtils', () => {
reportID: 12,
participantAccountIDs: [1000],
reportName: 'Chronos',
type: CONST.REPORT.TYPE.CHAT,
},
};

Expand All @@ -203,6 +215,7 @@ describe('OptionsListUtils', () => {
reportID: 13,
participantAccountIDs: [1001],
reportName: 'Receipts',
type: CONST.REPORT.TYPE.CHAT,
},
};

Expand All @@ -219,6 +232,7 @@ describe('OptionsListUtils', () => {
isArchivedRoom: false,
chatType: CONST.REPORT.CHAT_TYPE.POLICY_ADMINS,
isOwnPolicyExpenseChat: true,
type: CONST.REPORT.TYPE.CHAT,
},
};

Expand Down

0 comments on commit 7b484e5

Please sign in to comment.