Merge pull request #18659 from edx/ai/EDUCATOR-2588-moderator

Fix forums threads load issue in the user view.
This commit is contained in:
Attiya Ishaque
2018-07-31 21:03:31 +05:00
committed by GitHub
3 changed files with 12 additions and 1 deletions

View File

@@ -32,6 +32,9 @@
routerEvents;
// TODO: eliminate usage of global variables when possible
if (options.roles === undefined) {
options.roles = {};
}
DiscussionUtil.loadRoles(options.roles);
window.$$course_id = options.courseId;
window.courseName = options.courseName;

View File

@@ -33,6 +33,9 @@
'Community TA': []
});
if (options.roles === undefined) {
options.roles = {};
}
DiscussionUtil.loadRoles(options.roles);
window.$$course_id = options.courseId;
window.courseName = options.courseName;

View File

@@ -17,7 +17,7 @@ define(
DiscussionProfilePageFactory(_.extend(
{
courseId: testCourseId,
roles: DiscussionSpecHelper.getTestRoleInfo(),
roles: (options) ? options.roles : DiscussionSpecHelper.getTestRoleInfo(),
courseSettings: DiscussionSpecHelper.createTestCourseSettings().attributes,
el: $('.discussion-user-threads'),
discussion: new Discussion(),
@@ -40,6 +40,11 @@ define(
initializeDiscussionProfilePageFactory();
expect($('.discussion-user-threads').text()).toContain('Show');
});
it('can render itself when roles are undefined', function() {
var options = {roles: undefined};
initializeDiscussionProfilePageFactory(options);
expect($('.discussion-user-threads').text()).toContain('Show');
});
});
}
);