From bc24830ddca0432ae77ce2c297d82377ba99c5a1 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 31 Mar 2021 14:45:06 -1000 Subject: [PATCH 1/4] Fix maxParticipants text --- src/libs/OptionsListUtils.js | 4 ++-- src/pages/NewGroupPage.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 22209dbf3bdd..362167023f5a 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -410,11 +410,11 @@ function getSidebarOptions(reports, personalDetails, draftComments, activeReport * * @param {Boolean} hasSelectableOptions * @param {Boolean} hasUserToInvite - * @param {String} searchValue + * @param {String} [searchValue] * @param {Boolean} [maxParticipantsReached] * @return {String} */ -function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false) { +function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue = '', maxParticipantsReached = false) { if (maxParticipantsReached) { return CONST.MESSAGES.MAXIMUM_PARTICIPANTS_REACHED; } diff --git a/src/pages/NewGroupPage.js b/src/pages/NewGroupPage.js index 1bee4f70ba61..ff8dd7c6f06b 100644 --- a/src/pages/NewGroupPage.js +++ b/src/pages/NewGroupPage.js @@ -176,6 +176,7 @@ class NewGroupPage extends Component { const headerMessage = getHeaderMessage( this.state.personalDetails.length + this.state.recentReports.length !== 0, Boolean(this.state.userToInvite), + '', maxParticipantsReached, ); return ( From 346153c585e69644aea713a9aa23b8b25372957f Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 31 Mar 2021 14:58:59 -1000 Subject: [PATCH 2/4] fix sms domain --- src/libs/OptionsListUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 362167023f5a..dacd0999757d 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -98,7 +98,9 @@ function createOption(personalDetailList, report, draftComments, activeReportID, return { text: report ? report.reportName : personalDetail.displayName, - alternateText: (showChatPreviewLine && lastMessageText) ? lastMessageText : personalDetail.login, + alternateText: (showChatPreviewLine && lastMessageText) + ? lastMessageText + : Str.removeSMSDomain(personalDetail.login), icons: report ? report.icons : [personalDetail.avatar], tooltipText, participantsList: personalDetailList, From a862c02ee042fe1f5b83ca26423406f91f1bf0dd Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 31 Mar 2021 15:31:36 -1000 Subject: [PATCH 3/4] use state.searchValue --- src/pages/NewGroupPage.js | 2 +- src/pages/SearchPage.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/NewGroupPage.js b/src/pages/NewGroupPage.js index ff8dd7c6f06b..3f7dc291be99 100644 --- a/src/pages/NewGroupPage.js +++ b/src/pages/NewGroupPage.js @@ -176,7 +176,7 @@ class NewGroupPage extends Component { const headerMessage = getHeaderMessage( this.state.personalDetails.length + this.state.recentReports.length !== 0, Boolean(this.state.userToInvite), - '', + this.state.searchValue, maxParticipantsReached, ); return ( diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js index 08be33ce2af5..d0f4b0492a46 100644 --- a/src/pages/SearchPage.js +++ b/src/pages/SearchPage.js @@ -133,6 +133,7 @@ class SearchPage extends Component { const headerMessage = getHeaderMessage( (this.state.recentReports.length + this.state.personalDetails.length) !== 0, Boolean(this.state.userToInvite), + this.state.searchValue, ); return ( From b6bae44da1814f4b8d0dd4c53cadfc4f0284fb40 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 31 Mar 2021 15:32:52 -1000 Subject: [PATCH 4/4] update optional param --- src/libs/OptionsListUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index dacd0999757d..977a7ed37c73 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -412,11 +412,11 @@ function getSidebarOptions(reports, personalDetails, draftComments, activeReport * * @param {Boolean} hasSelectableOptions * @param {Boolean} hasUserToInvite - * @param {String} [searchValue] + * @param {String} searchValue * @param {Boolean} [maxParticipantsReached] * @return {String} */ -function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue = '', maxParticipantsReached = false) { +function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false) { if (maxParticipantsReached) { return CONST.MESSAGES.MAXIMUM_PARTICIPANTS_REACHED; }