From 4cc177b7994515bf8180917e4ebb29ea3484bc17 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Thu, 11 May 2023 12:12:41 +0100 Subject: [PATCH 01/15] Add leave thread to details page, move leaveRoom() to Report --- src/languages/en.js | 1 + src/languages/es.js | 1 + src/libs/actions/Policy.js | 38 ------------------------------ src/libs/actions/Report.js | 42 ++++++++++++++++++++++++++++++++++ src/pages/ReportDetailsPage.js | 18 ++++++++++++--- 5 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index d436045c15ed..8ca0f78111d4 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -120,6 +120,7 @@ export default { enterManually: 'Enter it manually', message: 'Message ', leaveRoom: 'Leave room', + leaveThread: 'Leave thread', you: 'You', youAfterPreposition: 'you', your: 'your', diff --git a/src/languages/es.js b/src/languages/es.js index f32bc8e8da03..fd4d7d554a7b 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -119,6 +119,7 @@ export default { enterManually: 'Introducir manualmente', message: 'Chatear con ', leaveRoom: 'Salir de la sala de chat', + leaveThread: 'Salir del hilo', you: 'Tú', youAfterPreposition: 'ti', your: 'tu', diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index e2fc5c732e2b..ae275939d8ec 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -14,7 +14,6 @@ import * as OptionsListUtils from '../OptionsListUtils'; import DateUtils from '../DateUtils'; import * as ReportUtils from '../ReportUtils'; import Log from '../Log'; -import * as Report from './Report'; import Permissions from '../Permissions'; const allPolicies = {}; @@ -1147,42 +1146,6 @@ function setWorkspaceInviteMembersDraft(policyID, memberEmails) { Onyx.set(`${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${policyID}`, memberEmails); } -/** - * - * @param {String} reportID - */ -function leaveRoom(reportID) { - API.write( - 'LeaveRoom', - { - reportID, - }, - { - optimisticData: [ - { - onyxMethod: Onyx.METHOD.SET, - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, - statusNum: CONST.REPORT.STATUS.CLOSED, - }, - }, - ], - failureData: [ - { - onyxMethod: Onyx.METHOD.SET, - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - stateNum: CONST.REPORT.STATE_NUM.OPEN, - statusNum: CONST.REPORT.STATUS.OPEN, - }, - }, - ], - }, - ); - Report.navigateToConciergeChat(); -} - export { removeMembers, addMembersToWorkspace, @@ -1212,5 +1175,4 @@ export { removeWorkspace, setWorkspaceInviteMembersDraft, isPolicyOwner, - leaveRoom, }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 26d9b9da7357..2fe274c9ff38 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1537,6 +1537,47 @@ function openReportFromDeepLink(url) { }); } +/** + * + * @param {String} reportID + */ +function leaveRoom(reportID) { + API.write( + 'LeaveRoom', + { + reportID, + }, + { + optimisticData: [ + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, + statusNum: CONST.REPORT.STATUS.CLOSED, + }, + }, + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: null, + }, + ], + failureData: [ + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + stateNum: CONST.REPORT.STATE_NUM.OPEN, + statusNum: CONST.REPORT.STATUS.OPEN, + }, + }, + ], + }, + ); + navigateToConciergeChat(); +} + export { addComment, addAttachment, @@ -1577,4 +1618,5 @@ export { toggleEmojiReaction, hasAccountIDReacted, shouldShowReportActionNotification, + leaveRoom, }; diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index ee2c2fefb122..7482ace07549 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -15,7 +15,7 @@ import styles from '../styles/styles'; import DisplayNames from '../components/DisplayNames'; import * as OptionsListUtils from '../libs/OptionsListUtils'; import * as ReportUtils from '../libs/ReportUtils'; -import * as Policy from '../libs/actions/Policy'; +import * as Report from '../libs/actions/Report'; import participantPropTypes from '../components/participantPropTypes'; import * as Expensicons from '../components/Icon/Expensicons'; import ROUTES from '../ROUTES'; @@ -87,12 +87,24 @@ class ReportDetailsPage extends Component { } const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; - if (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) { + if ( + (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) && + _.isEmpty(this.props.report.parentReportActionID) + ) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leaveRoom', icon: Expensicons.Exit, - action: () => Policy.leaveRoom(this.props.report.reportID), + action: () => Report.leaveRoom(this.props.report.reportID), + }); + } + + if (this.props.report.parentReportActionID) { + menuItems.push({ + key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, + translationKey: 'common.leaveThread', + icon: Expensicons.Exit, + action: () => Report.leaveRoom(this.props.report.reportID), }); } From 53fc3320f1da1d5064ac79bdd99328506c0aa73b Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Thu, 11 May 2023 16:22:53 +0100 Subject: [PATCH 02/15] don't delete report actions (it could be a parent!) --- src/libs/actions/Report.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2fe274c9ff38..ddd1784eeac6 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1557,11 +1557,6 @@ function leaveRoom(reportID) { statusNum: CONST.REPORT.STATUS.CLOSED, }, }, - { - onyxMethod: Onyx.METHOD.SET, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - value: null, - }, ], failureData: [ { From 746a1cec9109f7b5fd5f387f532806729bc12954 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 12 May 2023 12:49:15 +0100 Subject: [PATCH 03/15] if thread, use ReportDetails --- src/libs/ReportUtils.js | 16 +++++++++++++++- src/pages/ReportDetailsPage.js | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index f26a4c71a927..43e1bad72d37 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -419,6 +419,19 @@ function isPolicyExpenseChatAdmin(report, policies) { return policyRole === CONST.POLICY.ROLE.ADMIN; } +/** + * Returns true if report has a parent and is therefore a Thread. + * + * @param {Object} report + * @returns {Boolean} + */ +function isThread(report) { + if (report && report.parentReportID && report.parentReportActionID) { + return true; + } + return false; +} + /** * Get either the policyName or domainName the chat is tied to * @param {Object} report @@ -925,7 +938,7 @@ function getReportName(report) { function navigateToDetailsPage(report) { const participants = lodashGet(report, 'participants', []); - if (isChatRoom(report) || isPolicyExpenseChat(report)) { + if (isChatRoom(report) || isPolicyExpenseChat(report) || isThread(report)) { Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID)); return; } @@ -1956,4 +1969,5 @@ export { canRequestMoney, getWhisperDisplayNames, getWorkspaceAvatar, + isThread, }; diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 7482ace07549..47a33b5c5b3f 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -99,7 +99,7 @@ class ReportDetailsPage extends Component { }); } - if (this.props.report.parentReportActionID) { + if (ReportUtils.isThread(this.props.report)) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: 'common.leaveThread', From b794f1ec3bc3a05d496dbd2cc96d823106b10c9d Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 12 May 2023 12:52:50 +0100 Subject: [PATCH 04/15] Remove settings from threads for now. --- src/pages/ReportDetailsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 47a33b5c5b3f..6d3d1256e35d 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -75,7 +75,7 @@ class ReportDetailsPage extends Component { }); } - if (ReportUtils.isPolicyExpenseChat(this.props.report) || ReportUtils.isChatRoom(this.props.report)) { + if ((ReportUtils.isPolicyExpenseChat(this.props.report) || ReportUtils.isChatRoom(this.props.report)) && !ReportUtils.isThread(this.props.report)) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.SETTINGS, translationKey: 'common.settings', From bc299ec0499d0e909a1ca99f0567ae4ce79baa3a Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Mon, 15 May 2023 13:35:45 +0100 Subject: [PATCH 05/15] Add description for LeaveRoom --- src/libs/actions/Report.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 031513b24fb9..bb526227acef 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1577,6 +1577,7 @@ function openReportFromDeepLink(url) { } /** + * Leave a report by setting the state to submitted and closed * * @param {String} reportID */ From e5ca0ae294311e218cb58e638582997bac94a1ab Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Mon, 15 May 2023 14:00:37 +0100 Subject: [PATCH 06/15] prettier --- src/components/QRShare/QRShareWithDownload/index.js | 2 +- .../QRShare/QRShareWithDownload/index.native.js | 3 +-- src/components/QRShare/index.js | 2 +- .../ReimbursementAccount/BankAccountManualStep.js | 6 +----- src/pages/ReimbursementAccount/BankAccountPlaidStep.js | 10 +++------- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/components/QRShare/QRShareWithDownload/index.js b/src/components/QRShare/QRShareWithDownload/index.js index 8cb7be79f7ad..310122b96d40 100644 --- a/src/components/QRShare/QRShareWithDownload/index.js +++ b/src/components/QRShare/QRShareWithDownload/index.js @@ -1,6 +1,6 @@ import React, {Component} from 'react'; import fileDownload from '../../../libs/fileDownload'; -import QRShare from '..' +import QRShare from '..'; import {qrShareDefaultProps, qrSharePropTypes} from '../propTypes'; import getQrCodeFileName from '../getQrCodeDownloadFileName'; diff --git a/src/components/QRShare/QRShareWithDownload/index.native.js b/src/components/QRShare/QRShareWithDownload/index.native.js index 27f05038733a..6154b8137bf3 100644 --- a/src/components/QRShare/QRShareWithDownload/index.native.js +++ b/src/components/QRShare/QRShareWithDownload/index.native.js @@ -1,11 +1,10 @@ import React, {Component} from 'react'; import ViewShot from 'react-native-view-shot'; import fileDownload from '../../../libs/fileDownload'; -import QRShare from '..' +import QRShare from '..'; import {qrShareDefaultProps, qrSharePropTypes} from '../propTypes'; import getQrCodeFileName from '../getQrCodeDownloadFileName'; - class QRShareWithDownload extends Component { qrCodeScreenshotRef = React.createRef(); diff --git a/src/components/QRShare/index.js b/src/components/QRShare/index.js index 014cddcf5090..8676432208a1 100644 --- a/src/components/QRShare/index.js +++ b/src/components/QRShare/index.js @@ -9,7 +9,7 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDime import compose from '../../libs/compose'; import variables from '../../styles/variables'; import ExpensifyWordmark from '../../../assets/images/expensify-wordmark.svg'; -import {qrSharePropTypes, qrShareDefaultProps} from './propTypes' +import {qrSharePropTypes, qrShareDefaultProps} from './propTypes'; const propTypes = { ...qrSharePropTypes, diff --git a/src/pages/ReimbursementAccount/BankAccountManualStep.js b/src/pages/ReimbursementAccount/BankAccountManualStep.js index 02da681858cc..0cb6a706abf8 100644 --- a/src/pages/ReimbursementAccount/BankAccountManualStep.js +++ b/src/pages/ReimbursementAccount/BankAccountManualStep.js @@ -117,11 +117,7 @@ class BankAccountManualStep extends React.Component { LabelComponent={() => ( {this.props.translate('common.iAcceptThe')} - - {this.props.translate('common.expensifyTermsOfService')} - + {this.props.translate('common.expensifyTermsOfService')} )} defaultValue={this.props.getDefaultStateForField('acceptTerms', false)} diff --git a/src/pages/ReimbursementAccount/BankAccountPlaidStep.js b/src/pages/ReimbursementAccount/BankAccountPlaidStep.js index d4f505720a95..aade78afd54a 100644 --- a/src/pages/ReimbursementAccount/BankAccountPlaidStep.js +++ b/src/pages/ReimbursementAccount/BankAccountPlaidStep.js @@ -116,24 +116,20 @@ class BankAccountPlaidStep extends React.Component { bankAccountID={bankAccountID} selectedPlaidAccountID={selectedPlaidAccountID} /> - {Boolean(selectedPlaidAccountID) && !_.isEmpty(lodashGet(this.props.plaidData, 'bankAccounts')) && + {Boolean(selectedPlaidAccountID) && !_.isEmpty(lodashGet(this.props.plaidData, 'bankAccounts')) && ( ( {this.props.translate('common.iAcceptThe')} - - {this.props.translate('common.expensifyTermsOfService')} - + {this.props.translate('common.expensifyTermsOfService')} )} defaultValue={this.props.getDefaultStateForField('acceptTerms', false)} shouldSaveDraft /> - } + )} ); From 7058dc6a25927377907a7f2f0b1f3b86e2f8cb3c Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 08:58:18 +0100 Subject: [PATCH 07/15] Show settings page on all threads --- src/pages/ReportDetailsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 31695547fea9..21fb837d7bf0 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -82,7 +82,7 @@ class ReportDetailsPage extends Component { }); } - if ((ReportUtils.isPolicyExpenseChat(this.props.report) || ReportUtils.isChatRoom(this.props.report)) && !ReportUtils.isThread(this.props.report)) { + if (ReportUtils.isPolicyExpenseChat(this.props.report) || ReportUtils.isChatRoom(this.props.report) || ReportUtils.isThread(this.props.report)) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.SETTINGS, translationKey: 'common.settings', From 430d5f82ce9362c7af95d0fdd355fa77aed11377 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 09:03:38 +0100 Subject: [PATCH 08/15] Remove room name option from settings --- src/pages/ReportSettingsPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/ReportSettingsPage.js b/src/pages/ReportSettingsPage.js index cee26f37714b..84670fd8267a 100644 --- a/src/pages/ReportSettingsPage.js +++ b/src/pages/ReportSettingsPage.js @@ -143,9 +143,9 @@ class ReportSettingsPage extends Component { } render() { - const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(this.props.report); + const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(this.props.report) && !ReportUtils.isThread(this.props.report); const linkedWorkspace = _.find(this.props.policies, (policy) => policy && policy.id === this.props.report.policyID); - const shouldDisableRename = this.shouldDisableRename(linkedWorkspace); + const shouldDisableRename = this.shouldDisableRename(linkedWorkspace) || ReportUtils.isThread(this.props.report); return ( From 22e621bccb2511fbbc2df168ae676618203af9c7 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 09:31:04 +0100 Subject: [PATCH 09/15] Use allReports instead of passing in parent (to use from anywhere) --- src/libs/ReportUtils.js | 5 +++-- src/libs/SidebarUtils.js | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 108d6d1fc83d..779b4f0bafcb 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -473,15 +473,16 @@ function isThreadFirstChat(reportAction, reportID) { /** * Get either the policyName or domainName the chat is tied to * @param {Object} report - * @param {Object} parentReport * @returns {String} */ -function getChatRoomSubtitle(report, parentReport = null) { +function getChatRoomSubtitle(report) { if (isThread(report)) { if (!getChatType(report)) { return ''; } + const parentReport = lodashGet(allReports, [`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`]); + // If thread is not from a DM or group chat, the subtitle will follow the pattern 'Workspace Name • #roomName' const workspaceName = getPolicyName(report); let roomName = ''; diff --git a/src/libs/SidebarUtils.js b/src/libs/SidebarUtils.js index c8e15e929fa1..45e992be8889 100644 --- a/src/libs/SidebarUtils.js +++ b/src/libs/SidebarUtils.js @@ -260,10 +260,9 @@ function getOptionData(reportID) { result.tooltipText = ReportUtils.getReportParticipantsTitle(report.participants || []); result.hasOutstandingIOU = report.hasOutstandingIOU; result.parentReportID = report.parentReportID || null; - const parentReport = result.parentReportID ? chatReports[`${ONYXKEYS.COLLECTION.REPORT}${result.parentReportID}`] : null; const hasMultipleParticipants = participantPersonalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat; - const subtitle = ReportUtils.getChatRoomSubtitle(report, parentReport); + const subtitle = ReportUtils.getChatRoomSubtitle(report); const login = Str.removeSMSDomain(lodashGet(personalDetail, 'login', '')); const formattedLogin = Str.isSMSLogin(login) ? LocalePhoneNumber.formatPhoneNumber(login) : login; From 82bc57fb0ccba208e2cba53ba108d7626aaa0c6d Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 09:37:12 +0100 Subject: [PATCH 10/15] Use correct subtitle in QR --- src/pages/ShareCodePage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ShareCodePage.js b/src/pages/ShareCodePage.js index 8fbfabe9f524..c67c42520767 100644 --- a/src/pages/ShareCodePage.js +++ b/src/pages/ShareCodePage.js @@ -37,6 +37,7 @@ class ShareCodePage extends React.Component { render() { const isReport = this.props.report != null && this.props.report.reportID != null; + const subtitle = ReportUtils.getChatRoomSubtitle(this.props.report); const url = isReport ? `${CONST.NEW_EXPENSIFY_URL}r/${this.props.report.reportID}` : `${CONST.NEW_EXPENSIFY_URL}details?login=${this.props.session.email}`; @@ -58,7 +59,7 @@ class ShareCodePage extends React.Component { ref={this.qrCodeRef} url={url} title={isReport ? this.props.report.reportName : this.props.currentUserPersonalDetails.displayName} - subtitle={isReport ? ReportUtils.getPolicyName(this.props.report) : this.props.session.email} + subtitle={isReport ? subtitle : this.props.session.email} logo={isReport ? roomAvatar : this.props.currentUserPersonalDetails.avatar} /> From e393852170392f3235c674676c20bdfe4634c302 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 17:38:53 +0100 Subject: [PATCH 11/15] DRY --- src/pages/ReportDetailsPage.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 21fb837d7bf0..6768e8436644 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -94,22 +94,13 @@ class ReportDetailsPage extends Component { } const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; + const isThread = ReportUtils.isThread(this.props.report); if ( - (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) && - _.isEmpty(this.props.report.parentReportActionID) + (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) || isThread ) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, - translationKey: 'common.leaveRoom', - icon: Expensicons.Exit, - action: () => Report.leaveRoom(this.props.report.reportID), - }); - } - - if (ReportUtils.isThread(this.props.report)) { - menuItems.push({ - key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, - translationKey: 'common.leaveThread', + translationKey: isThread ? 'common.leaveThread' : 'common.leaveRoom', icon: Expensicons.Exit, action: () => Report.leaveRoom(this.props.report.reportID), }); From 9772b4d4d905df00364df3a2bea78188ae0c529a Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 17:39:13 +0100 Subject: [PATCH 12/15] prettier --- src/pages/ReportDetailsPage.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 6768e8436644..c0a155f269f1 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -95,9 +95,7 @@ class ReportDetailsPage extends Component { const policy = this.props.policies[`${ONYXKEYS.COLLECTION.POLICY}${this.props.report.policyID}`]; const isThread = ReportUtils.isThread(this.props.report); - if ( - (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy))) || isThread - ) { + if (ReportUtils.isUserCreatedPolicyRoom(this.props.report) || ReportUtils.canLeaveRoom(this.props.report, !_.isEmpty(policy)) || isThread) { menuItems.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.LEAVE_ROOM, translationKey: isThread ? 'common.leaveThread' : 'common.leaveRoom', From 62b2e99f600af8e11f23fd9a5153419c2805fc17 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 17 May 2023 20:09:30 +0100 Subject: [PATCH 13/15] Fix members section title + show back button --- src/pages/ReportParticipantsPage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/ReportParticipantsPage.js b/src/pages/ReportParticipantsPage.js index a4a4d4b8e17a..27c201ef96bd 100755 --- a/src/pages/ReportParticipantsPage.js +++ b/src/pages/ReportParticipantsPage.js @@ -86,10 +86,12 @@ const ReportParticipantsPage = (props) => { {({safeAreaPaddingBottomStyle}) => ( Date: Wed, 17 May 2023 20:12:35 +0100 Subject: [PATCH 14/15] Fix title on web --- src/pages/ReportDetailsPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index c0a155f269f1..f39153336125 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -110,6 +110,7 @@ class ReportDetailsPage extends Component { render() { const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(this.props.report); const isChatRoom = ReportUtils.isChatRoom(this.props.report); + const isThread = ReportUtils.isThread(this.props.report); const chatRoomSubtitle = ReportUtils.getChatRoomSubtitle(this.props.report); const participants = lodashGet(this.props.report, 'participants', []); const isMultipleParticipant = participants.length > 1; @@ -140,7 +141,7 @@ class ReportDetailsPage extends Component { tooltipEnabled numberOfLines={1} textStyles={[styles.textHeadline, styles.mb2, styles.textAlignCenter, styles.pre]} - shouldUseFullTitle={isChatRoom || isPolicyExpenseChat} + shouldUseFullTitle={isChatRoom || isPolicyExpenseChat || isThread} /> Date: Wed, 17 May 2023 20:13:55 +0100 Subject: [PATCH 15/15] prettier --- src/pages/ReportDetailsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index f39153336125..11badcede40b 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -110,7 +110,7 @@ class ReportDetailsPage extends Component { render() { const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(this.props.report); const isChatRoom = ReportUtils.isChatRoom(this.props.report); - const isThread = ReportUtils.isThread(this.props.report); + const isThread = ReportUtils.isThread(this.props.report); const chatRoomSubtitle = ReportUtils.getChatRoomSubtitle(this.props.report); const participants = lodashGet(this.props.report, 'participants', []); const isMultipleParticipant = participants.length > 1;