Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove old/duplicate proctoring component #671

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ Developing

If your devstack includes the default Demo course, you can visit the following URLs to see content:

- `Proctored Exam Settings <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/proctored-exam-settings>`_
- `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_

Troubleshooting
Expand Down
7 changes: 4 additions & 3 deletions src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import { Routes, Route, useParams } from 'react-router-dom';
import {
Navigate, Routes, Route, useParams,
} from 'react-router-dom';
import { PageWrap } from '@edx/frontend-platform/react';
import Placeholder from '@edx/frontend-lib-content-components';
import CourseAuthoringPage from './CourseAuthoringPage';
import { PagesAndResources } from './pages-and-resources';
import ProctoredExamSettings from './proctored-exam-settings/ProctoredExamSettings';
import EditorContainer from './editors/EditorContainer';
import VideoSelectorContainer from './selectors/VideoSelectorContainer';
import CustomPages from './custom-pages';
Expand Down Expand Up @@ -61,7 +62,7 @@ const CourseAuthoringRoutes = () => {
/>
<Route
path="proctored-exam-settings"
element={<PageWrap><ProctoredExamSettings courseId={courseId} /></PageWrap>}
element={<Navigate replace to={`/course/${courseId}/pages-and-resources`} />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a nice touch!

/>
<Route
path="custom-pages/*"
Expand Down
24 changes: 0 additions & 24 deletions src/CourseAuthoringRoutes.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import initializeStore from './store';

const courseId = 'course-v1:edX+TestX+Test_Course';
const pagesAndResourcesMockText = 'Pages And Resources';
const proctoredExamSeetingsMockText = 'Proctored Exam Settings';
const editorContainerMockText = 'Editor Container';
const videoSelectorContainerMockText = 'Video Selector Container';
const customPagesMockText = 'Custom Pages';
Expand Down Expand Up @@ -36,10 +35,6 @@ jest.mock('./pages-and-resources/PagesAndResources', () => (props) => {
mockComponentFn(props);
return pagesAndResourcesMockText;
});
jest.mock('./proctored-exam-settings/ProctoredExamSettings', () => (props) => {
mockComponentFn(props);
return proctoredExamSeetingsMockText;
});
jest.mock('./editors/EditorContainer', () => (props) => {
mockComponentFn(props);
return editorContainerMockText;
Expand Down Expand Up @@ -76,25 +71,6 @@ describe('<CourseAuthoringRoutes>', () => {
);

expect(screen.getByText(pagesAndResourcesMockText)).toBeVisible();
expect(screen.queryByText(proctoredExamSeetingsMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
}),
);
});

it('renders the ProctoredExamSettings component when the proctored exam settings route is active', () => {
render(
<AppProvider store={store} wrapWithRouter={false}>
<MemoryRouter initialEntries={['/proctored-exam-settings']}>
<CourseAuthoringRoutes />
</MemoryRouter>
</AppProvider>,
);

expect(screen.queryByText(proctoredExamSeetingsMockText)).toBeInTheDocument();
expect(screen.queryByText(pagesAndResourcesMockText)).not.toBeInTheDocument();
expect(mockComponentFn).toHaveBeenCalledWith(
expect.objectContaining({
courseId,
Expand Down
1 change: 0 additions & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@import "assets/scss/form";
@import "assets/scss/utilities";
@import "assets/scss/animations";
@import "proctored-exam-settings/proctoredExamSettings";
@import "pages-and-resources/discussions/app-list/AppList";
@import "advanced-settings/scss/AdvancedSettings";
@import "grading-settings/scss/GradingSettings";
Expand Down
2 changes: 1 addition & 1 deletion src/pages-and-resources/proctoring/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const ProctoringSettings = ({ intl, onClose }) => {
);
}

const learnMoreLink = appInfo.documentationLinks?.learnMoreConfiguration && (
const learnMoreLink = appInfo?.documentationLinks?.learnMoreConfiguration && (
<Hyperlink
className="text-primary-500"
destination={appInfo.documentationLinks.learnMoreConfiguration}
Expand Down
Loading