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
f19ad92d
Commit
f19ad92d
authored
Jun 04, 2014
by
zubair-arbi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3977 from edx/zub/bugfix/std1691-IEeditannouncement
prevent caching of GET requests for xblock student view
parents
6a893752
dbd9e56c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
12 deletions
+9
-12
cms/static/coffee/spec/views/module_edit_spec.coffee
+3
-0
cms/static/coffee/src/views/module_edit.coffee
+1
-0
cms/static/js/spec/views/pages/container_spec.js
+3
-9
cms/static/js/spec/views/unit_spec.js
+1
-3
cms/static/js/views/xblock.js
+1
-0
No files found.
cms/static/coffee/spec/views/module_edit_spec.coffee
View file @
f19ad92d
...
...
@@ -87,6 +87,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
expect
(
$
.
ajax
).
toHaveBeenCalledWith
(
url
:
"/xblock/
#{
@
moduleEdit
.
model
.
id
}
/student_view"
type
:
"GET"
cache
:
false
headers
:
Accept
:
'application/json'
success
:
jasmine
.
any
(
Function
)
...
...
@@ -107,6 +108,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
expect
(
$
.
ajax
).
not
.
toHaveBeenCalledWith
(
url
:
"/xblock/
#{
@
moduleEdit
.
model
.
id
}
/studio_view"
type
:
"GET"
cache
:
false
headers
:
Accept
:
'application/json'
success
:
jasmine
.
any
(
Function
)
...
...
@@ -131,6 +133,7 @@ define ["jquery", "js/spec_helpers/edit_helpers", "coffee/src/views/module_edit"
expect
(
$
.
ajax
).
toHaveBeenCalledWith
(
url
:
"/xblock/
#{
@
moduleEdit
.
model
.
id
}
/studio_view"
type
:
"GET"
cache
:
false
headers
:
Accept
:
'application/json'
success
:
jasmine
.
any
(
Function
)
...
...
cms/static/coffee/src/views/module_edit.coffee
View file @
f19ad92d
...
...
@@ -38,6 +38,7 @@ define ["jquery", "underscore", "gettext", "xblock/runtime.v1",
$
.
ajax
(
url
:
"
#{
decodeURIComponent
(
@
model
.
url
())
}
/
#{
viewName
}
"
type
:
'GET'
cache
:
false
headers
:
Accept
:
'application/json'
success
:
(
fragment
)
=>
...
...
cms/static/js/spec/views/pages/container_spec.js
View file @
f19ad92d
...
...
@@ -96,9 +96,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
editButtons
.
first
().
click
();
// Expect a request to be made to show the studio view for the container
expect
(
lastRequest
().
url
).
toBe
(
'/xblock/locator-container/studio_view'
);
expect
(
lastRequest
().
url
.
startsWith
(
'/xblock/locator-container/studio_view'
)).
toBeTruthy
();
create_sinon
.
respondWithJson
(
requests
,
{
html
:
mockContainerXBlockHtml
,
resources
:
[]
...
...
@@ -114,9 +112,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
expect
(
edit_helpers
.
isShowingModal
()).
toBeFalsy
();
// Expect the last request be to refresh the container page
expect
(
lastRequest
().
url
).
toBe
(
'/xblock/locator-container/container_preview'
);
expect
(
lastRequest
().
url
.
startsWith
(
'/xblock/locator-container/container_preview'
)).
toBeTruthy
();
create_sinon
.
respondWithJson
(
requests
,
{
html
:
mockUpdatedContainerXBlockHtml
,
resources
:
[]
...
...
@@ -153,9 +149,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
expect
(
editButtons
.
length
).
toBe
(
6
);
editButtons
[
0
].
click
();
// Make sure that the correct xblock is requested to be edited
expect
(
lastRequest
().
url
).
toBe
(
'/xblock/locator-component-A1/studio_view'
);
expect
(
lastRequest
().
url
.
startsWith
(
'/xblock/locator-component-A1/studio_view'
)).
toBeTruthy
();
create_sinon
.
respondWithJson
(
requests
,
{
html
:
mockXBlockEditorHtml
,
resources
:
[]
...
...
cms/static/js/spec/views/unit_spec.js
View file @
f19ad92d
...
...
@@ -204,9 +204,7 @@ define(["jquery", "underscore", "jasmine", "coffee/src/views/unit", "js/models/m
expect
(
editButtons
.
length
).
toBe
(
2
);
editButtons
[
1
].
click
();
// Make sure that the correct xblock is requested to be edited
expect
(
lastRequest
().
url
).
toBe
(
'/xblock/loc_2/studio_view'
);
expect
(
lastRequest
().
url
.
startsWith
(
'/xblock/loc_2/studio_view'
)).
toBeTruthy
();
create_sinon
.
respondWithJson
(
requests
,
{
html
:
mockXBlockEditorHtml
,
resources
:
[]
...
...
cms/static/js/views/xblock.js
View file @
f19ad92d
...
...
@@ -17,6 +17,7 @@ define(["jquery", "underscore", "js/views/baseview", "xblock/runtime.v1"],
return
$
.
ajax
({
url
:
decodeURIComponent
(
xblockUrl
)
+
"/"
+
view
,
type
:
'GET'
,
cache
:
false
,
headers
:
{
Accept
:
'application/json'
},
success
:
function
(
fragment
)
{
self
.
handleXBlockFragment
(
fragment
,
options
);
...
...
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