From 8535b4268341bf34893c2516a2362bb1aeb0f327 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 30 May 2023 10:42:26 -0600 Subject: [PATCH 1/3] Remove threads beta --- src/libs/Permissions.js | 9 --------- src/pages/home/report/ContextMenu/ContextMenuActions.js | 1 - src/pages/home/report/ReportActionItem.js | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/libs/Permissions.js b/src/libs/Permissions.js index 84d0a3d0154b..d3e407260e20 100644 --- a/src/libs/Permissions.js +++ b/src/libs/Permissions.js @@ -102,14 +102,6 @@ function canUseTasks(betas) { return _.contains(betas, CONST.BETAS.TASKS) || _.contains(betas, CONST.BETAS.ALL); } -/** - * @param {Array} betas - * @returns {Boolean} - */ -function canUseThreads(betas) { - return _.contains(betas, CONST.BETAS.THREADS) || canUseAllBetas(betas); -} - export default { canUseChronos, canUseIOU, @@ -122,5 +114,4 @@ export default { canUsePolicyExpenseChat, canUsePasswordlessLogins, canUseTasks, - canUseThreads, }; diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index 300d689aea52..bf7efc98e67f 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -111,7 +111,6 @@ export default [ successTextTranslateKey: '', successIcon: null, shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => - Permissions.canUseThreads(betas) && type === CONTEXT_MENU_TYPES.REPORT_ACTION && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID), diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 35fb9eddc06b..34dcb0764ca7 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -324,7 +324,7 @@ function ReportActionItem(props) { const hasReplies = numberOfThreadReplies > 0; const shouldDisplayThreadReplies = - hasReplies && props.action.childCommenterCount && Permissions.canUseThreads(props.betas) && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID); + hasReplies && props.action.childCommenterCount && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID); const oldestFourEmails = lodashGet(props.action, 'childOldestFourEmails', '').split(','); return ( From 407d5b98fa932e606a4bc9495b7958c162b7b7f0 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 30 May 2023 10:53:55 -0600 Subject: [PATCH 2/3] Remove unused vars --- src/pages/home/report/ReportActionItem.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 34dcb0764ca7..f08721a808c1 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -52,7 +52,6 @@ import ReportPreview from '../../../components/ReportActionItem/ReportPreview'; import ReportActionItemDraft from './ReportActionItemDraft'; import TaskPreview from '../../../components/ReportActionItem/TaskPreview'; import TaskAction from '../../../components/ReportActionItem/TaskAction'; -import Permissions from '../../../libs/Permissions'; import * as Session from '../../../libs/actions/Session'; import {hideContextMenu} from './ContextMenu/ReportActionContextMenu'; @@ -92,9 +91,6 @@ const propTypes = { /** All of the personalDetails */ personalDetails: PropTypes.objectOf(personalDetailsPropType), - - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), }; const defaultProps = { @@ -103,7 +99,6 @@ const defaultProps = { personalDetails: {}, shouldShowSubscriptAvatar: false, hasOutstandingIOU: false, - betas: [], }; function ReportActionItem(props) { @@ -506,9 +501,6 @@ export default compose( preferredSkinTone: { key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE, }, - betas: { - key: ONYXKEYS.BETAS, - }, }), )( memo( From d586e538771642b864d2c9d0d47523bebdcd2f6f Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 30 May 2023 12:15:06 -0600 Subject: [PATCH 3/3] Style --- src/pages/home/report/ContextMenu/ContextMenuActions.js | 4 +--- src/pages/home/report/ReportActionItem.js | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index bf7efc98e67f..7a3a68a0ce5d 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -111,9 +111,7 @@ export default [ successTextTranslateKey: '', successIcon: null, shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => - type === CONTEXT_MENU_TYPES.REPORT_ACTION && - reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && - !ReportUtils.isThreadFirstChat(reportAction, reportID), + type === CONTEXT_MENU_TYPES.REPORT_ACTION && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID), onPress: (closePopover, {reportAction, reportID}) => { Report.navigateToAndOpenChildReport(lodashGet(reportAction, 'childReportID', '0'), reportAction, reportID); if (closePopover) { diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index f08721a808c1..0b4795d7cf80 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -318,8 +318,7 @@ function ReportActionItem(props) { const numberOfThreadReplies = _.get(props, ['action', 'childVisibleActionCount'], 0); const hasReplies = numberOfThreadReplies > 0; - const shouldDisplayThreadReplies = - hasReplies && props.action.childCommenterCount && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID); + const shouldDisplayThreadReplies = hasReplies && props.action.childCommenterCount && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID); const oldestFourEmails = lodashGet(props.action, 'childOldestFourEmails', '').split(','); return (