Merge pull request #9804 from edx/asadiqbal08/SOL-1224
SOL-1224 Verified Preview not showing
This commit is contained in:
@@ -354,7 +354,9 @@ def certificates_list_handler(request, course_key_string):
|
||||
handler_name='certificates.certificate_activation_handler',
|
||||
course_key=course_key
|
||||
)
|
||||
course_modes = [mode.slug for mode in CourseMode.modes_for_course(course.id)]
|
||||
course_modes = [mode.slug for mode in CourseMode.modes_for_course(
|
||||
course_id=course.id, include_expired=True
|
||||
)]
|
||||
certificate_web_view_url = get_lms_link_for_certificate_web_view(
|
||||
user_id=request.user.id,
|
||||
course_key=course_key,
|
||||
|
||||
@@ -49,7 +49,7 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
|
||||
appendSetFixtures('<div class="preview-certificate nav-actions"></div>');
|
||||
this.view = new CertificatePreview({
|
||||
el: $('.preview-certificate'),
|
||||
course_modes: ['test1', 'test2', 'test3'],
|
||||
course_modes: ['test1', 'test2', 'test3', 'audit'],
|
||||
certificate_web_view_url: '/users/1/courses/orgX/009/2016?preview=test1',
|
||||
certificate_activation_handler_url: '/certificates/activation/'+ window.course.id,
|
||||
is_active: true
|
||||
@@ -59,6 +59,10 @@ function(_, $, Course, CertificatePreview, TemplateHelpers, ViewHelpers, AjaxHel
|
||||
|
||||
describe('Certificate preview', function() {
|
||||
|
||||
it('course mode "audit" should not be render in preview list', function () {
|
||||
expect(this.view.course_modes.indexOf('audit') < 0).toBe(true);
|
||||
});
|
||||
|
||||
it('course mode event should call when user choose a new mode', function () {
|
||||
spyOn(this.view, 'courseModeChanged');
|
||||
this.view.delegateEvents();
|
||||
|
||||
@@ -27,6 +27,8 @@ function(_, gettext, BaseView, ViewUtils, NotificationView) {
|
||||
},
|
||||
|
||||
render: function () {
|
||||
// removing the course mode 'audit' from the preview list.
|
||||
this.course_modes = _.without(this.course_modes, 'audit');
|
||||
this.$el.html(this.template({
|
||||
course_modes: this.course_modes,
|
||||
certificate_web_view_url: this.certificate_web_view_url,
|
||||
|
||||
Reference in New Issue
Block a user