diff --git a/src/course-outline/CourseOutline.jsx b/src/course-outline/CourseOutline.jsx index e20ee6ec26..c9ec8acf89 100644 --- a/src/course-outline/CourseOutline.jsx +++ b/src/course-outline/CourseOutline.jsx @@ -135,22 +135,21 @@ const CourseOutline = ({ courseId }) => { />
{sectionsList.length ? ( - + <> {sectionsList.map((section) => ( - + ))} - + ) : ( )} diff --git a/src/course-outline/CourseOutline.test.jsx b/src/course-outline/CourseOutline.test.jsx index 8b33744eb1..294f2a48b4 100644 --- a/src/course-outline/CourseOutline.test.jsx +++ b/src/course-outline/CourseOutline.test.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { - render, waitFor, cleanup, fireEvent + render, waitFor, cleanup, fireEvent, } from '@testing-library/react'; import { IntlProvider } from '@edx/frontend-platform/i18n'; import { AppProvider } from '@edx/frontend-platform/react'; @@ -121,7 +121,7 @@ describe('', () => { axiosMock .onPost(getXBlockBaseApiUrl()) .reply(200, { - "locator": courseSectionMock.id, + locator: courseSectionMock.id, }); axiosMock .onGet(getXBlockApiUrl(courseSectionMock.id)) diff --git a/src/course-outline/__mocks__/courseSection.js b/src/course-outline/__mocks__/courseSection.js index f7d372d52b..2e4e6f8de9 100644 --- a/src/course-outline/__mocks__/courseSection.js +++ b/src/course-outline/__mocks__/courseSection.js @@ -1,65 +1,65 @@ module.exports = { - id: "block-v1:edX+DemoX+Demo_Course+type@chapter+block@d0e78d363a424da6be5c22704c34f7a7", - display_name: "Section", - category: "chapter", + id: 'block-v1:edX+DemoX+Demo_Course+type@chapter+block@d0e78d363a424da6be5c22704c34f7a7', + display_name: 'Section', + category: 'chapter', has_children: true, - edited_on: "Nov 22, 2023 at 07:45 UTC", + edited_on: 'Nov 22, 2023 at 07:45 UTC', published: true, - published_on: "Nov 22, 2023 at 07:45 UTC", - studio_url: "/course/course-v1:edX+DemoX+Demo_Course?show=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40chapter%2Bblock%40d0e78d363a424da6be5c22704c34f7a7", + published_on: 'Nov 22, 2023 at 07:45 UTC', + studio_url: '/course/course-v1:edX+DemoX+Demo_Course?show=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40chapter%2Bblock%40d0e78d363a424da6be5c22704c34f7a7', released_to_students: true, - release_date: "Feb 05, 2013 at 05:00 UTC", - visibility_state: "live", + release_date: 'Feb 05, 2013 at 05:00 UTC', + visibility_state: 'live', has_explicit_staff_lock: false, - start: "2013-02-05T05:00:00Z", + start: '2013-02-05T05:00:00Z', graded: false, - due_date: "", + due_date: '', due: null, relative_weeks_due: null, format: null, course_graders: [ - "Homework", - "Exam" + 'Homework', + 'Exam', ], has_changes: false, actions: { deletable: true, draggable: true, childAddable: true, - duplicable: true + duplicable: true, }, explanatory_message: null, group_access: {}, user_partitions: [ { id: 50, - name: "Enrollment Track Groups", - scheme: "enrollment_track", + name: 'Enrollment Track Groups', + scheme: 'enrollment_track', groups: [ { id: 2, - name: "Verified Certificate", + name: 'Verified Certificate', selected: false, - deleted: false + deleted: false, }, { id: 1, - name: "Audit", + name: 'Audit', selected: false, - deleted: false - } - ] - } + deleted: false, + }, + ], + }, ], - show_correctness: "always", + show_correctness: 'always', highlights: [], highlights_enabled: true, highlights_preview_only: false, - highlights_doc_url: "http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/developing_course/course_sections.html#set-section-highlights-for-weekly-course-highlight-messages", + highlights_doc_url: 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/developing_course/course_sections.html#set-section-highlights-for-weekly-course-highlight-messages', child_info: { - category: "sequential", - display_name: "Subsection", - children: [] + category: 'sequential', + display_name: 'Subsection', + children: [], }, ancestor_has_staff_lock: false, staff_only_message: false, @@ -69,25 +69,25 @@ module.exports = { selectable_partitions: [ { id: 50, - name: "Enrollment Track Groups", - scheme: "enrollment_track", + name: 'Enrollment Track Groups', + scheme: 'enrollment_track', groups: [ { id: 2, - name: "Verified Certificate", + name: 'Verified Certificate', selected: false, - deleted: false + deleted: false, }, { id: 1, - name: "Audit", + name: 'Audit', selected: false, - deleted: false - } - ] - } + deleted: false, + }, + ], + }, ], selected_partition_index: -1, - selected_groups_label: "" - } -} + selected_groups_label: '', + }, +}; diff --git a/src/course-outline/constants.js b/src/course-outline/constants.js index 46bd73b5b9..2cac13392a 100644 --- a/src/course-outline/constants.js +++ b/src/course-outline/constants.js @@ -18,7 +18,7 @@ export const CHECKLIST_FILTERS = { export const DEFAULT_NEW_DISPLAY_NAMES = { chapter: 'Section', subsection: 'Subsection', -} +}; export const LAUNCH_CHECKLIST = { data: [ diff --git a/src/course-outline/data/slice.js b/src/course-outline/data/slice.js index 33d9adc0be..79e227b6e6 100644 --- a/src/course-outline/data/slice.js +++ b/src/course-outline/data/slice.js @@ -78,7 +78,7 @@ const slice = createSlice({ state.sectionsList = [ ...state.sectionsList, payload, - ] + ]; }, deleteSection: (state, { payload }) => { state.sectionsList = state.sectionsList.filter(({ id }) => id !== payload); diff --git a/src/course-outline/data/thunk.js b/src/course-outline/data/thunk.js index 0ad0c99b5e..72d5eedede 100644 --- a/src/course-outline/data/thunk.js +++ b/src/course-outline/data/thunk.js @@ -248,7 +248,7 @@ export function addNewCourseSectionQuery(courseBlockId) { ).then(async (result) => { if (result) { const data = await getCourseSection(result.locator); - dispatch(addSection(data)) + dispatch(addSection(data)); dispatch(updateSavingStatus({ status: RequestStatus.SUCCESSFUL })); dispatch(hideProcessingNotification()); } diff --git a/src/course-outline/section-card/SectionCard.jsx b/src/course-outline/section-card/SectionCard.jsx index 1410b7454c..1a8e349392 100644 --- a/src/course-outline/section-card/SectionCard.jsx +++ b/src/course-outline/section-card/SectionCard.jsx @@ -139,6 +139,7 @@ SectionCard.propTypes = { id: PropTypes.string.isRequired, displayName: PropTypes.string.isRequired, published: PropTypes.bool.isRequired, + hasChanges: PropTypes.bool.isRequired, releasedToStudents: PropTypes.bool.isRequired, visibleToStaffOnly: PropTypes.bool, visibilityState: PropTypes.string.isRequired, diff --git a/src/generic/processing-notification/data/slice.js b/src/generic/processing-notification/data/slice.js index 4dbbd802ec..03e4e243f8 100644 --- a/src/generic/processing-notification/data/slice.js +++ b/src/generic/processing-notification/data/slice.js @@ -1,7 +1,7 @@ /* eslint-disable no-param-reassign */ import { createSlice } from '@reduxjs/toolkit'; -import { NOTIFICATION_MESSAGES } from '../../../constants' +import { NOTIFICATION_MESSAGES } from '../../../constants'; const initialState = { isShow: false,