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
e4635aaa
Commit
e4635aaa
authored
Aug 05, 2014
by
Ben McMorran
Committed by
cahrens
Aug 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't release date if it hasn't been changed.
STUD-2056
parent
391ab846
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
+37
-1
cms/static/js/views/modals/edit_outline_item.js
+13
-1
common/test/acceptance/tests/test_studio_outline.py
+24
-0
No files found.
cms/static/js/views/modals/edit_outline_item.js
View file @
e4635aaa
...
...
@@ -184,6 +184,14 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/modals/base_mod
ReleaseDateView
=
BaseDateView
.
extend
({
fieldName
:
'start'
,
startingReleaseDate
:
null
,
afterRender
:
function
()
{
BaseDateView
.
prototype
.
afterRender
.
call
(
this
);
// Store the starting date and time so that we can determine if the user
// actually changed it when "Save" is pressed.
this
.
startingReleaseDate
=
this
.
getValue
();
},
getValue
:
function
()
{
return
DateUtils
.
getDate
(
this
.
$
(
'#start_date'
),
this
.
$
(
'#start_time'
));
...
...
@@ -195,8 +203,12 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/modals/base_mod
},
getMetadata
:
function
()
{
var
newReleaseDate
=
this
.
getValue
();
if
(
JSON
.
stringify
(
newReleaseDate
)
===
JSON
.
stringify
(
this
.
startingReleaseDate
))
{
return
{};
}
return
{
'start'
:
this
.
getValue
()
'start'
:
newReleaseDate
};
}
});
...
...
common/test/acceptance/tests/test_studio_outline.py
View file @
e4635aaa
...
...
@@ -375,6 +375,30 @@ class EditingSectionsTest(CourseOutlineTest):
self
.
assertEqual
(
u'Problem'
,
progress_page
.
grading_formats
[
0
])
def
test_unchanged_release_date_is_not_saved
(
self
):
"""
Scenario: Saving a subsection without changing the release date will not override the release date
Given that I have created a section with a subsection
When I open the settings modal for the subsection
And I pressed save
And I open the settings modal for the section
And I change the release date to 07/20/1969
And I press save
Then the subsection and the section have the release date 07/20/1969
"""
self
.
course_outline_page
.
visit
()
modal
=
self
.
course_outline_page
.
section_at
(
0
)
.
subsection_at
(
0
)
.
edit
()
modal
.
save
()
modal
=
self
.
course_outline_page
.
section_at
(
0
)
.
edit
()
modal
.
release_date
=
'7/20/1969'
modal
.
save
()
release_text
=
'Released: Jul 20, 1969'
self
.
assertIn
(
release_text
,
self
.
course_outline_page
.
section_at
(
0
)
.
release_date
)
self
.
assertIn
(
release_text
,
self
.
course_outline_page
.
section_at
(
0
)
.
subsection_at
(
0
)
.
release_date
)
class
EditNamesTest
(
CourseOutlineTest
):
"""
...
...
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