From cd1204fb048af96f7f540d766255722269382505 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:07:34 +0100 Subject: [PATCH 1/7] exclude notificatiosn from cht search --- src/CONST.ts | 2 ++ src/libs/OptionsListUtils.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 13b79179f431..af254a40b090 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -963,6 +963,7 @@ const CONST = { GUIDES_DOMAIN: 'team.expensify.com', HELP: 'help@expensify.com', INTEGRATION_TESTING_CREDS: 'integrationtestingcreds@expensify.com', + NOTIFICATIONS: 'notifications@expensify.com', PAYROLL: 'payroll@expensify.com', QA: 'qa@expensify.com', QA_TRAVIS: 'qa+travisreceipts@expensify.com', @@ -1408,6 +1409,7 @@ const CONST = { this.EMAIL.FIRST_RESPONDER, this.EMAIL.HELP, this.EMAIL.INTEGRATION_TESTING_CREDS, + this.EMAIL.NOTIFICATIONS, this.EMAIL.PAYROLL, this.EMAIL.QA, this.EMAIL.QA_TRAVIS, diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index e3b6ec77380e..291bab0bff3f 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1224,7 +1224,7 @@ function getOptions( } // Exclude the current user from the personal details list - const optionsToExclude = [{login: currentUserLogin}]; + const optionsToExclude = [{login: currentUserLogin}, {login: CONST.EMAIL.NOTIFICATIONS}]; // If we're including selected options from the search results, we only want to exclude them if the search input is empty // This is because on certain pages, we show the selected options at the top when the search input is empty @@ -1236,6 +1236,7 @@ function getOptions( _.each(excludeLogins, (login) => { optionsToExclude.push({login}); }); + console.log(optionsToExclude); if (includeRecentReports) { for (let i = 0; i < allReportOptions.length; i++) { From 7206bce7f2507d46360bdff31123ffe5a9e327c6 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:12:18 +0100 Subject: [PATCH 2/7] exclude from recets --- src/libs/OptionsListUtils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 291bab0bff3f..050118f73b0c 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1247,6 +1247,11 @@ function getOptions( break; } + // Skip notifications@expensify.com + if (reportOption.login === CONST.EMAIL.NOTIFICATIONS) { + continue; + } + const isCurrentUserOwnedPolicyExpenseChatThatCouldShow = reportOption.isPolicyExpenseChat && reportOption.ownerAccountID === currentUserAccountID && includeOwnedWorkspaceChats && !reportOption.isArchivedRoom; From 34971db8adc3f2ec89a35280d74bd021a1f72a90 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:42:29 +0100 Subject: [PATCH 3/7] exclude from LHN --- src/CONST.ts | 1 + src/libs/ReportUtils.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index af254a40b090..d7206b4cb544 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -983,6 +983,7 @@ const CONST = { FIRST_RESPONDER: Number(Config?.EXPENSIFY_ACCOUNT_ID_FIRST_RESPONDER ?? 9375152), HELP: Number(Config?.EXPENSIFY_ACCOUNT_ID_HELP ?? -1), INTEGRATION_TESTING_CREDS: Number(Config?.EXPENSIFY_ACCOUNT_ID_INTEGRATION_TESTING_CREDS ?? -1), + NOTIFICATIONS: Number(Config?.EXPENSIFY_ACCOUNT_ID_NOTIFICATIONS ?? 11665625), PAYROLL: Number(Config?.EXPENSIFY_ACCOUNT_ID_PAYROLL ?? 9679724), QA: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA ?? 3126513), QA_TRAVIS: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA_TRAVIS ?? 8595733), diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f6c3090143f4..ee96a1cfa8a3 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3424,6 +3424,7 @@ function shouldReportBeInOptionList( report?.reportName === undefined || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.isHidden || + report?.participantAccountIDs?.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) || (report?.participantAccountIDs?.length === 0 && !isChatThread(report) && !isPublicRoom(report) && From 17717f5aec04a5557290fdadea98794d2203a339 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:09:10 +0100 Subject: [PATCH 4/7] prevent profile access --- src/pages/home/report/ReportActionItemSingle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index c50f868cae99..e3e57598e764 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -155,8 +155,10 @@ function ReportActionItemSingle(props) { } }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); + console.log(actorAccountID); + console.log(CONST.ACCOUNT_ID.NOTIFICATIONS); const shouldDisableDetailPage = useMemo( - () => !isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID), + () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], ); From 53f10a9f2aa9fa6b4feafd12c5e7c59bac8b1d46 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:09:36 +0100 Subject: [PATCH 5/7] remove debug lines --- src/pages/home/report/ReportActionItemSingle.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index e3e57598e764..129bf3359dc9 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -155,8 +155,6 @@ function ReportActionItemSingle(props) { } }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); - console.log(actorAccountID); - console.log(CONST.ACCOUNT_ID.NOTIFICATIONS); const shouldDisableDetailPage = useMemo( () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], From a12d140ccb4b1e25c98f40323cfbb6cb2513a9de Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:51:46 +0100 Subject: [PATCH 6/7] lint --- src/libs/OptionsListUtils.js | 1 - src/libs/ReportUtils.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 050118f73b0c..d5097c46f2cb 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1236,7 +1236,6 @@ function getOptions( _.each(excludeLogins, (login) => { optionsToExclude.push({login}); }); - console.log(optionsToExclude); if (includeRecentReports) { for (let i = 0; i < allReportOptions.length; i++) { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ee96a1cfa8a3..42558a97317e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3424,6 +3424,7 @@ function shouldReportBeInOptionList( report?.reportName === undefined || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.isHidden || + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.participantAccountIDs?.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) || (report?.participantAccountIDs?.length === 0 && !isChatThread(report) && From 9379c26d767f6e6cbd189dd66be22f110c135ac4 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:52:11 +0100 Subject: [PATCH 7/7] prettier --- src/pages/home/report/ReportActionItemSingle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 129bf3359dc9..39bce4bf067a 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -156,7 +156,9 @@ function ReportActionItemSingle(props) { }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); const shouldDisableDetailPage = useMemo( - () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), + () => + actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || + (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], );