From f1ad4a0d21815aaa1423a6110759bb0ddaabae87 Mon Sep 17 00:00:00 2001 From: Khadim Date: Thu, 14 Sep 2023 15:02:16 +0200 Subject: [PATCH] fix linteer --- web/ts/api/admin-lecture-list.ts | 4 ++-- web/ts/edit-course.ts | 22 +++++++++++----------- web/ts/entry/admins.ts | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/ts/api/admin-lecture-list.ts b/web/ts/api/admin-lecture-list.ts index 4bbfb169a..9ef78740d 100644 --- a/web/ts/api/admin-lecture-list.ts +++ b/web/ts/api/admin-lecture-list.ts @@ -92,11 +92,11 @@ export type VideoSection = { fileID?: number; }; -export function videoSectionTimestamp(a: VideoSection) : number { +export function videoSectionTimestamp(a: VideoSection): number { return a.startHours * 3600 + a.startMinutes * 60 + a.startSeconds; } -export function videoSectionSort(a: VideoSection, b: VideoSection) : number { +export function videoSectionSort(a: VideoSection, b: VideoSection): number { return videoSectionTimestamp(a) - videoSectionTimestamp(b); } diff --git a/web/ts/edit-course.ts b/web/ts/edit-course.ts index ec9ab31ad..e71b44053 100644 --- a/web/ts/edit-course.ts +++ b/web/ts/edit-course.ts @@ -8,9 +8,11 @@ import { LectureVideoTypeCam, LectureVideoTypeComb, LectureVideoTypePres, - LectureVideoTypes, VideoSection, videoSectionSort, + LectureVideoTypes, + VideoSection, + videoSectionSort, } from "./api/admin-lecture-list"; -import {ChangeSet, comparatorPipeline, ignoreKeys, singleProperty} from "./change-set"; +import { ChangeSet, comparatorPipeline, ignoreKeys, singleProperty } from "./change-set"; import { AlpineComponent } from "./components/alpine-component"; export enum UIEditMode { @@ -116,11 +118,11 @@ export function lectureEditor(lecture: Lecture): AlpineComponent { init() { const customComparator = comparatorPipeline([ ignoreKeys(["files"]), - singleProperty("videoSections", (a: Lecture, b: Lecture): boolean|null => { + singleProperty("videoSections", (a: Lecture, b: Lecture): boolean | null => { if (a.videoSections.length !== b.videoSections.length) { return true; } - if (a.videoSections.some(({ id }) => !b.videoSections.some(({id: bId}) => id === bId))) { + if (a.videoSections.some(({ id }) => !b.videoSections.some(({ id: bId }) => id === bId))) { return true; } }), @@ -204,16 +206,14 @@ export function lectureEditor(lecture: Lecture): AlpineComponent { }, addSection(section: VideoSection) { - this.changeSet.patch("videoSections", [ - ...this.lectureData.videoSections, - section, - ].sort(videoSectionSort)); + this.changeSet.patch("videoSections", [...this.lectureData.videoSections, section].sort(videoSectionSort)); }, deleteSection(id: number) { - this.changeSet.patch("videoSections", this.lectureData.videoSections.filter( - (s) => s.id !== id, - )); + this.changeSet.patch( + "videoSections", + this.lectureData.videoSections.filter((s) => s.id !== id), + ); }, isValidVideoSection(section: VideoSection): boolean { diff --git a/web/ts/entry/admins.ts b/web/ts/entry/admins.ts index ae5dbcc20..58e9df699 100644 --- a/web/ts/entry/admins.ts +++ b/web/ts/entry/admins.ts @@ -13,5 +13,5 @@ export * from "../courseAdminManagement"; export * from "../notification-management"; export * from "../audits"; export * from "../maintenance"; -export * from "../change-set" +export * from "../change-set"; export { VideoSectionsAdminController, VideoSectionUpdater } from "../video-sections";