diff --git a/src/CourseAuthoringRoutes.jsx b/src/CourseAuthoringRoutes.jsx index e6f675a267..6ff7f475bd 100644 --- a/src/CourseAuthoringRoutes.jsx +++ b/src/CourseAuthoringRoutes.jsx @@ -42,7 +42,7 @@ const CourseAuthoringRoutes = () => { } /> { return ( <> - +
{showSuccessAlert ? ( @@ -71,7 +71,6 @@ const CourseOutline = ({ courseId }) => { className="mt-5" title={intl.formatMessage(messages.headingTitle)} subtitle={intl.formatMessage(messages.headingSubtitle)} - withSubHeaderContent={false} headerActions={( { @@ -94,7 +93,7 @@ const CourseOutline = ({ courseId }) => {
diff --git a/src/course-outline/CourseOutline.scss b/src/course-outline/CourseOutline.scss index 516e4b7d39..732420365c 100644 --- a/src/course-outline/CourseOutline.scss +++ b/src/course-outline/CourseOutline.scss @@ -1,3 +1,2 @@ @import "./header-navigations/HeaderNavigations"; -@import "./outline-sidebar/OulineSidebar"; @import "./status-bar/StatusBar"; diff --git a/src/course-outline/CourseOutline.test.jsx b/src/course-outline/CourseOutline.test.jsx index 4087cfeee7..b6d98bc470 100644 --- a/src/course-outline/CourseOutline.test.jsx +++ b/src/course-outline/CourseOutline.test.jsx @@ -1,7 +1,5 @@ import React from 'react'; -import { - render, waitFor, cleanup, -} from '@testing-library/react'; +import { render, waitFor } from '@testing-library/react'; import { IntlProvider } from '@edx/frontend-platform/i18n'; import { AppProvider } from '@edx/frontend-platform/react'; import { initializeMockApp } from '@edx/frontend-platform'; @@ -127,9 +125,8 @@ describe('', () => { expect(getByText('4/9 completed')).toBeInTheDocument(); }); - it('check enable highlights when enable highlights query is successfully', async () => { - cleanup(); - const { getByText } = render(); + it('check highlights are enabled after enable highlights query is successful', async () => { + const { findByTestId } = render(); axiosMock .onGet(getCourseOutlineIndexApiUrl(courseId)) @@ -148,6 +145,6 @@ describe('', () => { .reply(200); await executeThunk(enableCourseHighlightsEmailsQuery(courseId), store.dispatch); - expect(getByText('Enabled')).toBeInTheDocument(); + expect(await findByTestId('highlights-enabled-span')).toBeInTheDocument(); }); }); diff --git a/src/course-outline/data/api.js b/src/course-outline/data/api.js index dbc68e8cb9..9b613bf81c 100644 --- a/src/course-outline/data/api.js +++ b/src/course-outline/data/api.js @@ -2,22 +2,27 @@ import { camelCaseObject, getConfig } from '@edx/frontend-platform'; import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth'; const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL; + export const getCourseOutlineIndexApiUrl = (courseId) => `${getApiBaseUrl()}/api/contentstore/v1/course_index/${courseId}`; + export const getCourseBestPracticesApiUrl = ({ courseId, excludeGraded, all, }) => `${getApiBaseUrl()}/api/courses/v1/quality/${courseId}/?exclude_graded=${excludeGraded}&all=${all}`; + export const getCourseLaunchApiUrl = ({ courseId, gradedOnly, validateOras, all, }) => `${getApiBaseUrl()}/api/courses/v1/validation/${courseId}/?graded_only=${gradedOnly}&validate_oras=${validateOras}&all=${all}`; + export const getEnableHighlightsEmailsApiUrl = (courseId) => { const formattedCourseId = courseId.split('course-v1:')[1]; return `${getApiBaseUrl()}/xblock/block-v1:${formattedCourseId}+type@course+block@course`; }; + export const getCourseReindexApiUrl = (reindexLink) => `${getApiBaseUrl()}${reindexLink}`; /** diff --git a/src/course-outline/enable-highlights-modal/messages.js b/src/course-outline/enable-highlights-modal/messages.js index 8a3842ff04..dbad07e941 100644 --- a/src/course-outline/enable-highlights-modal/messages.js +++ b/src/course-outline/enable-highlights-modal/messages.js @@ -19,7 +19,7 @@ const messages = defineMessages({ }, cancelButton: { id: 'course-authoring.course-outline.status-bar.modal.cancelButton', - defaultMessage: 'Not yet', + defaultMessage: 'Cancel', }, submitButton: { id: 'course-authoring.course-outline.status-bar.modal.submitButton', diff --git a/src/course-outline/header-navigations/HeaderNavigations.jsx b/src/course-outline/header-navigations/HeaderNavigations.jsx index 897cebf8df..57cdd693e2 100644 --- a/src/course-outline/header-navigations/HeaderNavigations.jsx +++ b/src/course-outline/header-navigations/HeaderNavigations.jsx @@ -5,6 +5,7 @@ import { Button, OverlayTrigger, Tooltip } from '@edx/paragon'; import { Add as IconAdd, ArrowDropDown as ArrowDownIcon, + ArrowDropUp as ArrowUpIcon, } from '@edx/paragon/icons'; import messages from './messages'; @@ -17,7 +18,7 @@ const HeaderNavigations = ({ }) => { const intl = useIntl(); const { - handleNewSection, handleReIndex, handleExpandAll, handleViewLive, + handleNewSection, handleReIndex, handleExpandAll, lmsLink, } = headerNavigationsActions; return ( @@ -57,8 +58,7 @@ const HeaderNavigations = ({ )}