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
2ca355b8
Commit
2ca355b8
authored
Oct 07, 2015
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9605 from edx/andya/team-discussion-flaky-tests
Fix flaky team discussion test
parents
c1686a93
8914aaf8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
22 deletions
+18
-22
common/static/coffee/src/discussion/utils.coffee
+14
-17
common/static/coffee/src/discussion/views/discussion_thread_edit_view.js
+0
-2
common/static/coffee/src/discussion/views/thread_response_view.coffee
+0
-2
lms/djangoapps/teams/static/teams/js/spec/views/team_profile_spec.js
+4
-1
No files found.
common/static/coffee/src/discussion/utils.coffee
View file @
2ca355b8
$
->
if
!
window
.
$
$contents
window
.
$
$contents
=
{}
$
.
fn
.
extend
loading
:
(
takeFocus
)
->
@
$_loading
=
$
(
"<div class='loading-animation' tabindex='0'><span class='sr'>"
+
gettext
(
"Loading content"
)
+
"</span></div>"
)
$
(
this
).
after
(
@
$_loading
)
if
takeFocus
DiscussionUtil
.
makeFocusTrap
(
@
$_loading
)
@
$_loading
.
focus
()
loaded
:
->
@
$_loading
.
remove
()
class
@
DiscussionUtil
@
wmdEditors
:
{}
...
...
@@ -111,6 +98,16 @@ class @DiscussionUtil
event
.
preventDefault
()
)
@
showLoadingIndicator
:
(
element
,
takeFocus
)
->
@
$_loading
=
$
(
"<div class='loading-animation' tabindex='0'><span class='sr'>"
+
gettext
(
"Loading content"
)
+
"</span></div>"
)
element
.
after
(
@
$_loading
)
if
takeFocus
@
makeFocusTrap
(
@
$_loading
)
@
$_loading
.
focus
()
@
hideLoadingIndicator
:
()
->
@
$_loading
.
remove
()
@
discussionAlert
:
(
header
,
body
)
->
if
$
(
"#discussion-alert"
).
length
==
0
alertDiv
=
$
(
"<div class='modal' role='alertdialog' id='discussion-alert' aria-describedby='discussion-alert-message'/>"
).
css
(
"display"
,
"none"
)
...
...
@@ -141,28 +138,28 @@ class @DiscussionUtil
return
deferred
.
promise
()
params
[
"url"
]
=
URI
(
params
[
"url"
]).
addSearch
ajax
:
1
params
[
"beforeSend"
]
=
-
>
params
[
"beforeSend"
]
=
=
>
if
$elem
$elem
.
attr
(
"disabled"
,
"disabled"
)
if
params
[
"$loading"
]
if
params
[
"loadingCallback"
]
?
params
[
"loadingCallback"
].
apply
(
params
[
"$loading"
])
else
params
[
"$loading"
].
loading
(
params
[
"takeFocus"
])
@
showLoadingIndicator
(
$
(
params
[
"$loading"
]),
params
[
"takeFocus"
])
if
!
params
[
"error"
]
params
[
"error"
]
=
=>
@
discussionAlert
(
gettext
(
"Sorry"
),
gettext
(
"We had some trouble processing your request. Please ensure you have copied any unsaved work and then reload the page."
)
)
request
=
$
.
ajax
(
params
).
always
-
>
request
=
$
.
ajax
(
params
).
always
=
>
if
$elem
$elem
.
removeAttr
(
"disabled"
)
if
params
[
"$loading"
]
if
params
[
"loadedCallback"
]
?
params
[
"loadedCallback"
].
apply
(
params
[
"$loading"
])
else
params
[
"$loading"
].
loaded
()
@
hideLoadingIndicator
()
return
request
@
updateWithUndo
:
(
model
,
updates
,
safeAjaxParams
,
errorMsg
)
->
...
...
common/static/coffee/src/discussion/views/discussion_thread_edit_view.js
View file @
2ca355b8
...
...
@@ -73,11 +73,9 @@
url
:
DiscussionUtil
.
urlFor
(
'update_thread'
,
this
.
model
.
id
),
type
:
'POST'
,
dataType
:
'json'
,
async
:
false
,
// @TODO when the rest of the stuff below is made to work properly..
data
:
postData
,
error
:
DiscussionUtil
.
formErrorHandler
(
this
.
$
(
'.post-errors'
)),
success
:
function
()
{
// @TODO: Move this out of the callback, this makes it feel sluggish
this
.
$
(
'.edit-post-title'
).
val
(
''
).
attr
(
'prev-text'
,
''
);
this
.
$
(
'.edit-post-body textarea'
).
val
(
''
).
attr
(
'prev-text'
,
''
);
this
.
$
(
'.wmd-preview p'
).
html
(
''
);
...
...
common/static/coffee/src/discussion/views/thread_response_view.coffee
View file @
2ca355b8
...
...
@@ -211,12 +211,10 @@ if Backbone?
url
:
url
type
:
"POST"
dataType
:
'json'
async
:
false
# TODO when the rest of the stuff below is made to work properly..
data
:
body
:
newBody
error
:
DiscussionUtil
.
formErrorHandler
(
@
$
(
".edit-post-form-errors"
))
success
:
(
response
,
textStatus
)
=>
# TODO: Move this out of the callback, this makes it feel sluggish
@
editView
.
$
(
".edit-post-body textarea"
).
val
(
""
).
attr
(
"prev-text"
,
""
)
@
editView
.
$
(
".wmd-preview p"
).
html
(
""
)
...
...
lms/djangoapps/teams/static/teams/js/spec/views/team_profile_spec.js
View file @
2ca355b8
...
...
@@ -21,7 +21,9 @@ define([
];
beforeEach
(
function
()
{
setFixtures
(
'<div id="page-prompt"></div><div class="teams-content"><div class="msg-content"><div class="copy"></div></div></div>'
);
setFixtures
(
'<div id="page-prompt"></div>'
+
'<div class="teams-content"><div class="msg-content"><div class="copy"></div></div></div>'
+
'<div class="profile-view"></div>'
);
DiscussionSpecHelper
.
setUnderscoreFixtures
();
});
...
...
@@ -40,6 +42,7 @@ define([
createTeamProfileView
=
function
(
requests
,
options
)
{
teamModel
=
new
TeamModel
(
createTeamModelData
(
options
),
{
parse
:
true
});
profileView
=
new
TeamProfileView
({
el
:
$
(
'.profile-view'
),
teamEvents
:
TeamSpecHelpers
.
teamEvents
,
courseID
:
TeamSpecHelpers
.
testCourseID
,
context
:
TeamSpecHelpers
.
testContext
,
...
...
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