Skip to content
Snippets Groups Projects
Unverified Commit 6e878bf2 authored by Attiya Ishaque's avatar Attiya Ishaque Committed by GitHub
Browse files

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

Fix forums threads load issue in the user view.
parents 077b9f1a 6ada0ca7
No related branches found
Tags release-2021-02-08-04.28
No related merge requests found
......@@ -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;
......
......@@ -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;
......
......@@ -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');
});
});
}
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment