From fe90328f24e1ee57366d36a5140ee0d1129dd77c Mon Sep 17 00:00:00 2001 From: Steven Burnett Date: Mon, 24 Sep 2018 11:15:49 -0600 Subject: [PATCH] remove last posted non replied discussions fixes COMMS-1457 Test Plan: -Create a course -Add a discussion -On the discussions index page, see that a "Last Post" time does not appear - add some replies - notice the last post time appears Change-Id: Ide93d613ab6a7c93936c59b42837845c7a6384d9 Reviewed-on: https://gerrit.instructure.com/165538 Reviewed-by: Aaron Kc Hsu Tested-by: Jenkins QA-Review: Landon Gilbert-Bland Product-Review: Steven Burnett --- app/jsx/discussions/components/DiscussionRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jsx/discussions/components/DiscussionRow.js b/app/jsx/discussions/components/DiscussionRow.js index c79abfccb13..869c8c3228d 100644 --- a/app/jsx/discussions/components/DiscussionRow.js +++ b/app/jsx/discussions/components/DiscussionRow.js @@ -236,7 +236,7 @@ export class DiscussionRow extends Component { : ' ' result += dueDateString const lastReplyAtDate = $.datetimeString(this.props.discussion.last_reply_at) - if (lastReplyAtDate.length > 0) { + if (lastReplyAtDate.length > 0 && this.props.discussion.discussion_subentry_count > 0) { result += I18n.t('Last post at %{date}', {date: lastReplyAtDate}) } return result @@ -595,7 +595,7 @@ export class DiscussionRow extends Component { renderLastReplyAt = () => { const datetimeString = $.datetimeString(this.props.discussion.last_reply_at) - if (!datetimeString.length) { + if (!datetimeString.length || this.props.discussion.discussion_subentry_count === 0) { return null } return (