From 07b9ae98be871bbab49f1132146f8b3ad109bd0e Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 12 Dec 2021 20:15:15 +0000 Subject: [PATCH 1/6] Make sure to return report name for the policy room --- src/libs/actions/Report.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 75341c346b95..73bceea3354e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -142,6 +142,11 @@ function getChatReportName(fullReport, chatType) { : '')}`; } + // For normal policy room return its originally name + if (chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM) { + return fullReport.reportName + } + const {sharedReportList} = fullReport; return _.chain(sharedReportList) .map(participant => participant.email) From 8831bacfc794743656b44b056341fdcadaf7ea82 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 12 Dec 2021 20:17:02 +0000 Subject: [PATCH 2/6] Update the comment to reflect change --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 73bceea3354e..bab7d6ae9a07 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -125,7 +125,7 @@ function getParticipantEmailsFromReport({sharedReportList}) { } /** - * Returns the title for a default room or generates one based on the participants + * Returns the title for a default room, a policy room or generates one based on the participants * * @param {Object} fullReport * @param {String} chatType From 783496af3f0c142a997bd26aebe9b3c9840e96c5 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 12 Dec 2021 20:45:52 +0000 Subject: [PATCH 3/6] Fix lint --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index bab7d6ae9a07..d20c33c83b3c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -144,7 +144,7 @@ function getChatReportName(fullReport, chatType) { // For normal policy room return its originally name if (chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM) { - return fullReport.reportName + return fullReport.reportName; } const {sharedReportList} = fullReport; From 23943f35b1537ac60d1d26669dc92a123ae40a9c Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Sun, 12 Dec 2021 20:48:56 +0000 Subject: [PATCH 4/6] Update a comment --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d20c33c83b3c..aca66d079aec 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -142,7 +142,7 @@ function getChatReportName(fullReport, chatType) { : '')}`; } - // For normal policy room return its originally name + // For a basic policy room, return its originally name if (chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM) { return fullReport.reportName; } From 4d7474263eca6b246432c5a23643de9319fd5cc7 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 13 Dec 2021 09:15:59 +0000 Subject: [PATCH 5/6] Make sure to display room name --- src/pages/home/HeaderView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 245e9e6e4267..e6afe3a4340f 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -86,7 +86,8 @@ const HeaderView = (props) => { }, ); const isDefaultChatRoom = ReportUtils.isDefaultRoom(props.report); - const title = isDefaultChatRoom + const isPolicyRoom = ReportUtils.isPolicyRoom(props.report); + const title = isDefaultChatRoom || isPolicyRoom ? props.report.reportName : _.map(displayNamesWithTooltips, ({displayName}) => displayName).join(', '); From 9bbd5550528916f0795746fea7f5fdeffc16069a Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Mon, 13 Dec 2021 09:23:35 +0000 Subject: [PATCH 6/6] Use isPolicyRoom --- src/libs/actions/Report.js | 4 ++-- src/pages/home/HeaderView.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index aca66d079aec..75ffcad090cc 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -142,8 +142,8 @@ function getChatReportName(fullReport, chatType) { : '')}`; } - // For a basic policy room, return its originally name - if (chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM) { + // For a basic policy room, return its original name + if (ReportUtils.isPolicyRoom({chatType})) { return fullReport.reportName; } diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index e6afe3a4340f..a214bf3fade3 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -85,8 +85,8 @@ const HeaderView = (props) => { }; }, ); - const isDefaultChatRoom = ReportUtils.isDefaultRoom(props.report); const isPolicyRoom = ReportUtils.isPolicyRoom(props.report); + const isDefaultChatRoom = ReportUtils.isDefaultRoom(props.report); const title = isDefaultChatRoom || isPolicyRoom ? props.report.reportName : _.map(displayNamesWithTooltips, ({displayName}) => displayName).join(', '); @@ -146,7 +146,7 @@ const HeaderView = (props) => { tooltipEnabled numberOfLines={1} textStyles={[styles.headerText]} - shouldUseFullTitle={isDefaultChatRoom} + shouldUseFullTitle={isDefaultChatRoom || isPolicyRoom} /> {isDefaultChatRoom && (