Hide due/release dates on course outline in Studio.
ECOM-2443
This commit is contained in:
@@ -584,6 +584,10 @@ define(['jquery', 'backbone', 'underscore', 'gettext', 'js/views/baseview',
|
||||
editors.push(VerificationAccessEditor);
|
||||
}
|
||||
}
|
||||
/* globals course */
|
||||
if (course.get('self_paced')) {
|
||||
editors = _.without(editors, ReleaseDateEditor, DueDateEditor);
|
||||
}
|
||||
return new SettingsXBlockModal($.extend({
|
||||
editors: editors,
|
||||
model: xblockInfo
|
||||
|
||||
@@ -89,6 +89,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo
|
||||
}, true);
|
||||
defaultNewChildName = childInfo.display_name;
|
||||
}
|
||||
/* globals course */
|
||||
return {
|
||||
xblockInfo: xblockInfo,
|
||||
visibilityClass: XBlockViewUtils.getXBlockVisibilityClass(xblockInfo.get('visibility_state')),
|
||||
@@ -104,7 +105,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "common/js/compo
|
||||
isCollapsed: isCollapsed,
|
||||
includesChildren: this.shouldRenderChildren(),
|
||||
hasExplicitStaffLock: this.model.get('has_explicit_staff_lock'),
|
||||
staffOnlyMessage: this.model.get('staff_only_message')
|
||||
staffOnlyMessage: this.model.get('staff_only_message'),
|
||||
course: course
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ import json
|
||||
org: "${context_course.location.org | h}",
|
||||
num: "${context_course.location.course | h}",
|
||||
display_course_number: "${_(context_course.display_coursenumber)}",
|
||||
revision: "${context_course.location.revision | h}"
|
||||
revision: "${context_course.location.revision | h}",
|
||||
self_paced: ${json.dumps(context_course.self_paced)}
|
||||
});
|
||||
});
|
||||
% endif
|
||||
|
||||
@@ -113,18 +113,20 @@ if (xblockInfo.get('graded')) {
|
||||
<p>
|
||||
<span class="sr status-release-label"><%= gettext('Release Status:') %></span>
|
||||
<span class="status-release-value">
|
||||
<% if (xblockInfo.get('released_to_students')) { %>
|
||||
<i class="icon fa fa-check-square-o"></i>
|
||||
<%= gettext('Released:') %>
|
||||
<% } else if (xblockInfo.get('release_date')) { %>
|
||||
<i class="icon fa fa-clock-o"></i>
|
||||
<%= gettext('Scheduled:') %>
|
||||
<% } else { %>
|
||||
<i class="icon fa fa-clock-o"></i>
|
||||
<%= gettext('Unscheduled') %>
|
||||
<% } %>
|
||||
<% if (xblockInfo.get('release_date')) { %>
|
||||
<%= xblockInfo.get('release_date') %>
|
||||
<% if (!course.get('self_paced')) { %>
|
||||
<% if (xblockInfo.get('released_to_students')) { %>
|
||||
<i class="icon fa fa-check-square-o"></i>
|
||||
<%= gettext('Released:') %>
|
||||
<% } else if (xblockInfo.get('release_date')) { %>
|
||||
<i class="icon fa fa-clock-o"></i>
|
||||
<%= gettext('Scheduled:') %>
|
||||
<% } else { %>
|
||||
<i class="icon fa fa-clock-o"></i>
|
||||
<%= gettext('Unscheduled') %>
|
||||
<% } %>
|
||||
<% if (xblockInfo.get('release_date')) { %>
|
||||
<%= xblockInfo.get('release_date') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
@@ -1752,3 +1752,53 @@ class DeprecationWarningMessageTest(CourseOutlineTest):
|
||||
components_present=True,
|
||||
components_display_name_list=['Open', 'Peer']
|
||||
)
|
||||
|
||||
|
||||
class SelfPacedOutlineTest(CourseOutlineTest):
|
||||
"""Test the course outline for a self-paced course."""
|
||||
|
||||
def populate_course_fixture(self, course_fixture):
|
||||
course_fixture.add_children(
|
||||
XBlockFixtureDesc('chapter', SECTION_NAME).add_children(
|
||||
XBlockFixtureDesc('sequential', SUBSECTION_NAME).add_children(
|
||||
XBlockFixtureDesc('vertical', UNIT_NAME)
|
||||
)
|
||||
),
|
||||
)
|
||||
self.course_fixture.add_course_details({'self_paced': True})
|
||||
|
||||
def test_release_dates_not_shown(self):
|
||||
"""
|
||||
Scenario: Ensure that block release dates are not shown on the
|
||||
course outline page of a self-paced course.
|
||||
|
||||
Given I am the author of a self-paced course
|
||||
When I go to the course outline
|
||||
Then I should not see release dates for course content
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
section = self.course_outline_page.section(SECTION_NAME)
|
||||
self.assertEqual(section.release_date, '')
|
||||
subsection = section.subsection(SUBSECTION_NAME)
|
||||
self.assertEqual(subsection.release_date, '')
|
||||
|
||||
def test_edit_section_and_subsection(self):
|
||||
"""
|
||||
Scenario: Ensure that block release/due dates are not shown
|
||||
in their settings modals.
|
||||
|
||||
Given I am the author of a self-paced course
|
||||
When I go to the course outline
|
||||
And I click on settings for a section or subsection
|
||||
Then I should not see release or due date settings
|
||||
"""
|
||||
self.course_outline_page.visit()
|
||||
section = self.course_outline_page.section(SECTION_NAME)
|
||||
modal = section.edit()
|
||||
self.assertFalse(modal.has_release_date())
|
||||
self.assertFalse(modal.has_due_date())
|
||||
modal.cancel()
|
||||
subsection = section.subsection(SUBSECTION_NAME)
|
||||
modal = subsection.edit()
|
||||
self.assertFalse(modal.has_release_date())
|
||||
self.assertFalse(modal.has_due_date())
|
||||
|
||||
Reference in New Issue
Block a user