Skip to content

Commit 3421bb7

Browse files
committed
hide unread count on group discussions
fixes CNVS-15309 test plan - create a course level group discussion - view the course's discussion index page - ensure that the unread count is not displayed for the group discussion Change-Id: I0605a8c669de42686790d25d2db25261a57bd967 Reviewed-on: https://gerrit.instructure.com/95981 Tested-by: Jenkins Reviewed-by: Clay Diffrient <cdiffrient@instructure.com> QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Product-Review: Joel Hough <joel@instructure.com>
1 parent 6c89631 commit 3421bb7

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

app/coffeescripts/models/DiscussionTopic.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ define [
8484
reply_count_tooltip: @replyTooltip()
8585
assignment: json.assignment?.toJSON()
8686
defaultDates: @defaultDates().toJSON()
87+
isRootTopic: @isRootTopic()
8788
delete json.assignment.rubric if json.assignment
8889
json
8990

@@ -183,6 +184,9 @@ define [
183184
$toFocus = $('.ig-header-title', $toFocus) if $toFocus.hasClass('discussion-list')
184185
$toFocus.focus()
185186

187+
isRootTopic: () ->
188+
!@get('root_topic_id') && @get('group_category_id')
189+
186190
groupCategoryId: (id) =>
187191
return @get( 'group_category_id' ) unless arguments.length > 0
188192
@set 'group_category_id', id

app/views/jst/DiscussionTopics/discussion.handlebars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
</div>
6666

6767
<div class="discussion-unread-status">
68+
{{#unless isRootTopic}}
6869
<div class="new-and-total-badge pull-right">
6970
<span class="new-items"
7071
title="{{unread_count_tooltip}}"
@@ -86,6 +87,7 @@
8687
{{reply_count_tooltip}}
8788
</div>
8889
</div>
90+
{{/unless}}
8991
</div>
9092

9193
<div class="discussion-actions">

spec/selenium/discussions/discussions_index_page_any_user_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
let(:teacher) { teacher_in_course(course: course, name: 'teacher', active_all: true).user }
1010
let(:somebody) { student_in_course(course: course, name: 'somebody', active_all: true).user }
1111
let(:somebody_topic) { course.discussion_topics.create!(user: somebody, title: 'somebody topic title', message: 'somebody topic message') }
12+
let(:group_topic) { group_discussion_assignment }
1213
let(:assignment_group) { course.assignment_groups.create!(name: 'assignment group') }
1314
let(:entry) { topic.discussion_entries.create!(user: teacher, message: 'teacher entry') }
1415

@@ -107,6 +108,12 @@
107108
expect(f('.total-items').text).to eq '1'
108109
end
109110

111+
it "hides unread count for group discussions" do
112+
group_topic
113+
get url
114+
expect(f(".discussion-unread-status").text).to eq ''
115+
end
116+
110117
describe 'filtering' do
111118
before(:each) do
112119
@graded_unread_topic = topic_for_filtering(read: false, graded: true)

0 commit comments

Comments
 (0)