Skip to content

Commit 5881cb7

Browse files
committed
fix: lint issues
1 parent 235e8c2 commit 5881cb7

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/course-outline/OutlineNode.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export interface OutlineNodeProps {
9797
isCustomRelativeDatesActive: boolean;
9898
isSectionsExpanded: boolean;
9999
getPossibleMoves?: (index: number, step: number) => MoveDetails | null;
100-
onOrderChange: (parentBlock: XBlock, moveDetails: MoveDetails | { oldIndex: number; newIndex: number } | null) => void;
100+
onOrderChange: (
101+
parentBlock: XBlock,
102+
moveDetails: MoveDetails | { oldIndex: number; newIndex: number; } | null,
103+
) => void;
101104
onOpenConfigureModal: (selection: OutlineActionSelection) => void;
102105
onOpenDeleteModal: (selection: OutlineActionSelection) => void;
103106
onOpenHighlightsModal?: (section: XBlock) => void;
@@ -340,10 +343,12 @@ const OutlineNode = ({
340343
undefined;
341344

342345
// Node is droppable when it can be a same-level reorder target or can accept children
343-
const isDroppable = Boolean(actions.draggable
344-
|| actions.childAddable
345-
|| (depth === 1 && parentSection?.actions?.childAddable)
346-
|| (depth === 2 && parentSubsection?.actions?.childAddable));
346+
const isDroppable = Boolean(
347+
actions.draggable
348+
|| actions.childAddable
349+
|| (depth === 1 && parentSection?.actions?.childAddable)
350+
|| (depth === 2 && parentSubsection?.actions?.childAddable),
351+
);
347352

348353
const showPaste = depth === 1 && blk.enableCopyPasteUnits && showPasteUnit && sharedClipboardData;
349354

src/course-outline/OutlineTree.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ const OutlineTree = ({
8484
await commitSectionReorder(sectionListIds);
8585
}, [sections, previewSections, commitSectionReorder]);
8686

87-
const handleSubsectionOrderChange = useCallback(async (section: XBlock, moveDetails: SubsectionMoveDetails | null) => {
88-
applyReorderMove(moveDetails, section, previewSections, commitSubsectionReorder);
89-
}, [previewSections, commitSubsectionReorder]);
87+
const handleSubsectionOrderChange = useCallback(
88+
async (section: XBlock, moveDetails: SubsectionMoveDetails | null) => {
89+
applyReorderMove(moveDetails, section, previewSections, commitSubsectionReorder);
90+
},
91+
[previewSections, commitSubsectionReorder],
92+
);
9093

9194
const handleUnitOrderChange = useCallback(async (section: XBlock, moveDetails: UnitMoveDetails | null) => {
9295
applyReorderMove(moveDetails, section, previewSections, commitUnitReorder);
@@ -116,7 +119,7 @@ const OutlineTree = ({
116119
);
117120

118121
const orderHandler = depth === 0
119-
? (_blk: XBlock, d: { oldIndex: number; newIndex: number }) => handleSectionOrderChange(d.oldIndex, d.newIndex)
122+
? (_blk: XBlock, d: { oldIndex: number; newIndex: number; }) => handleSectionOrderChange(d.oldIndex, d.newIndex)
120123
: depth === 1 ?
121124
handleSubsectionOrderChange
122125
: handleUnitOrderChange;

src/course-outline/drag-helper/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const possibleSubsectionMoves = (
194194
sectionIndex: number,
195195
section: XBlock,
196196
subsections: XBlock[],
197-
): ((index: number, step: number) => SubsectionMoveDetails | null) =>
197+
): (index: number, step: number) => SubsectionMoveDetails | null =>
198198
(index: number, step: number) => {
199199
if (!subsections[index]?.actions?.draggable) {
200200
return null;
@@ -428,7 +428,7 @@ export const possibleUnitMoves = (
428428
section: XBlock,
429429
subsection: XBlock,
430430
units: XBlock[],
431-
): ((index: number, step: number) => UnitMoveDetails | null) =>
431+
): (index: number, step: number) => UnitMoveDetails | null =>
432432
(index: number, step: number) => {
433433
// Early return if unit is not draggable
434434
if (!units[index]?.actions?.draggable) {

src/course-outline/outline-sidebar/info-sidebar/UnitInfoSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const UnitSidebar = () => {
291291
courseId={courseId}
292292
blockId={unitId}
293293
isUnitVerticalType={false}
294-
unitXBlockActions={{ handleDelete: () => { }, handleDuplicate: () => { }, handleUnlink: () => { } }}
294+
unitXBlockActions={{ handleDelete: () => {}, handleDuplicate: () => {}, handleUnlink: () => {} }}
295295
courseVerticalChildren={[]}
296296
readonly
297297
/>

0 commit comments

Comments
 (0)