Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
25435cfc
Commit
25435cfc
authored
Apr 13, 2017
by
attiyaishaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TNL-5515. Fix discussion topic navigation and sorting option.
parent
3daa07a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
common/static/common/js/discussion/views/new_post_view.js
+11
-1
common/test/acceptance/tests/discussion/test_discussion.py
+16
-0
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
+1
-0
No files found.
common/static/common/js/discussion/views/new_post_view.js
View file @
25435cfc
...
...
@@ -43,6 +43,7 @@
this
.
course_settings
=
options
.
course_settings
;
this
.
is_commentable_cohorted
=
options
.
is_commentable_cohorted
;
this
.
topicId
=
options
.
topicId
;
this
.
discussionBoardView
=
options
.
discussionBoardView
;
};
NewPostView
.
prototype
.
render
=
function
()
{
...
...
@@ -161,8 +162,17 @@
},
error
:
DiscussionUtil
.
formErrorHandler
(
this
.
$
(
'.post-errors'
)),
success
:
function
(
response
)
{
var
thread
;
var
thread
,
discussionBreadcrumbsModel
;
thread
=
new
Thread
(
response
.
content
);
// Update the breadcrumbs and discussion Id(s) related to current topic
if
(
self
.
discussionBoardView
)
{
discussionBreadcrumbsModel
=
self
.
discussionBoardView
.
breadcrumbs
.
model
;
if
(
discussionBreadcrumbsModel
.
get
(
'contents'
).
length
)
{
discussionBreadcrumbsModel
.
set
(
'contents'
,
self
.
topicView
.
topicText
.
split
(
'/'
));
}
self
.
discussionBoardView
.
discussionThreadListView
.
discussionIds
=
self
.
topicView
.
currentTopicId
;
}
self
.
$el
.
addClass
(
'is-hidden'
);
self
.
resetForm
();
self
.
trigger
(
'newPost:createPost'
);
...
...
common/test/acceptance/tests/discussion/test_discussion.py
View file @
25435cfc
...
...
@@ -297,6 +297,22 @@ class DiscussionNavigationTest(BaseDiscussionTestCase):
self
.
thread_page
.
q
(
css
=
".breadcrumbs .nav-item"
)[
0
]
.
click
()
self
.
assertEqual
(
self
.
thread_page
.
q
(
css
=
".search-input"
)
.
text
[
0
],
""
)
def
test_navigation_and_sorting
(
self
):
"""
Test that after adding the post, user sorting preference is changing properly
and recently added post is shown.
"""
topic_button
=
self
.
thread_page
.
q
(
css
=
".forum-nav-browse-menu-item[data-discussion-id='{}']"
.
format
(
self
.
discussion_id
)
)
self
.
assertTrue
(
topic_button
.
visible
)
topic_button
.
click
()
sort_page
=
DiscussionSortPreferencePage
(
self
.
browser
,
self
.
course_id
)
for
sort_type
in
[
"votes"
,
"comments"
,
"activity"
]:
sort_page
.
change_sort_preference
(
sort_type
)
# Verify that recently added post titled "dummy thread title" is shown in each sorting preference
self
.
assertEqual
(
self
.
thread_page
.
q
(
css
=
".forum-nav-thread-title"
)
.
text
[
0
],
'dummy thread title'
)
@attr
(
shard
=
2
)
class
DiscussionTabSingleThreadTest
(
BaseDiscussionTestCase
,
DiscussionResponsePaginationTestMixin
):
...
...
lms/djangoapps/discussion/static/discussion/js/discussion_board_factory.js
View file @
25435cfc
...
...
@@ -57,6 +57,7 @@
el
:
$
(
'.new-post-article'
),
collection
:
discussion
,
course_settings
:
courseSettings
,
discussionBoardView
:
discussionBoardView
,
mode
:
'tab'
,
startHeader
:
2
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment