diff --git a/.eslintrc.js b/.eslintrc.js index 14c2ace99..58e6ac19d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,9 +7,6 @@ module.exports = { // "always" gives 319 warning, "never" gives 991. "object-curly-spacing": "off", - // Many multiline lists do not have a trailing comma right now - "comma-dangle": ["warn", "only-multiline"], - // Currently 120 warnings. "@typescript-eslint/no-explicit-any": "off", diff --git a/src/config.ts b/src/config.ts index 09bd51e86..1aa9e71f3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -104,7 +104,7 @@ const defaultSettings: iSettings = { languages: {}, icons: undefined, defaultVideoFlavor: undefined, - } + }, }; let configFileSettings: iSettings; let urlParameterSettings: iSettings; @@ -358,7 +358,7 @@ const types = { } } } - } + }, }; // Defines all potential settings and their types. @@ -398,7 +398,7 @@ const SCHEMA = { thumbnail: { show: types.boolean, simpleMode: types.boolean, - } + }, }; const merge = (a: iSettings, b: iSettings) => { diff --git a/src/cssStyles.tsx b/src/cssStyles.tsx index 35dcf52f7..3752e669a 100644 --- a/src/cssStyles.tsx +++ b/src/cssStyles.tsx @@ -70,7 +70,7 @@ export const flexGapReplacementStyle = (flexGapValue: number, flexDirectionIsRow marginRight: "0px", }, }, - } + }, } ); }; @@ -221,7 +221,7 @@ export function selectFieldStyle(theme: Theme) { ...(state.isFocused && { boxShadow: `0 0 0 1px ${theme.metadata_highlight}` }), "&:hover": { borderColor: theme.menu_background, - boxShadow: `0 0 0 1px ${theme.metadata_highlight}` + boxShadow: `0 0 0 1px ${theme.metadata_highlight}`, }, }), menu: (provided: any) => ({ @@ -297,7 +297,7 @@ export const calendarStyle = (theme: Theme) => createTheme({ ".Mui-selected": { background: `${theme.selected}`, color: `${theme.selected_text}`, - } + }, }, /* Clock-modal */ @@ -305,7 +305,7 @@ export const calendarStyle = (theme: Theme) => createTheme({ background: `${theme.clock_bg}`, outline: `${theme.clock_border}`, "-webkitTextFillColor": `${theme.text}`, // Digits on the clock - textShadow: `${theme.text_shadow}` + textShadow: `${theme.text_shadow}`, }, /* selected digit (hour/minute) */ "& .MuiClockPicker-root .Mui-selected": { @@ -315,15 +315,15 @@ export const calendarStyle = (theme: Theme) => createTheme({ }, /* clock hands */ "& .MuiClock-pin, .MuiClockPointer-root": { - background: `${theme.clock_hands}` + background: `${theme.clock_hands}`, }, "& .MuiClockPointer-thumb": { background: `${theme.clock_hands}`, border: `16px solid ${theme.clock_hands}`, - } + }, }, - } + }, }, MuiButtonBase: { styleOverrides: { @@ -354,20 +354,20 @@ export const calendarStyle = (theme: Theme) => createTheme({ "&.MuiClock-amButton, &.MuiClock-pmButton": { "-webkitTextFillColor": `${theme.text} !important`, "&:hover": { - "-webkitTextFillColor": `${theme.clock_focus} !important` - } + "-webkitTextFillColor": `${theme.clock_focus} !important`, + }, }, - } - } + }, + }, }, MuiTypography: { styleOverrides: { root: { // Weekdays color: `${theme.disabled} !important`, }, - } + }, }, - } + }, }); export const subtitleSelectStyle = (theme: Theme) => createTheme({ @@ -378,7 +378,7 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ root: { color: `${theme.text} !important`, }, - } + }, }, /* Labelborder */ MuiOutlinedInput: { @@ -386,7 +386,7 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ notchedOutline: { border: `${theme.dropdown_border} !important`, }, - } + }, }, /* Selectfield/Inputfield with Icon */ MuiSelect: { @@ -398,7 +398,7 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ icon: { color: `${theme.indicator_color}`, }, - } + }, }, /* Dropdownlist */ @@ -409,7 +409,7 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ color: `${theme.text}`, border: `${theme.dropdown_border}`, }, - } + }, }, /* Dropdownlist: Single entry */ MuiMenuItem: { @@ -417,16 +417,16 @@ export const subtitleSelectStyle = (theme: Theme) => createTheme({ root: { "&:hover, &.Mui-selected:hover": { color: `${theme.focus_text}`, - background: `${theme.focused}` + background: `${theme.focused}`, }, "&.Mui-selected": { color: `${theme.selected_text}`, background: `${theme.selected}`, }, }, - } - } - } + }, + }, + }, }); export const spinningStyle = css({ @@ -438,7 +438,7 @@ export const spinningStyle = css({ export const customIconStyle = css(({ maxWidth: "16px", - height: "auto" + height: "auto", })); export const videosStyle = (theme: Theme) => css(({ diff --git a/src/globalKeys.ts b/src/globalKeys.ts index 0e25b055f..4f2916476 100644 --- a/src/globalKeys.ts +++ b/src/globalKeys.ts @@ -60,7 +60,7 @@ export const KEYMAP: IKeyMap = { preview: { name: "video.previewButton", key: "Shift+Alt+p", - } + }, }, cutting: { cut: { @@ -118,6 +118,6 @@ export const KEYMAP: IKeyMap = { delete: { name: "subtitleList.deleteSegment", key: "Shift+Alt+d", - } - } + }, + }, }; diff --git a/src/main/Cutting.tsx b/src/main/Cutting.tsx index 01c7ef13b..114e47e2c 100644 --- a/src/main/Cutting.tsx +++ b/src/main/Cutting.tsx @@ -15,7 +15,7 @@ import { setIsPlaying, setIsMuted, setVolume, - setIsPlayPreview + setIsPlayPreview, } from "../redux/videoSlice"; import { useTranslation } from "react-i18next"; import { useAppDispatch, useAppSelector } from "../redux/store"; @@ -54,13 +54,13 @@ const Cutting: React.FC = () => { error: true, errorTitle: t("error.workflowActive-errorTitle"), errorMessage: t("error.workflowActive-errorMessage"), - errorIcon: LuMoreHorizontal + errorIcon: LuMoreHorizontal, })); } else { dispatch(setError({ error: true, errorMessage: t("video.comError-text"), - errorDetails: error + errorDetails: error, })); } } else if (videoURLStatus === "success") { @@ -68,7 +68,7 @@ const Cutting: React.FC = () => { dispatch(setError({ error: true, errorMessage: t("video.durationError-text"), - errorDetails: error + errorDetails: error, })); } } diff --git a/src/main/CuttingActions.tsx b/src/main/CuttingActions.tsx index e06f695c9..65e61bac4 100644 --- a/src/main/CuttingActions.tsx +++ b/src/main/CuttingActions.tsx @@ -10,7 +10,7 @@ import { css } from "@emotion/react"; import { useAppDispatch, useAppSelector } from "../redux/store"; import { - cut, markAsDeletedOrAlive, selectIsCurrentSegmentAlive, mergeLeft, mergeRight, mergeAll + cut, markAsDeletedOrAlive, selectIsCurrentSegmentAlive, mergeLeft, mergeRight, mergeAll, } from "../redux/videoSlice"; import { KEYMAP, rewriteKeys } from "../globalKeys"; import { ActionCreatorWithoutPayload } from "@reduxjs/toolkit"; @@ -164,7 +164,7 @@ const CuttingActionsButton: React.FC = ({ actionHandler, action, tooltip, - ariaLabelText + ariaLabelText, }) => { const ref = React.useRef(null); const theme = useTheme(); @@ -200,7 +200,7 @@ interface markAsDeleteButtonInterface { const MarkAsDeletedButton: React.FC = ({ actionHandler, action, - hotKeyName + hotKeyName, }) => { const { t } = useTranslation(); const isCurrentSegmentAlive = useAppSelector(selectIsCurrentSegmentAlive); diff --git a/src/main/Finish.tsx b/src/main/Finish.tsx index 2c9903e2d..2905ad76a 100644 --- a/src/main/Finish.tsx +++ b/src/main/Finish.tsx @@ -65,7 +65,7 @@ export const PageButton: React.FC<{ }> = ({ pageNumber, label, - Icon + Icon, }) => { const theme = useTheme(); diff --git a/src/main/Header.tsx b/src/main/Header.tsx index d4afad631..65a30c613 100644 --- a/src/main/Header.tsx +++ b/src/main/Header.tsx @@ -34,7 +34,7 @@ function Header() { const headerStyleThemed = scheme.includes("high-contrast-") ? css({ height: "62px", - borderBottom: "2px solid white" + borderBottom: "2px solid white", }) : css({ height: "64px", @@ -65,7 +65,7 @@ function Header() { ":hover, :active": { outline: `2px solid ${theme.metadata_highlight}`, backgroundColor: theme.header_button_hover_bg, - color: `${theme.header_text}` + color: `${theme.header_text}`, }, }); @@ -137,7 +137,7 @@ const LanguageButton: React.FC = () => { const languageNames = (language: string) => { return new Intl.DisplayNames([language], { - type: "language" + type: "language", }).of(language); }; @@ -227,16 +227,16 @@ const HeaderButton = React.forwardRef( ":hover, :active": { outline: `2px solid ${theme.metadata_highlight}`, backgroundColor: theme.header_button_hover_bg, - color: `${theme.header_text}` + color: `${theme.header_text}`, }, ":focus": { backgroundColor: "inherit", - color: `${theme.header_text}` + color: `${theme.header_text}`, }, ":focus:hover": { backgroundColor: theme.header_button_hover_bg, - color: `${theme.header_text}` - } + color: `${theme.header_text}`, + }, }); const iconStyle = css({ diff --git a/src/main/KeyboardControls.tsx b/src/main/KeyboardControls.tsx index 788049b26..d87db854d 100644 --- a/src/main/KeyboardControls.tsx +++ b/src/main/KeyboardControls.tsx @@ -52,7 +52,7 @@ const Entry: React.FC<{ name: string, sequences: string[][]; }> = ({ name, seque justifyContent: "left", width: "100%", padding: "10px 0px", - ...(flexGapReplacementStyle(10, true)) + ...(flexGapReplacementStyle(10, true)), }); const labelStyle = css({ @@ -66,7 +66,7 @@ const Entry: React.FC<{ name: string, sequences: string[][]; }> = ({ name, seque const sequenceStyle = css({ display: "flex", flexDirection: "row", - ...(flexGapReplacementStyle(10, true)) + ...(flexGapReplacementStyle(10, true)), }); const singleKeyStyle = css({ diff --git a/src/main/Landing.tsx b/src/main/Landing.tsx index e19b94b75..c67c26387 100644 --- a/src/main/Landing.tsx +++ b/src/main/Landing.tsx @@ -29,7 +29,7 @@ const Landing: React.FC = () => { code: { userSelect: "all", color: "#e83e8c", - } + }, }); return ( diff --git a/src/main/Lock.tsx b/src/main/Lock.tsx index 4a6596a07..ff17463f7 100644 --- a/src/main/Lock.tsx +++ b/src/main/Lock.tsx @@ -27,8 +27,8 @@ const Lock: React.FC = () => { const form = `user=${lock.user}&uuid=${lock.uuid}`; client.post(endpoint, form, { headers: { - "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8" - } + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, }) .then(() => dispatch(setLock(true))) .catch((error: string) => { @@ -38,7 +38,7 @@ const Lock: React.FC = () => { errorDetails: error, errorIcon: LuLock, errorTitle: "Video editing locked", - errorMessage: "This video is currently being edited by another user" + errorMessage: "This video is currently being edited by another user", })); }); } diff --git a/src/main/MainMenu.tsx b/src/main/MainMenu.tsx index 36d88a36d..2296f6604 100644 --- a/src/main/MainMenu.tsx +++ b/src/main/MainMenu.tsx @@ -160,7 +160,7 @@ export const MainMenuButton: React.FC = ({ {bottomText &&
{bottomText}
} diff --git a/src/main/Metadata.tsx b/src/main/Metadata.tsx index f7635361b..5ef9ffffc 100644 --- a/src/main/Metadata.tsx +++ b/src/main/Metadata.tsx @@ -15,7 +15,7 @@ import { selectGetStatus, selectPostError, selectPostStatus, - setFieldReadonly + setFieldReadonly, } from "../redux/metadataSlice"; import { Form, Field, FieldInputProps } from "react-final-form"; @@ -77,7 +77,7 @@ const Metadata: React.FC = () => { if ("readonly" in configureFieldsCatalog[catalog.fields[fieldIndex].id]) { dispatch(setFieldReadonly({ catalogIndex: catalogIndex, fieldIndex: fieldIndex, - value: configureFieldsCatalog[catalog.fields[fieldIndex].id].readonly + value: configureFieldsCatalog[catalog.fields[fieldIndex].id].readonly, })); } } @@ -354,7 +354,7 @@ const Metadata: React.FC = () => { // Update the field in the redux catalog dispatch(setFieldValue({ catalogIndex: catalogIndex, fieldIndex: fieldIndex, - value: parseValue(catalogs[catalogIndex].fields[fieldIndex], value) + value: parseValue(catalogs[catalogIndex].fields[fieldIndex], value), })); break; } @@ -436,7 +436,7 @@ const Metadata: React.FC = () => { // Update the field in the redux catalog dispatch(setFieldValue({ catalogIndex: catalogIndex, fieldIndex: fieldIndex, - value: parseValue(catalogs[catalogIndex].fields[fieldIndex], values[formCatalogName][formFieldName]) + value: parseValue(catalogs[catalogIndex].fields[fieldIndex], values[formCatalogName][formFieldName]), })); break; } @@ -488,7 +488,7 @@ const Metadata: React.FC = () => { library.push({ value: key, label: descLabel ? descLabel : value, - submitValue: value + submitValue: value, }); }); return library; @@ -546,7 +546,7 @@ const Metadata: React.FC = () => { css={[fieldTypeStyle(field.readOnly), inputFieldTypeStyle(field.readOnly), { resize: "none", - } + }, ]} data-testid="dateTimePicker" /> @@ -564,7 +564,7 @@ const Metadata: React.FC = () => { css={[fieldTypeStyle(field.readOnly), inputFieldTypeStyle(field.readOnly), { resize: "none", - } + }, ]} /> diff --git a/src/main/Save.tsx b/src/main/Save.tsx index c520e0005..fdefd4736 100644 --- a/src/main/Save.tsx +++ b/src/main/Save.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import { css } from "@emotion/react"; import { basicButtonStyle, backOrContinueStyle, ariaLive, errorBoxStyle, - navigationButtonStyle, flexGapReplacementStyle, spinningStyle + navigationButtonStyle, flexGapReplacementStyle, spinningStyle, } from "../cssStyles"; import { LuLoader, LuCheckCircle, LuAlertCircle, LuChevronLeft, LuSave, LuCheck } from "react-icons/lu"; @@ -14,7 +14,7 @@ import { selectHasChanges, selectSegments, selectTracks, - setHasChanges as videoSetHasChanges + setHasChanges as videoSetHasChanges, } from "../redux/videoSlice"; import { postVideoInformation, selectStatus, selectError } from "../redux/workflowPostSlice"; @@ -23,11 +23,11 @@ import { CallbackButton, PageButton } from "./Finish"; import { useTranslation } from "react-i18next"; import { postMetadata, selectPostError, selectPostStatus, setHasChanges as metadataSetHasChanges, - selectHasChanges as metadataSelectHasChanges + selectHasChanges as metadataSelectHasChanges, } from "../redux/metadataSlice"; import { selectSubtitles, selectHasChanges as selectSubtitleHasChanges, - setHasChanges as subtitleSetHasChanges + setHasChanges as subtitleSetHasChanges, } from "../redux/subtitleSlice"; import { serializeSubtitle } from "../util/utilityFunctions"; import { useTheme } from "../themes"; @@ -154,7 +154,7 @@ export const SaveButton: React.FC = () => { subtitlesForPosting.push({ id: identifier, subtitle: serializeSubtitle(subtitles[identifier].cues), - tags: subtitles[identifier].tags + tags: subtitles[identifier].tags, }); } return subtitlesForPosting; @@ -175,7 +175,7 @@ export const SaveButton: React.FC = () => { dispatch(postVideoInformation({ segments: segments, tracks: tracks, - subtitles: prepareSubtitles() + subtitles: prepareSubtitles(), })); } diff --git a/src/main/SubtitleEditor.tsx b/src/main/SubtitleEditor.tsx index 6fd815999..7b4a2cbd8 100644 --- a/src/main/SubtitleEditor.tsx +++ b/src/main/SubtitleEditor.tsx @@ -11,7 +11,7 @@ import { setIsDisplayEditView, selectSelectedSubtitleById, selectSelectedSubtitleId, - setSubtitle + setSubtitle, } from "../redux/subtitleSlice"; import SubtitleVideoArea from "./SubtitleVideoArea"; import SubtitleTimeline from "./SubtitleTimeline"; @@ -44,7 +44,7 @@ const SubtitleEditor: React.FC = () => { try { dispatch(setSubtitle({ identifier: selectedId, - subtitles: { cues: parseSubtitle(captionTrack.subtitle), tags: captionTrack.tags } + subtitles: { cues: parseSubtitle(captionTrack.subtitle), tags: captionTrack.tags }, })); } catch (error) { if (error instanceof Error) { @@ -96,7 +96,7 @@ const SubtitleEditor: React.FC = () => { paddingTop: "10px", paddingBottom: "10px", ...(flexGapReplacementStyle(30, true)), - borderBottom: `${theme.menuBorder}` + borderBottom: `${theme.menuBorder}`, }); @@ -188,7 +188,7 @@ export const BackButton: React.FC = () => { padding: "16px", boxShadow: `${theme.boxShadow}`, background: `${theme.element_bg}`, - justifyContent: "space-around" + justifyContent: "space-around", }); return ( diff --git a/src/main/SubtitleListEditor.tsx b/src/main/SubtitleListEditor.tsx index b27dcb1a1..ca94126b7 100644 --- a/src/main/SubtitleListEditor.tsx +++ b/src/main/SubtitleListEditor.tsx @@ -22,7 +22,7 @@ import { setFocusSegmentTriggered, setFocusSegmentTriggered2, setFocusToSegmentAboveId, - setFocusToSegmentBelowId + setFocusToSegmentBelowId, } from "../redux/subtitleSlice"; import { SubtitleCue } from "../types"; import { convertMsToReadableString } from "../util/utilityFunctions"; @@ -80,7 +80,7 @@ const SubtitleListEditor: React.FC = () => { cueIndex: 0, text: "", startTime: 0, - endTime: defaultSegmentLength + endTime: defaultSegmentLength, })); } }, [dispatch, subtitle?.cues, subtitleId]); @@ -216,8 +216,8 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { text: event.target.value, startTime: cue.startTime, endTime: cue.endTime, - tree: cue.tree - } + tree: cue.tree, + }, })); }; @@ -231,8 +231,8 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { text: cue.text, startTime: value, endTime: cue.endTime, - tree: cue.tree - } + tree: cue.tree, + }, })); }; @@ -246,8 +246,8 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { text: cue.text, startTime: cue.startTime, endTime: value, - tree: cue.tree - } + tree: cue.tree, + }, })); }; @@ -257,7 +257,7 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { cueIndex: props.index, text: "", startTime: cue.startTime - defaultSegmentLength, - endTime: cue.startTime + endTime: cue.startTime, })); }; @@ -267,14 +267,14 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { cueIndex: props.index + 1, text: "", startTime: cue.endTime, - endTime: cue.endTime + defaultSegmentLength + endTime: cue.endTime + defaultSegmentLength, })); }; const deleteCue = () => { dispatch(removeCue({ identifier: identifier, - cue: cue + cue: cue, })); }; @@ -284,7 +284,7 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { KEYMAP.subtitleList.addBelow.key, KEYMAP.subtitleList.jumpAbove.key, KEYMAP.subtitleList.jumpBelow.key, - KEYMAP.subtitleList.delete.key + KEYMAP.subtitleList.delete.key, ], (_, handler) => { switch (handler.keys?.join("")) { case KEYMAP.subtitleList.addAbove.key.split("+").pop(): @@ -325,12 +325,12 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { "&:hover": { "& .functionButtonAreaStyle": { visibility: "visible", - } + }, }, "&:focus-within": { "& .functionButtonAreaStyle": { visibility: "visible", - } + }, }, "& textarea, input": { outline: `${theme.element_outline}`, @@ -338,7 +338,7 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { "& input": { marginTop: (scheme === "dark-high-contrast" || scheme === "light-high-contrast" ? "3%" : "0%"), marginBottom: (scheme === "dark-high-contrast" || scheme === "light-high-contrast" ? "3%" : "0%"), - } + }, }); const timeAreaStyle = css({ @@ -370,7 +370,7 @@ const SubtitleListSegment = React.memo((props: subtitleListSegmentProps) => { padding: "10px 10px", background: `${theme.element_bg}`, border: "1px solid #ccc", - color: `${theme.text}` + color: `${theme.text}`, }); const textFieldStyle = css({ @@ -482,7 +482,7 @@ const FunctionButton: React.FC<{ tooltipAria, onClick, onKeyDown, - Icon + Icon, }) => { const theme = useTheme(); @@ -564,7 +564,7 @@ const TimeInput: React.FC<{ const timeFieldStyle = css({ height: "20%", width: "100px", - ...(parsingError && { borderColor: "red", borderWidth: "2px" }) + ...(parsingError && { borderColor: "red", borderWidth: "2px" }), }); return ( diff --git a/src/main/SubtitleSelect.tsx b/src/main/SubtitleSelect.tsx index 9257dd144..c871ea58d 100644 --- a/src/main/SubtitleSelect.tsx +++ b/src/main/SubtitleSelect.tsx @@ -5,7 +5,7 @@ import { flexGapReplacementStyle, tileButtonStyle, disableButtonAnimation, - subtitleSelectStyle + subtitleSelectStyle, } from "../cssStyles"; import { settings, subtitleTags } from "../config"; import { selectSubtitles, setSelectedSubtitleId, setSubtitle } from "../redux/subtitleSlice"; @@ -202,7 +202,7 @@ const SubtitleSelectButton: React.FC<{ const SubtitleAddButton: React.FC<{ subtitlesForDropdown: { id: string, tags: string[]; }[]; }> = ({ - subtitlesForDropdown + subtitlesForDropdown, }) => { const { t } = useTranslation(); const theme = useTheme(); @@ -238,7 +238,7 @@ const SubtitleAddButton: React.FC<{ }; const plusIconStyle = css({ - display: isPlusDisplay ? "flex" : "none" + display: isPlusDisplay ? "flex" : "none", }); const subtitleAddFormStyle = css({ diff --git a/src/main/SubtitleTimeline.tsx b/src/main/SubtitleTimeline.tsx index e29f3d69a..c7846a3f5 100644 --- a/src/main/SubtitleTimeline.tsx +++ b/src/main/SubtitleTimeline.tsx @@ -164,7 +164,7 @@ const SubtitleTimeline: React.FC = () => { height: "100%", left: (currentlyAt / duration) * (widthMiniTimeline), top: 0, - background: "black" + background: "black", }} /> @@ -276,8 +276,8 @@ const TimelineSubtitleSegment: React.FC<{ text: props.cue.text, startTime: newStartTime, endTime: newEndTime, - tree: props.cue.tree - } + tree: props.cue.tree, + }, })); }; @@ -388,7 +388,7 @@ const TimelineSubtitleSegment: React.FC<{ whiteSpace: "nowrap", textOverflow: "ellipsis", padding: "8px", - color: `${theme.subtitle_segment_text}` + color: `${theme.subtitle_segment_text}`, }); return ( diff --git a/src/main/SubtitleVideoArea.tsx b/src/main/SubtitleVideoArea.tsx index 0a0545b4b..846139de3 100644 --- a/src/main/SubtitleVideoArea.tsx +++ b/src/main/SubtitleVideoArea.tsx @@ -15,7 +15,7 @@ import { selectSelectedSubtitleById, selectIsPlayPreview, setIsPlayPreview, - setCurrentlyAtAndTriggerPreview + setCurrentlyAtAndTriggerPreview, } from "../redux/subtitleSlice"; import { selectIsMuted, selectVideos, selectVolume, setIsMuted, setVolume } from "../redux/videoSlice"; import { Flavor } from "../types"; @@ -169,7 +169,7 @@ const VideoSelectDropdown: React.FC<{ }> = ({ flavors, changeFlavorcallback, - defaultFlavor + defaultFlavor, }) => { const { t } = useTranslation(); diff --git a/src/main/Thumbnail.tsx b/src/main/Thumbnail.tsx index e10e38724..819d04414 100644 --- a/src/main/Thumbnail.tsx +++ b/src/main/Thumbnail.tsx @@ -7,7 +7,7 @@ import { useAppDispatch, useAppSelector } from "../redux/store"; import { settings } from "../config"; import { basicButtonStyle, deactivatedButtonStyle, flexGapReplacementStyle, titleStyle, titleStyleBold, videosStyle, - backgroundBoxStyle + backgroundBoxStyle, } from "../cssStyles"; import { Theme, useTheme } from "../themes"; import { @@ -16,7 +16,7 @@ import { selectTracks, setHasChanges, setThumbnail, - setThumbnails + setThumbnails, } from "../redux/videoSlice"; import { Track } from "../types"; import Timeline from "./Timeline"; @@ -31,7 +31,7 @@ import { setClickTriggered, setIsMuted, setVolume, - setCurrentlyAt + setCurrentlyAt, } from "../redux/videoSlice"; import { ThemedTooltip } from "./Tooltip"; import VideoPlayers from "./VideoPlayers"; @@ -659,8 +659,8 @@ const thumbnailButtonStyle = (active: boolean, theme: Theme) => [ background: `${theme.element_bg}`, justifySelf: "center", alignSelf: "center", - padding: "0px 4px" - } + padding: "0px 4px", + }, ]; diff --git a/src/main/Timeline.tsx b/src/main/Timeline.tsx index be1dbc1f6..574bce1ad 100644 --- a/src/main/Timeline.tsx +++ b/src/main/Timeline.tsx @@ -7,7 +7,7 @@ import { css } from "@emotion/react"; import { useAppDispatch, useAppSelector } from "../redux/store"; import { Segment, httpRequestState } from "../types"; import { - selectSegments, selectActiveSegmentIndex, selectDuration, selectVideoURL, selectWaveformImages, setWaveformImages + selectSegments, selectActiveSegmentIndex, selectDuration, selectVideoURL, selectWaveformImages, setWaveformImages, } from "../redux/videoSlice"; import { LuMenu, LuLoader } from "react-icons/lu"; @@ -47,7 +47,7 @@ const Timeline: React.FC<{ selectIsPlaying, setClickTriggered, setCurrentlyAt, - setIsPlaying + setIsPlaying, }) => { // Init redux variables @@ -280,7 +280,7 @@ export const Scrubber: React.FC<{ moveLeft: rewriteKeys(KEYMAP.timeline.left.key), moveRight: rewriteKeys(KEYMAP.timeline.right.key), increase: rewriteKeys(KEYMAP.timeline.increase.key), - decrease: rewriteKeys(KEYMAP.timeline.decrease.key) + decrease: rewriteKeys(KEYMAP.timeline.decrease.key), })} tabIndex={0}> @@ -348,7 +348,7 @@ export const SegmentsList: React.FC<{ segment: index, segmentStatus: (segment.deleted ? "Deleted" : "Alive"), start: convertMsToReadableString(segment.start), - end: convertMsToReadableString(segment.end) + end: convertMsToReadableString(segment.end), })} tabIndex={tabable ? 0 : -1} css={{ @@ -441,7 +441,7 @@ export const Waveforms: React.FC<{ timelineHeight: number; }> = ({ timelineHeigh // Start waveform worker with blob const waveformWorker: any = new Waveform({ - type: "img", width: "2000", height: "230", samples: 100000, media: file + type: "img", width: "2000", height: "230", samples: 100000, media: file, }); waveformWorker.onerror = (error: string) => { diff --git a/src/main/Tooltip.tsx b/src/main/Tooltip.tsx index be87d3eda..9afb6c25b 100644 --- a/src/main/Tooltip.tsx +++ b/src/main/Tooltip.tsx @@ -46,13 +46,13 @@ export const ThemedTooltip = ({ className, ...props }: TooltipProps) => { fontSize: "16px", lineHeight: "normal", fontFamily: "Roboto Flex Variable", - } + }, }, arrow: { sx: { color: `${theme.tooltip}`, - } - } + }, + }, }} /> diff --git a/src/main/TrackSelection.tsx b/src/main/TrackSelection.tsx index 778a07a4b..d8ab70cf9 100644 --- a/src/main/TrackSelection.tsx +++ b/src/main/TrackSelection.tsx @@ -16,7 +16,7 @@ import { deactivatedButtonStyle, flexGapReplacementStyle, titleStyle, - titleStyleBold + titleStyleBold, } from "../cssStyles"; import { useTranslation } from "react-i18next"; @@ -138,12 +138,12 @@ const TrackItem: React.FC<{ track: Track, enabledCount: number; }> = ({ track, e const deleteText = [ t("trackSelection.deleteTrackText", "Delete Track"), t("trackSelection.cannotDeleteTrackText", "Cannot Delete Track"), - t("trackSelection.restoreTrackText", "Restore Track") + t("trackSelection.restoreTrackText", "Restore Track"), ][deleteStatus]; const deleteTooltip = [ t("trackSelection.deleteTrackTooltip", "Do not encode and publish this track."), t("trackSelection.cannotDeleteTrackTooltip", "Cannot remove this track from publication."), - t("trackSelection.restoreTrackTooltip", "Encode and publish this track.") + t("trackSelection.restoreTrackTooltip", "Encode and publish this track."), ][deleteStatus]; const deleteIcon = [LuTrash, LuTrash, TrashRestore][deleteStatus]; const trackEnabledChange = () => { diff --git a/src/main/VideoControls.tsx b/src/main/VideoControls.tsx index 2ee319468..74088bb9f 100644 --- a/src/main/VideoControls.tsx +++ b/src/main/VideoControls.tsx @@ -47,7 +47,7 @@ const VideoControls: React.FC<{ setIsPlaying, setIsMuted, setVolume, - setIsPlayPreview + setIsPlayPreview, }) => { const theme = useTheme(); @@ -97,7 +97,7 @@ const PreviewMode: React.FC<{ setIsPlayPreview: ActionCreatorWithPayload, }> = ({ selectIsPlayPreview, - setIsPlayPreview + setIsPlayPreview, }) => { const { t } = useTranslation(); @@ -142,14 +142,14 @@ const PreviewMode: React.FC<{ const previewModeTextStyle = (theme: Theme) => css({ display: "inline-block", flexWrap: "nowrap", - color: `${theme.text}` + color: `${theme.text}`, }); return (
css({ display: "inline-block", - color: `${theme.text}` + color: `${theme.text}`, }); return ( @@ -283,7 +283,7 @@ const VolumeSlider: React.FC<{ selectIsMuted, setIsMuted, selectVolume, - setVolume + setVolume, }) => { const { t } = useTranslation(); @@ -328,7 +328,7 @@ const VolumeSlider: React.FC<{ flexDirection: "row", gap: "15px", justifyContent: "center", - alignItems: "center" + alignItems: "center", }); const sliderStyle = css({ diff --git a/src/main/VideoPlayers.tsx b/src/main/VideoPlayers.tsx index 032ff3d69..aa83fb322 100644 --- a/src/main/VideoPlayers.tsx +++ b/src/main/VideoPlayers.tsx @@ -18,7 +18,7 @@ import { selectAspectRatio, setClickTriggered, selectClickTriggered, - setCurrentlyAt + setCurrentlyAt, } from "../redux/videoSlice"; import ReactPlayer, { Config } from "react-player"; @@ -44,7 +44,7 @@ const VideoPlayers: React.FC<{ }> = ({ refs, widthInPercent = 100, - maxHeightInPixel = 300 + maxHeightInPixel = 300, }) => { const videoURLs = useAppSelector(selectVideoURL); @@ -123,7 +123,7 @@ export const VideoPlayer = React.forwardRef( setIsPlaying: ActionCreatorWithPayload, setPreviewTriggered: ActionCreatorWithPayload, setClickTriggered: ActionCreatorWithPayload, - setCurrentlyAt: ActionCreatorWithPayload, + setCurrentlyAt: any, setAspectRatio: ActionCreatorWithPayload<{ dataKey: number; } & { width: number, height: number; }, string>, }, forwardRefThing @@ -277,12 +277,12 @@ export const VideoPlayer = React.forwardRef( attributes: { // Skip player when navigating page with keyboard tabIndex: "-1", - crossOrigin: "anonymous" // allow thumbnail generation + crossOrigin: "anonymous", // allow thumbnail generation }, tracks: [ - { kind: "subtitles", src: subtitleUrl, srcLang: "en", default: true, label: "I am irrelevant" } - ] - } + { kind: "subtitles", src: subtitleUrl, srcLang: "en", default: true, label: "I am irrelevant" }, + ], + }, }; /** @@ -360,7 +360,7 @@ export const VideoPlayer = React.forwardRef( }, getWidth() { return (ref.current?.getInternalPlayer() as HTMLVideoElement).clientWidth; - } + }, })); const errorBoxStyle = css({ diff --git a/src/main/WorkflowConfiguration.tsx b/src/main/WorkflowConfiguration.tsx index 2c6ddaf85..575b88401 100644 --- a/src/main/WorkflowConfiguration.tsx +++ b/src/main/WorkflowConfiguration.tsx @@ -6,7 +6,7 @@ import { backOrContinueStyle, errorBoxStyle, flexGapReplacementStyle, - spinningStyle + spinningStyle, } from "../cssStyles"; import { LuLoader, LuCheck, LuAlertCircle, LuChevronLeft, LuDatabase, LuMoreHorizontal } from "react-icons/lu"; @@ -16,7 +16,7 @@ import { selectSegments, selectTracks, setHasChanges as videoSetHasChanges, - selectSelectedWorkflowId + selectSelectedWorkflowId, } from "../redux/videoSlice"; import { postVideoInformationWithWorkflow, selectStatus, selectError } from "../redux/workflowPostAndProcessSlice"; @@ -28,7 +28,7 @@ import { postMetadata, selectPostError, selectPostStatus, - setHasChanges as metadataSetHasChanges + setHasChanges as metadataSetHasChanges, } from "../redux/metadataSlice"; import { selectSubtitles } from "../redux/subtitleSlice"; import { serializeSubtitle } from "../util/utilityFunctions"; @@ -115,7 +115,7 @@ export const SaveAndProcessButton: React.FC<{ text: string; }> = ({ text }) => { subtitlesForPosting.push({ id: identifier, subtitle: serializeSubtitle(subtitles[identifier].cues), - tags: subtitles[identifier].tags + tags: subtitles[identifier].tags, }); } return subtitlesForPosting; @@ -137,7 +137,7 @@ export const SaveAndProcessButton: React.FC<{ text: string; }> = ({ text }) => { segments: segments, tracks: tracks, workflow: [{ id: selectedWorkflowId }], - subtitles: prepareSubtitles() + subtitles: prepareSubtitles(), })); } // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/main/WorkflowSelection.tsx b/src/main/WorkflowSelection.tsx index 45292f022..aa432d092 100644 --- a/src/main/WorkflowSelection.tsx +++ b/src/main/WorkflowSelection.tsx @@ -172,7 +172,7 @@ const WorkflowButton: React.FC<{ }> = ({ stateName, workflowId, - workflowDescription + workflowDescription, }) => { // Note: Styling the Radio Button is done in WorkflowSelectRadio @@ -210,8 +210,8 @@ const WorkflowSelectRadio: React.FC = props => { alignSelf: "start", color: `${theme.text}`, "&$checked": { - color: `${theme.text}` - } + color: `${theme.text}`, + }, }); return ( diff --git a/src/redux/endSlice.ts b/src/redux/endSlice.ts index d168c3c08..72eb9c300 100644 --- a/src/redux/endSlice.ts +++ b/src/redux/endSlice.ts @@ -21,7 +21,7 @@ export const endSlice = createSlice({ state.end = action.payload.hasEnded; state.value = action.payload.value; }, - } + }, }); export const { setEnd } = endSlice.actions; diff --git a/src/redux/errorSlice.ts b/src/redux/errorSlice.ts index 5540b5219..fbd1cedf6 100644 --- a/src/redux/errorSlice.ts +++ b/src/redux/errorSlice.ts @@ -37,7 +37,7 @@ export const errorSlice = createSlice({ state.errorDetails = action.payload.errorDetails; state.errorIcon = action.payload.errorIcon; }, - } + }, }); export const { setError } = errorSlice.actions; diff --git a/src/redux/finishSlice.ts b/src/redux/finishSlice.ts index c1b25bf57..e5f2cfdff 100644 --- a/src/redux/finishSlice.ts +++ b/src/redux/finishSlice.ts @@ -22,8 +22,8 @@ export const finishSlice = createSlice({ }, setPageNumber: (state, action) => { state.pageNumber = action.payload; - } - } + }, + }, }); // Export Actions diff --git a/src/redux/mainMenuSlice.ts b/src/redux/mainMenuSlice.ts index b9093cc85..ce8028c11 100644 --- a/src/redux/mainMenuSlice.ts +++ b/src/redux/mainMenuSlice.ts @@ -19,8 +19,8 @@ export const mainMenuSlice = createSlice({ reducers: { setState: (state, action: PayloadAction) => { state.value = action.payload; - } - } + }, + }, }); export const { setState } = mainMenuSlice.actions; diff --git a/src/redux/metadataSlice.ts b/src/redux/metadataSlice.ts index 7bd868469..d1567e219 100644 --- a/src/redux/metadataSlice.ts +++ b/src/redux/metadataSlice.ts @@ -111,7 +111,7 @@ const metadataSlice = createSlice({ }, resetPostRequestState: state => { state.postStatus = "idle"; - } + }, }, extraReducers: builder => { builder.addCase( @@ -142,7 +142,7 @@ const metadataSlice = createSlice({ state.postStatus = "failed"; state.postError = action.error.message; }); - } + }, }); export const { setFieldValue, setHasChanges, setFieldReadonly, resetPostRequestState } = metadataSlice.actions; diff --git a/src/redux/store.ts b/src/redux/store.ts index c428c854e..bfedf0db1 100644 --- a/src/redux/store.ts +++ b/src/redux/store.ts @@ -21,7 +21,7 @@ export const store = configureStore({ metadataState: metadataReducer, subtitleState: subtitleReducer, errorState: errorReducer, - } + }, }); export type AppDispatch = typeof store.dispatch; diff --git a/src/redux/subtitleSlice.ts b/src/redux/subtitleSlice.ts index 7da7f40e2..f718090f3 100644 --- a/src/redux/subtitleSlice.ts +++ b/src/redux/subtitleSlice.ts @@ -111,7 +111,7 @@ export const subtitleSlice = createSlice({ text: action.payload.text, startTime: Math.round(startTime), endTime: Math.round(action.payload.endTime), - tree: { children: [{ type: "text", value: action.payload.text }] } + tree: { children: [{ type: "text", value: action.payload.text }] }, }; // Trigger a callback in the list component that focuses the newly added element diff --git a/src/redux/videoSlice.ts b/src/redux/videoSlice.ts index 4f0a2948d..12f0bbfdd 100644 --- a/src/redux/videoSlice.ts +++ b/src/redux/videoSlice.ts @@ -181,13 +181,13 @@ const videoSlice = createSlice({ id: nanoid(), start: state.segments[state.activeSegmentIndex].start, end: state.currentlyAt, - deleted: state.segments[state.activeSegmentIndex].deleted + deleted: state.segments[state.activeSegmentIndex].deleted, }; const segmentB: Segment = { id: nanoid(), start: state.currentlyAt, end: state.segments[state.activeSegmentIndex].end, - deleted: state.segments[state.activeSegmentIndex].deleted + deleted: state.segments[state.activeSegmentIndex].deleted, }; // Add the new segments and remove the old one @@ -267,7 +267,7 @@ const videoSlice = createSlice({ state.status = "failed"; state.error = action.error.message; }); - } + }, }); /** diff --git a/src/redux/workflowPostAndProcessSlice.ts b/src/redux/workflowPostAndProcessSlice.ts index 6e44e6f94..5984eb8e0 100644 --- a/src/redux/workflowPostAndProcessSlice.ts +++ b/src/redux/workflowPostAndProcessSlice.ts @@ -22,7 +22,7 @@ export const postVideoInformationWithWorkflow = segments: convertSegments(argument.segments), tracks: argument.tracks, subtitles: argument.subtitles, - workflows: argument.workflow + workflows: argument.workflow, } ); return response; @@ -51,7 +51,7 @@ const workflowPostAndProcessSlice = createSlice({ state.status = "failed"; state.error = action.error.message; }); - } + }, }); export const selectStatus = (state: { workflowPostAndProcessState: { status: httpRequestState["status"]; }; }) => diff --git a/src/redux/workflowPostSlice.ts b/src/redux/workflowPostSlice.ts index 779428108..0e8dcee0e 100644 --- a/src/redux/workflowPostSlice.ts +++ b/src/redux/workflowPostSlice.ts @@ -19,7 +19,7 @@ export const postVideoInformation = { segments: convertSegments(argument.segments), tracks: argument.tracks, - subtitles: argument.subtitles + subtitles: argument.subtitles, } ); return response; @@ -35,7 +35,7 @@ const workflowPostSlice = createSlice({ reducers: { resetPostRequestState: state => { state.status = "idle"; - } + }, }, extraReducers: builder => { builder.addCase( @@ -51,7 +51,7 @@ const workflowPostSlice = createSlice({ state.status = "failed"; state.error = action.error.message; }); - } + }, }); interface segmentAPI { diff --git a/src/util/client.js b/src/util/client.js index 9675fa66b..c986d32a5 100644 --- a/src/util/client.js +++ b/src/util/client.js @@ -13,7 +13,7 @@ export async function client(endpoint, { body, ...customConfig } = {}) { let authHeaders = {}; if (settings.opencast.name && settings.opencast.password) { const encoded = btoa(unescape(encodeURIComponent( - settings.opencast.name + ":" + settings.opencast.password + settings.opencast.name + ":" + settings.opencast.password, ))); authHeaders = { "Authorization": `Basic ${encoded}` }; } @@ -55,7 +55,7 @@ export async function client(endpoint, { body, ...customConfig } = {}) { } catch (err) { return Promise.reject(response.status ? "Status " + response.status + ": " + text : - err.message + err.message, ); } } diff --git a/src/util/waveform.js b/src/util/waveform.js index 8ce38aad8..fac897525 100644 --- a/src/util/waveform.js +++ b/src/util/waveform.js @@ -68,7 +68,7 @@ export function Waveform(opts) { _completeFuncs.push(fn); } - } + }, }); var _error = ""; @@ -86,7 +86,7 @@ export function Waveform(opts) { } _errorFuncs.push(fn); - } + }, }); } @@ -192,5 +192,5 @@ Waveform.prototype = { this.svgPath.setAttribute("stroke-width", "0.5px"); this.oncomplete.forEach(fn => fn(this.svgPath, this.svgLength)); - } + }, };