Skip to content

Commit

Permalink
feat: add report button component
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-canon committed Nov 25, 2024
1 parent 3698770 commit 3cc8d18
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/courseware/course/sequence/Sequence.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { useIntl } from '@edx/frontend-platform/i18n';
import { useSelector } from 'react-redux';
import SequenceExamWrapper from '@edx/frontend-lib-special-exams';
import { LikeDislikeUnit } from '@edunext/frontend-essentials';
import { ReportButton, LikeDislikeUnit } from '@edunext/frontend-essentials';

import PageLoading from '@src/generic/PageLoading';
import { useModel } from '@src/generic/model-store';
Expand Down Expand Up @@ -151,6 +151,7 @@ const Sequence = ({
<>
<div className="nelp-container">
<LikeDislikeUnit courseId={courseId} unitId={unitId} />
<ReportButton courseId={courseId} unitId={unitId} />
</div>

<UnitNavigation
Expand Down
5 changes: 5 additions & 0 deletions src/courseware/course/sequence/Sequence.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.nelp-container {
display: flex;
text-align: center;
justify-content: center;
}
4 changes: 2 additions & 2 deletions src/courseware/course/sequence/Sequence.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Sequence', () => {

await waitFor(() => expect(screen.queryByText('Loading locked content messaging...')).toBeInTheDocument());
// `Previous`, `Prerequisite` and `Close Tray` buttons.
expect(screen.getAllByRole('button').length).toEqual(5); // two more buttons like and dislike
expect(screen.getAllByRole('button').length).toEqual(6); // three more buttons like, dislike and report
// `Next` button.
expect(screen.getAllByRole('link').length).toEqual(1);

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('Sequence', () => {
render(<SidebarWrapper />, { wrapWithRouter: true });
expect(await screen.findByText('Loading learning sequence...')).toBeInTheDocument();
// `Previous`, `Prerequisite` and `Close Tray` buttons.
expect(screen.getAllByRole('button')).toHaveLength(5); // two more buttons like and dislike
expect(screen.getAllByRole('button')).toHaveLength(6); // three more buttons like, dislike and report
// Renders `Next` button.
expect(screen.getAllByRole('link')).toHaveLength(1);

Expand Down
3 changes: 2 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -446,4 +446,5 @@
@import "course-home/courseware-search/courseware-search.scss";
@import "course-tabs/course-tabs-navigation.scss";
@import "courseware/course/sidebar/common/SidebarBase.scss";
@import "courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.scss";
@import "courseware/course/sidebar/sidebars/course-outline/CourseOutlineTray.scss";
@import "courseware/course/sequence/Sequence.scss";

0 comments on commit 3cc8d18

Please sign in to comment.