From 19b5bd9653ad179b36c40e799a0490801623ec4a Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 19 Jul 2023 16:00:50 +0700 Subject: [PATCH 1/5] fix: The green line appear immediately only after comments are added --- src/pages/home/report/ReportActionItem.js | 9 +++++++-- src/pages/home/report/ReportActionsList.js | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 3b836711a948..7630877beac5 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -98,6 +98,9 @@ const propTypes = { /** Is this the only report action on the report? */ isOnlyReportAction: PropTypes.bool, + + /** Flag to show, hide the thread divider line */ + shouldHideThreadDividerLine: PropTypes.bool, }; const defaultProps = { @@ -107,6 +110,7 @@ const defaultProps = { shouldShowSubscriptAvatar: false, hasOutstandingIOU: false, isOnlyReportAction: false, + shouldHideThreadDividerLine: false, }; function ReportActionItem(props) { @@ -420,7 +424,7 @@ function ReportActionItem(props) { return ( ); } @@ -575,6 +579,7 @@ export default compose( ReportUtils.isCompletedTaskReport(prevProps.report) === ReportUtils.isCompletedTaskReport(nextProps.report) && prevProps.report.managerID === nextProps.report.managerID && prevProps.report.managerEmail === nextProps.report.managerEmail && - prevProps.isOnlyReportAction === nextProps.isOnlyReportAction, + prevProps.isOnlyReportAction === nextProps.isOnlyReportAction && + prevProps.shouldHideThreadDividerLine === nextProps.shouldHideThreadDividerLine, ), ); diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index eac0975f150c..1402b1f611f5 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -127,17 +127,17 @@ function ReportActionsList(props) { // When the new indicator should not be displayed we explicitly set it to null const shouldDisplayNewMarker = reportAction.reportActionID === newMarkerReportActionID; const shouldDisplayParentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED && ReportUtils.isChatThread(report); - const shouldHideThreadDividerLine = - shouldDisplayParentAction && sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID; + const shouldHideThreadDividerLine = sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID; return shouldDisplayParentAction ? ( ) : ( Date: Thu, 27 Jul 2023 16:38:17 +0700 Subject: [PATCH 2/5] fix: change prop --- src/pages/home/report/ReportActionItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 7addd6546128..d245b561932f 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -442,7 +442,7 @@ function ReportActionItem(props) { return ( ); } From bee9e09e457f5af252c79a6aaa6302f449d332fc Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 28 Jul 2023 15:02:54 +0700 Subject: [PATCH 3/5] fix: update shouldHideThreadDividerLine to moneyRequestView --- src/pages/home/report/ReportActionItem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 68824eea04d3..a93767a89e8b 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -104,6 +104,7 @@ const propTypes = { personalDetailsList: PropTypes.objectOf(personalDetailsPropType), /** Is this the only report action on the report? */ + // eslint-disable-next-line react/no-unused-prop-types isOnlyReportAction: PropTypes.bool, /** Flag to show, hide the thread divider line */ @@ -456,7 +457,7 @@ function ReportActionItem(props) { return ( ); } From 1cbebae2fff0852aa89952e969cfcef3184c0ff8 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 28 Jul 2023 15:33:17 +0700 Subject: [PATCH 4/5] fix: remove un-used variable --- src/pages/home/report/ReportActionItem.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index a93767a89e8b..fa5644210bb6 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -103,10 +103,6 @@ const propTypes = { emojiReactions: EmojiReactionsPropTypes, personalDetailsList: PropTypes.objectOf(personalDetailsPropType), - /** Is this the only report action on the report? */ - // eslint-disable-next-line react/no-unused-prop-types - isOnlyReportAction: PropTypes.bool, - /** Flag to show, hide the thread divider line */ shouldHideThreadDividerLine: PropTypes.bool, }; @@ -118,7 +114,6 @@ const defaultProps = { personalDetailsList: {}, shouldShowSubscriptAvatar: false, hasOutstandingIOU: false, - isOnlyReportAction: false, shouldHideThreadDividerLine: false, }; @@ -624,7 +619,6 @@ export default compose( ReportUtils.isCompletedTaskReport(prevProps.report) === ReportUtils.isCompletedTaskReport(nextProps.report) && prevProps.report.managerID === nextProps.report.managerID && prevProps.report.managerEmail === nextProps.report.managerEmail && - prevProps.isOnlyReportAction === nextProps.isOnlyReportAction && prevProps.shouldHideThreadDividerLine === nextProps.shouldHideThreadDividerLine, ), ); From 05b22d0a78f489a3d93add58f54885a254c10bec Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 28 Jul 2023 15:44:06 +0700 Subject: [PATCH 5/5] fix: remove redundant prop --- src/pages/home/report/ReportActionsList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 606395dea6cb..20a0952d56ea 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -152,7 +152,6 @@ function ReportActionsList(props) { isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID} hasOutstandingIOU={hasOutstandingIOU} index={index} - isOnlyReportAction={sortedReportActions.length === 1} /> ); },