Skip to content

Commit e5e73e4

Browse files
authored
feat: update discussion sidebar url to allow grouping by subsection (#968)
To enable grouping by subsection in the discussions MFE, this PR updates the embed URL to the one that supports grouping. ref: openedx/frontend-app-discussions#281
1 parent 1892eda commit e5e73e4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/courseware/course/sidebar/sidebars/discussions/DiscussionsSidebar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function DiscussionsSidebar({ intl }) {
1919
if (!topic?.id) {
2020
return null;
2121
}
22-
const discussionsUrl = `${getConfig().DISCUSSIONS_MFE_BASE_URL}/${courseId}/topics/${topic.id}`;
22+
const discussionsUrl = `${getConfig().DISCUSSIONS_MFE_BASE_URL}/${courseId}/category/${unitId}`;
2323
return (
2424
<SidebarBase
2525
title={intl.formatMessage(messages.discussionsTitle)}

src/courseware/course/sidebar/sidebars/discussions/DiscussionsSidebar.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Discussions Trigger', () => {
5959
renderWithProvider();
6060
expect(screen.queryByTitle('Discussions')).toBeInTheDocument();
6161
expect(screen.queryByTitle('Discussions'))
62-
.toHaveAttribute('src', `http://localhost:2002/${courseId}/topics/topic-1?inContext`);
62+
.toHaveAttribute('src', `http://localhost:2002/${courseId}/category/${unitId}?inContext`);
6363
});
6464

6565
it('should show nothing if unit has no discussions associated with it', async () => {

0 commit comments

Comments
 (0)