Skip to content

Commit 93fef28

Browse files
committed
Merge branch 'eslint-activate-again' of Arnei/opencast-admin-interface into develop
Pull request #1347 Activate some eslints again
2 parents 4b51a05 + 6e675b6 commit 93fef28

30 files changed

Lines changed: 74 additions & 77 deletions

eslint.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ export default [
1414
"indent": "off",
1515
"max-len": "off",
1616
"no-tabs": "off",
17-
"object-curly-spacing": "off",
18-
"quotes": "off",
19-
"semi": "off",
2017
"spaced-comment": "off",
2118
"@typescript-eslint/await-thenable": "off",
2219
"@typescript-eslint/no-explicit-any": "off",

src/components/NavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ const NavBar = ({
5555
if (create && create.onShowModal) {
5656
await create.onShowModal();
5757
}
58-
newResourceModalRef.current?.open()
58+
newResourceModalRef.current?.open();
5959
};
6060

6161
const hideNewResourceModal = () => {
6262
if (create && create.onHideModal) {
6363
create.onHideModal();
6464
}
65-
newResourceModalRef.current?.close?.()
65+
newResourceModalRef.current?.close?.();
6666
};
6767

6868
const toggleNavigation = () => {

src/components/events/partials/EventsLocationCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const EventsLocationCell = ({
2222
const addFilter = (location: string) => {
2323
const filter = filterMap.find(({ name }) => name === "location");
2424
if (filter) {
25-
dispatch(editFilterValue({filterName: filter.name, value: location, resource: "events"}));
25+
dispatch(editFilterValue({ filterName: filter.name, value: location, resource: "events" }));
2626
dispatch(fetchEvents());
2727
dispatch(loadEventsIntoTable());
2828
}

src/components/events/partials/EventsSeriesCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const EventsSeriesCell = ({
2222
const addFilter = async (seriesId: string) => {
2323
const filter = filterMap.find(({ name }) => name === "series");
2424
if (filter) {
25-
dispatch(editFilterValue({filterName: filter.name, value: seriesId, resource: "events"}));
25+
dispatch(editFilterValue({ filterName: filter.name, value: seriesId, resource: "events" }));
2626
await dispatch(fetchEvents());
2727
dispatch(loadEventsIntoTable());
2828
}

src/components/events/partials/EventsTechnicalDateCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const EventsTechnicalDateCell = ({
2525
const addFilter = async (date: string) => {
2626
const filter = filterMap.find(({ name }) => name === "technicalStart");
2727
if (filter) {
28-
await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date, resource: "events"}));
28+
await dispatch(editFilterValue({ filterName: filter.name, value: date + "/" + date, resource: "events" }));
2929
await dispatch(fetchEvents());
3030
dispatch(loadEventsIntoTable());
3131
}

src/components/events/partials/ModalTabsAndPages/DetailsTobiraTab.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ type TobiraTableProps = {
202202
const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTableProps) => {
203203
const { t } = useTranslation();
204204
const deleteConfirmationModalRef = useRef<ModalHandle>(null);
205-
const prefix = i18nKey === "SERIES" ? 's' : 'v';
205+
const prefix = i18nKey === "SERIES" ? "s" : "v";
206206

207207
return <div className="obj">
208208
<header>{t(`EVENTS.${i18nKey}.DETAILS.TOBIRA.PAGES`)}</header>
@@ -222,8 +222,8 @@ const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTa
222222
{tobiraData.hostPages.map(hostPage => <tr key={hostPage.path}>
223223
<td>
224224
<a href={tobiraData.baseURL + hostPage.path +
225-
(tobiraData.id.length > 2 ? `/${prefix}/${tobiraData.id.substring(2)}` : '')}>
226-
{hostPage.path !== '/' && <>
225+
(tobiraData.id.length > 2 ? `/${prefix}/${tobiraData.id.substring(2)}` : "")}>
226+
{hostPage.path !== "/" && <>
227227
<span className="tobira-page-separator">/</span>
228228
{hostPage.ancestors.map((ancestor, key) => (
229229
<span key={key}>

src/components/events/partials/ModalTabsAndPages/EventDetailsCommentsTab.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const EventDetailsCommentsTab = ({
6060
const user = useAppSelector(state => getUserInformation(state));
6161

6262
const saveComment = (commentText: string, commentReason: string) => {
63-
dispatch(saveNewComment({eventId, commentText, commentReason})).then(successful => {
63+
dispatch(saveNewComment({ eventId, commentText, commentReason })).then(successful => {
6464
if (successful) {
6565
dispatch(fetchComments(eventId));
6666
setNewCommentText("");
@@ -84,7 +84,7 @@ const EventDetailsCommentsTab = ({
8484
};
8585

8686
const saveReply = (originalComment: Comment, reply: string, isResolved: boolean) => {
87-
dispatch(saveNewCommentReply({eventId, commentId: originalComment.id, replyText: reply, commentResolved: isResolved})).then(
87+
dispatch(saveNewCommentReply({ eventId, commentId: originalComment.id, replyText: reply, commentResolved: isResolved })).then(
8888
success => {
8989
if (success) {
9090
dispatch(fetchComments(eventId));
@@ -95,15 +95,15 @@ const EventDetailsCommentsTab = ({
9595
};
9696

9797
const deleteComment = (comment: Comment) => {
98-
dispatch(deleteOneComment({eventId, commentId: comment.id})).then(success => {
98+
dispatch(deleteOneComment({ eventId, commentId: comment.id })).then(success => {
9999
if (success) {
100100
dispatch(fetchComments(eventId));
101101
}
102102
});
103103
};
104104

105105
const deleteReply = (comment: Comment, reply: CommentReply) => {
106-
dispatch(deleteCommentReply({eventId, commentId: comment.id, replyId: reply.id})).then(success => {
106+
dispatch(deleteCommentReply({ eventId, commentId: comment.id, replyId: reply.id })).then(success => {
107107
if (success) {
108108
dispatch(fetchComments(eventId));
109109
}
@@ -251,13 +251,13 @@ const EventDetailsCommentsTab = ({
251251
required={true}
252252
handleChange={element => {
253253
if (element) {
254-
setCommentReason(element.value)
254+
setCommentReason(element.value);
255255
}
256256
}}
257257
placeholder={t(
258258
"EVENTS.EVENTS.DETAILS.COMMENTS.SELECTPLACEHOLDER",
259259
)}
260-
customCSS={{width: 200, optionPaddingTop: 5, optionLineHeight: "105%"}}
260+
customCSS={{ width: 200, optionPaddingTop: 5, optionLineHeight: "105%" }}
261261
/>
262262
</div>
263263

@@ -372,7 +372,7 @@ const EventDetailsCommentsTab = ({
372372
originalComment,
373373
commentReplyText,
374374
commentReplyIsResolved,
375-
)
375+
);
376376
}
377377
}}
378378
>

src/components/events/partials/wizards/NewEventSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const NewEventSummary = <T extends RequiredFormProps>({
7575
for (let i = 0; uploadAssetOptions.length > i; i++) {
7676
const fieldValue = formik.values[uploadAssetOptions[i].id];
7777
if (fieldValue) {
78-
const displayOverride = uploadAssetOptions[i].displayOverride as ParseKeys
78+
const displayOverride = uploadAssetOptions[i].displayOverride as ParseKeys;
7979
setUploadAssetsNonTrack(uploadAssetsNonTrack.concat({
8080
name: uploadAssetOptions[i].id,
8181
translate: displayOverride

src/components/shared/DateTimeCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const DateTimeCell = ({
4545
endDate.setMinutes(59);
4646
endDate.setSeconds(59);
4747

48-
await dispatch(editFilterValue({filterName: filter.name, value: startDate.toISOString() + "/" + endDate.toISOString(), resource}));
48+
await dispatch(editFilterValue({ filterName: filter.name, value: startDate.toISOString() + "/" + endDate.toISOString(), resource }));
4949
await dispatch(fetchResource());
5050
dispatch(loadResourceIntoTable());
5151
}

src/components/shared/DropDown.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { GroupBase, MenuListProps, Props, SelectInstance, createFilter } from "r
88
import { isJson } from "../../utils/utils";
99
import { ParseKeys } from "i18next";
1010
import { FixedSizeList, ListChildComponentProps } from "react-window";
11-
import AsyncSelect from 'react-select/async';
12-
import AsyncCreatableSelect from 'react-select/async-creatable';
11+
import AsyncSelect from "react-select/async";
12+
import AsyncCreatableSelect from "react-select/async-creatable";
1313

1414
export type DropDownOption = {
1515
label: string,
@@ -57,7 +57,7 @@ const DropDown = <T, >({
5757
disabled?: boolean,
5858
menuIsOpen?: boolean,
5959
handleMenuIsOpen?: (open: boolean) => void,
60-
menuPlacement?: 'auto' | 'top' | 'bottom',
60+
menuPlacement?: "auto" | "top" | "bottom",
6161
skipTranslate?: boolean,
6262
optionHeight?: number,
6363
customCSS?: {
@@ -85,7 +85,7 @@ const DropDown = <T, >({
8585
if (handleMenuIsOpen !== undefined) {
8686
handleMenuIsOpen(open);
8787
}
88-
}
88+
};
8989

9090
const formatOptions = (
9191
unformattedOptions: DropDownOption[],
@@ -94,7 +94,7 @@ const DropDown = <T, >({
9494
// Translate
9595
// Translating is expensive, skip it if it is not required
9696
if (!skipTranslate) {
97-
unformattedOptions = unformattedOptions.map(option => ({...option, label: t(option.label as ParseKeys)}))
97+
unformattedOptions = unformattedOptions.map(option => ({ ...option, label: t(option.label as ParseKeys) }));
9898
}
9999

100100
// Add "No value" option
@@ -119,7 +119,7 @@ const DropDown = <T, >({
119119
unformattedOptions.sort((a, b) => JSON.parse(a.label).order - JSON.parse(b.label).order);
120120
} else {
121121
// Apply alphabetical ordering.
122-
unformattedOptions.sort((a, b) => a.label.localeCompare(b.label))
122+
unformattedOptions.sort((a, b) => a.label.localeCompare(b.label));
123123
}
124124

125125
return unformattedOptions;
@@ -130,9 +130,9 @@ const DropDown = <T, >({
130130
* Custom component for list virtualization
131131
*/
132132
const MenuList = (props: MenuListProps<DropDownOption, false>) => {
133-
const { options, children, maxHeight, getValue } = props
133+
const { options, children, maxHeight, getValue } = props;
134134

135-
console.log("Menu List render")
135+
console.log("Menu List render");
136136

137137
return Array.isArray(children) ? (
138138
<div style={{ paddingTop: 4 }}>
@@ -146,8 +146,8 @@ const DropDown = <T, >({
146146
{({ index, style }: ListChildComponentProps) => <div style={{ ...style }}>{children[index]}</div>}
147147
</FixedSizeList>
148148
</div>
149-
) : null
150-
}
149+
) : null;
150+
};
151151

152152
const loadOptions = (
153153
inputValue: string,
@@ -179,7 +179,7 @@ const DropDown = <T, >({
179179
onMenuClose: () => openMenu(false),
180180
isDisabled: disabled,
181181
openMenuOnFocus: openMenuOnFocus,
182-
menuPlacement: menuPlacement ?? 'auto',
182+
menuPlacement: menuPlacement ?? "auto",
183183

184184
//@ts-expect-error: React-Select typing does not account for the typing of option it itself requires
185185
components: { MenuList },

0 commit comments

Comments
 (0)