From 82713e6d8cf169d33e7a616b1bede527a94a7cf7 Mon Sep 17 00:00:00 2001 From: Jakub Trzebiatowski Date: Mon, 21 Aug 2023 10:29:40 +0200 Subject: [PATCH 1/5] Remove unused attachment placeholder code --- src/pages/home/report/ReportActionItem.js | 1 + .../home/report/ReportActionItemFragment.js | 19 ------------------- .../home/report/ReportActionItemMessage.js | 1 - .../home/report/ReportActionItemSingle.js | 1 - 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 8700327a168a..5dda82145f21 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -549,6 +549,7 @@ function ReportActionItem(props) { diff --git a/src/pages/home/report/ReportActionItemFragment.js b/src/pages/home/report/ReportActionItemFragment.js index 009c1118400b..b437010efe75 100644 --- a/src/pages/home/report/ReportActionItemFragment.js +++ b/src/pages/home/report/ReportActionItemFragment.js @@ -1,5 +1,4 @@ import React, {memo} from 'react'; -import {ActivityIndicator, View} from 'react-native'; import PropTypes from 'prop-types'; import Str from 'expensify-common/lib/str'; import reportActionFragmentPropTypes from './reportActionFragmentPropTypes'; @@ -46,9 +45,6 @@ const propTypes = { source: PropTypes.string, }), - /** Does this fragment belong to a reportAction that has not yet loaded? */ - loading: PropTypes.bool, - /** The reportAction's source */ source: PropTypes.oneOf(['Chronos', 'email', 'ios', 'android', 'web', 'email', '']), @@ -78,7 +74,6 @@ const defaultProps = { type: '', source: '', }, - loading: false, isSingleLine: false, source: '', style: [], @@ -89,20 +84,6 @@ const defaultProps = { function ReportActionItemFragment(props) { switch (props.fragment.type) { case 'COMMENT': { - // If this is an attachment placeholder, return the placeholder component - if (props.isAttachment && props.loading) { - return Str.isImage(props.attachmentInfo.name) ? ( - `} /> - ) : ( - - - - ); - } const {html, text} = props.fragment; // Threaded messages display "[Deleted message]" instead of being hidden altogether. diff --git a/src/pages/home/report/ReportActionItemMessage.js b/src/pages/home/report/ReportActionItemMessage.js index 7dcb2b51dbf3..fbad50c4f7e6 100644 --- a/src/pages/home/report/ReportActionItemMessage.js +++ b/src/pages/home/report/ReportActionItemMessage.js @@ -48,7 +48,6 @@ function ReportActionItemMessage(props) { pendingAction={props.action.pendingAction} source={lodashGet(props.action, 'originalMessage.source')} accountID={props.action.actorAccountID} - loading={props.action.isLoading} style={props.style} /> )) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index c00f98c613e4..d1805cd148da 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -231,7 +231,6 @@ function ReportActionItemSingle(props) { accountID={actorAccountID} fragment={fragment} isAttachment={props.action.isAttachment} - isLoading={props.action.isLoading} delegateAccountID={props.action.delegateAccountID} isSingleLine actorIcon={icon} From 49f20da8dd368313b7c7feaa7300419ee66a5010 Mon Sep 17 00:00:00 2001 From: Jakub Trzebiatowski Date: Mon, 21 Aug 2023 11:08:52 +0200 Subject: [PATCH 2/5] Remove the remaining uses of the report action `isLoading` property --- src/pages/home/report/ReportActionItem.js | 3 +-- src/pages/home/report/reportActionPropTypes.js | 3 --- src/styles/StyleUtils.js | 6 +++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 5dda82145f21..fe8eb4638e98 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -549,8 +549,7 @@ function ReportActionItem(props) { Date: Tue, 22 Aug 2023 10:00:30 +0200 Subject: [PATCH 3/5] ReportActionItemFragment: Remove unused isAttachment property --- src/pages/home/report/ReportActionItemFragment.js | 4 ---- src/pages/home/report/ReportActionItemMessage.js | 1 - src/pages/home/report/ReportActionItemSingle.js | 1 - 3 files changed, 6 deletions(-) diff --git a/src/pages/home/report/ReportActionItemFragment.js b/src/pages/home/report/ReportActionItemFragment.js index b437010efe75..2988d62f8d38 100644 --- a/src/pages/home/report/ReportActionItemFragment.js +++ b/src/pages/home/report/ReportActionItemFragment.js @@ -27,9 +27,6 @@ const propTypes = { /** The message fragment needing to be displayed */ fragment: reportActionFragmentPropTypes.isRequired, - /** Is this fragment an attachment? */ - isAttachment: PropTypes.bool, - /** If this fragment is attachment than has info? */ attachmentInfo: PropTypes.shape({ /** The file name of attachment */ @@ -67,7 +64,6 @@ const propTypes = { }; const defaultProps = { - isAttachment: false, attachmentInfo: { name: '', size: 0, diff --git a/src/pages/home/report/ReportActionItemMessage.js b/src/pages/home/report/ReportActionItemMessage.js index fbad50c4f7e6..2850b396e113 100644 --- a/src/pages/home/report/ReportActionItemMessage.js +++ b/src/pages/home/report/ReportActionItemMessage.js @@ -42,7 +42,6 @@ function ReportActionItemMessage(props) { Date: Tue, 22 Aug 2023 10:07:20 +0200 Subject: [PATCH 4/5] Run Prettier --- src/pages/home/report/ReportActionItem.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 6d2b5ae14270..36d437ccb82f 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -556,12 +556,7 @@ function ReportActionItem(props) { draftMessage={props.draftMessage} isChronosReport={ReportUtils.chatIncludesChronos(originalReport)} /> - + ReportActions.clearReportActionErrors(props.report.reportID, props.action)} pendingAction={props.draftMessage ? null : props.action.pendingAction} From e08c5b4acafe23c27cffb18afad2aa2c6d079f91 Mon Sep 17 00:00:00 2001 From: Jakub Trzebiatowski Date: Tue, 22 Aug 2023 11:53:28 +0200 Subject: [PATCH 5/5] getReportActionItemStyle: Remove effectively unused hasError argument --- src/pages/home/report/ReportActionItem.js | 2 +- src/styles/StyleUtils.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 36d437ccb82f..fdf588921995 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -556,7 +556,7 @@ function ReportActionItem(props) { draftMessage={props.draftMessage} isChronosReport={ReportUtils.chatIncludesChronos(originalReport)} /> - + ReportActions.clearReportActionErrors(props.report.reportID, props.action)} pendingAction={props.draftMessage ? null : props.action.pendingAction} diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index 5aeb28d83e0e..6bb159a97297 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -637,10 +637,9 @@ function getLoginPagePromoStyle() { * Generate the styles for the ReportActionItem wrapper view. * * @param {Boolean} [isHovered] - * @param {Boolean} [hasError] * @returns {Object} */ -function getReportActionItemStyle(isHovered = false, hasError = false) { +function getReportActionItemStyle(isHovered = false) { return { display: 'flex', justifyContent: 'space-between', @@ -648,7 +647,7 @@ function getReportActionItemStyle(isHovered = false, hasError = false) { ? themeColors.hoverComponentBG : // Warning: Setting this to a non-transparent color will cause unread indicator to break on Android colors.transparent, - opacity: hasError ? 0.5 : 1, + opacity: 1, ...styles.cursorInitial, }; }