Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ const propTypes = {
emojiReactions: EmojiReactionsPropTypes,
personalDetailsList: PropTypes.objectOf(personalDetailsPropType),

/** 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 = {
Expand All @@ -114,7 +114,7 @@ const defaultProps = {
personalDetailsList: {},
shouldShowSubscriptAvatar: false,
hasOutstandingIOU: false,
isOnlyReportAction: false,
shouldHideThreadDividerLine: false,
};

function ReportActionItem(props) {
Expand Down Expand Up @@ -452,23 +452,23 @@ function ReportActionItem(props) {
return (
<MoneyRequestView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
if (ReportUtils.isTaskReport(props.report)) {
return (
<TaskView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In above on L427 also, shouldShowHorizontalRule prop is passed. Should we also update that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonilBhavsar updated, please help review again.

/>
);
}
if (ReportUtils.isExpenseReport(props.report) || ReportUtils.isIOUReport(props.report)) {
return (
<MoneyReportView
report={props.report}
shouldShowHorizontalRule={!props.isOnlyReportAction}
shouldShowHorizontalRule={!props.shouldHideThreadDividerLine}
/>
);
}
Expand Down Expand Up @@ -619,6 +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,
),
);
7 changes: 3 additions & 4 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ function ReportActionsList(props) {
reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED &&
ReportUtils.isChatThread(report) &&
!ReportActionsUtils.isTransactionThread(ReportActionsUtils.getParentReportAction(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 ? (
<ReportActionItemParentAction
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
shouldHideThreadDividerLine={shouldDisplayParentAction && shouldHideThreadDividerLine}
reportID={report.reportID}
parentReportID={`${report.parentReportID}`}
shouldDisplayNewMarker={shouldDisplayNewMarker}
/>
) : (
<ReportActionItem
shouldHideThreadDividerLine={shouldHideThreadDividerLine}
report={report}
action={reportAction}
displayAsGroup={ReportActionsUtils.isConsecutiveActionMadeByPreviousActor(sortedReportActions, index)}
Expand All @@ -152,7 +152,6 @@ function ReportActionsList(props) {
isMostRecentIOUReportAction={reportAction.reportActionID === mostRecentIOUReportActionID}
hasOutstandingIOU={hasOutstandingIOU}
index={index}
isOnlyReportAction={sortedReportActions.length === 1}
/>
);
},
Expand Down