Skip to content

Commit

Permalink
fix(lint): lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Nov 24, 2023
1 parent 22ded92 commit 2b97b22
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 59 deletions.
27 changes: 13 additions & 14 deletions src/course-outline/CourseOutline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,21 @@ const CourseOutline = ({ courseId }) => {
/>
<div className="pt-4">
{sectionsList.length ? (
<React.Fragment>
<>
{sectionsList.map((section) => (
<SectionCard
key={section.id}
section={section}
savingStatus={savingStatus}
onOpenHighlightsModal={handleOpenHighlightsModal}
onOpenPublishModal={openPublishModal}
onOpenDeleteModal={openDeleteModal}
onEditSectionSubmit={handleEditSectionSubmit}
onDuplicateSubmit={handleDuplicateSectionSubmit}
isSectionsExpanded={isSectionsExpanded}
/>
<SectionCard
key={section.id}
section={section}
savingStatus={savingStatus}
onOpenHighlightsModal={handleOpenHighlightsModal}
onOpenPublishModal={openPublishModal}
onOpenDeleteModal={openDeleteModal}
onEditSectionSubmit={handleEditSectionSubmit}
onDuplicateSubmit={handleDuplicateSectionSubmit}
isSectionsExpanded={isSectionsExpanded}
/>
))}
<Button
key="dummy-random"
data-testid="new-section-button"
className="mt-4"
variant="outline-primary"
Expand All @@ -160,7 +159,7 @@ const CourseOutline = ({ courseId }) => {
>
{intl.formatMessage(messages.newSectionButton)}
</Button>
</React.Fragment>
</>
) : (
<EmptyPlaceholder onCreateNewSection={handleNewSectionSubmit} />
)}
Expand Down
4 changes: 2 additions & 2 deletions src/course-outline/CourseOutline.test.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('<CourseOutline />', () => {
axiosMock
.onPost(getXBlockBaseApiUrl())
.reply(200, {
"locator": courseSectionMock.id,
locator: courseSectionMock.id,
});
axiosMock
.onGet(getXBlockApiUrl(courseSectionMock.id))
Expand Down
78 changes: 39 additions & 39 deletions src/course-outline/__mocks__/courseSection.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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: '',
},
};
2 changes: 1 addition & 1 deletion src/course-outline/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const CHECKLIST_FILTERS = {
export const DEFAULT_NEW_DISPLAY_NAMES = {
chapter: 'Section',
subsection: 'Subsection',
}
};

export const LAUNCH_CHECKLIST = {
data: [
Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/data/slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const slice = createSlice({
state.sectionsList = [
...state.sectionsList,
payload,
]
];
},
deleteSection: (state, { payload }) => {
state.sectionsList = state.sectionsList.filter(({ id }) => id !== payload);
Expand Down
2 changes: 1 addition & 1 deletion src/course-outline/data/thunk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
1 change: 1 addition & 0 deletions src/course-outline/section-card/SectionCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/generic/processing-notification/data/slice.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 2b97b22

Please sign in to comment.