Skip to content

Commit

Permalink
Merge pull request #880 from owi92/fix-linting-errors
Browse files Browse the repository at this point in the history
Fix some CI linting errors
  • Loading branch information
lkiesow authored Aug 13, 2024
2 parents 9903a9f + 271909d commit 01512da
Showing 1 changed file with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { useEffect } from "react";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import cn from "classnames";
import { FieldArray, FormikProps } from "formik";
import { Field } from "../../../shared/Field";
import Notifications from "../../../shared/Notifications";
import RenderField from "../../../shared/wizard/RenderField";
import { getTimezoneOffset, hasAccess } from "../../../../utils/utils";
import { hours, minutes, weekdays } from "../../../../configs/modalConfig";
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
Expand Down Expand Up @@ -84,9 +82,9 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
*/
const reduceGroupEvents = (events: EditedEvents[][] ) => {
const reducedEvents: EditedEvents[] = [];
for (const [key, value] of Object.entries(events)) {
reducedEvents.push(reduceGroupedEvent(value))
}
Object.entries(events).forEach(([_, value]) => {
reducedEvents.push(reduceGroupedEvent(value));
});
return reducedEvents;
}

Expand Down Expand Up @@ -193,12 +191,12 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
<input
type={"text"}
onChange={(element) => {
for (const [i, value] of formik.values.editedEvents.entries()) {
formik.values.editedEvents.forEach((_, i) => {
formik.setFieldValue(
`editedEvents.${i}.changedTitle`,
element.target.value
)
}
);
});
}}
defaultValue={formik.values.editedEvents.length > 0 ? reduceGroupedEvent(formik.values.editedEvents).title : ""}
/>
Expand Down Expand Up @@ -230,12 +228,12 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
required={false}
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
formik.values.editedEvents.forEach((_, i) => {
formik.setFieldValue(
`editedEvents.${i}.changedSeries`,
element.value
)
}
);
});
}
}}
placeholder={formik.values.editedEvents.length > 0 ? reduceGroupedEvent(formik.values.editedEvents).series : ""}
Expand Down Expand Up @@ -302,7 +300,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedStartTimeHour`,
element.value
Expand Down Expand Up @@ -337,7 +335,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedStartTimeMinutes`,
element.value
Expand Down Expand Up @@ -380,7 +378,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedEndTimeHour`,
element.value
Expand Down Expand Up @@ -415,7 +413,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedEndTimeMinutes`,
element.value
Expand Down Expand Up @@ -459,7 +457,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
handleChange={(element) => {
if (element) {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedLocation`,
element.value
Expand Down Expand Up @@ -497,7 +495,7 @@ const EditScheduledEventsEditPage = <T extends RequiredFormProps>({
name={groupedEvent.weekday}
onChange={(element) => {
for (const [i, value] of formik.values.editedEvents.entries()) {
if (value.weekday == groupedEvent.weekday ) {
if (value.weekday === groupedEvent.weekday ) {
formik.setFieldValue(
`editedEvents.${i}.changedWeekday`,
element.target.value
Expand Down

0 comments on commit 01512da

Please sign in to comment.