Added eslint

This commit is contained in:
MaxOvs19
2023-05-31 11:24:46 +03:00
parent fc8fc33733
commit 9e242ddf5d
40 changed files with 224 additions and 536 deletions

View File

@ -7,7 +7,7 @@ import userIcon from "assets/icons/userIcon.svg";
import "./authHeader.scss";
export const AuthHeader = ({}) => {
export const AuthHeader = () => {
return (
<div className="auth-header">
<div className="auth-header__logo">

View File

@ -13,7 +13,7 @@ import rectangle from "assets/images/rectangle_secondPage.png";
import ErrorBoundary from "../../hoc/ErrorBoundary";
import "./description.scss";
const Description = ({ onLoadMore, isLoadingMore }) => {
const Description = ({ onLoadMore }) => {
const candidatesListArr = useSelector(selectProfiles);
return (

View File

@ -29,8 +29,10 @@ const Form = () => {
const handleModal = (status) => {
SweetAlert.fire({
text:
// eslint-disable-next-line no-constant-condition
status !== 200 || 201 ? "Какие-то неполадки =(" : "Форма отправлена",
preConfirm: () =>
// eslint-disable-next-line no-constant-condition
status !== 200 || 201
? () => {
setStatus(null);

View File

@ -14,7 +14,7 @@ import mockWorker from "assets/images/mock/mokPerson.png";
import "./freeDevelopers.scss";
export const FreeDevelopers = ({}) => {
export const FreeDevelopers = () => {
return (
<section className="free-dev">
<AuthHeader />

View File

@ -60,7 +60,7 @@ export const ModalTiсket = ({
task_id: task.id,
status: 0,
},
}).then((res) => {
}).then(() => {
setActive(false);
dispatch(setProjectBoardFetch(projectId));
});
@ -74,7 +74,7 @@ export const ModalTiсket = ({
title: inputsValue.title,
description: inputsValue.description,
},
}).then((res) => {
}).then(() => {
dispatch(setProjectBoardFetch(projectId));
});
}
@ -106,7 +106,7 @@ export const ModalTiсket = ({
comment_id: commentId,
status: 0,
},
}).then((res) => {
}).then(() => {
setComments((prevValue) =>
prevValue.filter((item) => item.id !== commentId)
);
@ -120,7 +120,7 @@ export const ModalTiсket = ({
comment_id: commentId,
text: commentsEditText[commentId],
},
}).then((res) => {});
}).then(() => {});
}
function taskExecutor(person) {
@ -143,7 +143,7 @@ export const ModalTiсket = ({
task_id: task.id,
executor_id: 0,
},
}).then((res) => {
}).then(() => {
setExecutor(null);
});
}
@ -168,7 +168,7 @@ export const ModalTiсket = ({
task_id: task.id,
user_id: person.user_id,
},
}).then((res) => {
}).then(() => {
setMembers(members.filter((item) => item.user_id !== person.user_id));
});
}

View File

@ -42,7 +42,7 @@ import watch from "assets/icons/watch.svg";
import "./ticketFullScreen.scss";
export const TicketFullScreen = ({}) => {
export const TicketFullScreen = () => {
const [modalAddWorker, setModalAddWorker] = useState(false);
const ticketId = useParams();
const dispatch = useDispatch();
@ -93,7 +93,7 @@ export const TicketFullScreen = ({}) => {
task_id: ticketId.id,
status: 0,
},
}).then((res) => {
}).then(() => {
navigate(`/tracker/project/${taskInfo.project_id}`);
});
}
@ -106,7 +106,7 @@ export const TicketFullScreen = ({}) => {
title: inputsValue.title,
description: inputsValue.description,
},
}).then((res) => {});
}).then(() => {});
}
function createComment() {
@ -137,7 +137,7 @@ export const TicketFullScreen = ({}) => {
comment_id: commentId,
status: 0,
},
}).then((res) => {
}).then(() => {
setComments((prevValue) =>
prevValue.filter((item) => item.id !== commentId)
);
@ -151,7 +151,7 @@ export const TicketFullScreen = ({}) => {
comment_id: commentId,
text: commentsEditText[commentId],
},
}).then((res) => {});
}).then(() => {});
}
function deletePerson(userId) {
@ -161,7 +161,7 @@ export const TicketFullScreen = ({}) => {
project_id: projectBoard.id,
user_id: userId,
},
}).then((res) => {
}).then(() => {
dispatch(deletePersonOnProject(userId));
});
}

View File

@ -57,7 +57,7 @@ export const TrackerModal = ({
project_id: projectBoard.id,
title: valueColumn,
},
}).then((res) => {
}).then(() => {
dispatch(setProjectBoardFetch(projectBoard.id));
});
setValueColumn("");
@ -80,7 +80,7 @@ export const TrackerModal = ({
column_id: selectedTab,
priority: priorityTask,
},
}).then((res) => {
}).then(() => {
dispatch(setProjectBoardFetch(projectBoard.id));
});
@ -96,7 +96,7 @@ export const TrackerModal = ({
project_id: projectId,
name: projectName,
},
}).then((res) => {
}).then(() => {
setActive(false);
dispatch(editProjectName({ id: projectId, name: projectName }));
});
@ -109,7 +109,7 @@ export const TrackerModal = ({
column_id: columnId,
title: columnName,
},
}).then((res) => {
}).then(() => {
setActive(false);
dispatch(editColumnName({ id: columnId, title: columnName }));
});

View File

@ -23,6 +23,7 @@ import arrow from "assets/icons/arrows/arrowCalendar.png";
import calendarIcon from "assets/icons/calendar.svg";
import rectangle from "assets/images/rectangle__calendar.png";
// eslint-disable-next-line react/display-name
export const ProfileCalendarComponent = React.memo(
({ value, setValueHandler, reports, totalHours }) => {
const dispatch = useDispatch();

View File

@ -47,7 +47,7 @@ export const ProjectTiket = ({ project, index }) => {
project_id: project.id,
status: 10,
},
}).then((res) => {
}).then(() => {
dispatch(deleteProject(project));
});
}

View File

@ -1,6 +1,6 @@
import React from "react";
import { useSelector } from "react-redux";
import { Redirect, Route } from "react-router-dom";
import { Route } from "react-router-dom";
import { selectAuth } from "@redux/outstaffingSlice";
@ -9,6 +9,7 @@ export const ProtectedRoute = ({ component: Component, ...rest }) => {
const existingToken = localStorage.getItem("auth_token");
const expiresAt = localStorage.getItem("access_token_expired_at");
// eslint-disable-next-line no-unused-vars
const isTokenAlive =
!isAuth &&
existingToken &&

View File

@ -103,7 +103,7 @@ const ReportForm = () => {
created_at: getCreatedDate(startDate),
status: 1,
},
}).then((res) => {
}).then(() => {
setReportSuccess("Отчет отправлен");
setTimeout(() => {
setReportSuccess("");

View File

@ -19,7 +19,7 @@ import { Loader } from "@components/Common/Loader/Loader";
import "./shortReport.scss";
export const ShortReport = ({}) => {
export const ShortReport = () => {
const reportDate = useSelector(getReportDate);
const sendReport = useSelector(getSendRequest);

View File

@ -1,12 +1,6 @@
import React from "react";
import { useSelector } from "react-redux";
import { selectedTest } from "@redux/quizSlice";
export const GetOptionTask = ({ type, answer, handleChange, inputValue }) => {
const id = localStorage.getItem("id");
const dataTest = useSelector(selectedTest);
switch (type) {
case "1":
return (

View File

@ -5,8 +5,7 @@ import { selectUserInfo, setUserInfo } from "@redux/quizSlice";
import { urlForLocal } from "@utils/helper";
import { apiRequest } from "@api/request";
// import { apiRequest } from "@api/request";
import "./quiz.scss";
export const HeaderQuiz = ({ header }) => {

View File

@ -10,14 +10,13 @@ import accempt from "assets/images/quiz/accempt.png";
import timer from "assets/images/quiz/timer.png";
export const QuizPassingInformation = ({ expiryTimestamp, setStartTest }) => {
const { seconds, minutes, isRunning, start, pause, resume, restart } =
useTimer({
expiryTimestamp,
autoStart: false,
onExpire: () => {
console.warn("onExpire called");
},
});
const { seconds, minutes, isRunning, start, restart } = useTimer({
expiryTimestamp,
autoStart: false,
onExpire: () => {
console.warn("onExpire called");
},
});
const completedTest = useSelector(completedTestSelector);
const startTesting = () => {

View File

@ -1,15 +1,12 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import {
answersSelector,
fetchGetAnswers,
fetchUserAnswerOne,
fetchUserAnswersMany,
fetchGetAnswers, // fetchUserAnswerOne,
// fetchUserAnswersMany,
questionsSelector,
selectedTest,
setAnswers,
selectedTest, // setAnswers,
setCompleteTest,
} from "@redux/quizSlice";
@ -18,12 +15,11 @@ import { apiRequest } from "@api/request";
import questionIcon from "assets/images/question.png";
import { GetOptionTask } from "./GetOptionTask";
import { HeaderQuiz } from "./HeaderQuiz";
import { Progressbar } from "./ProgressbarQuiz";
// import { HeaderQuiz } from "./HeaderQuiz";
// import { Progressbar } from "./ProgressbarQuiz";
import "./quiz.scss";
export const TaskQuiz = () => {
const navigate = useNavigate();
const dispatch = useDispatch();
const answers = useSelector(answersSelector);
@ -42,7 +38,6 @@ export const TaskQuiz = () => {
// .then(json => console.log(json))
apiRequest(`/question/get-questions?uuid=${dataTest.uuid}`).then(
(response) => {
console.log(response);
dispatch(fetchGetAnswers(response[0].id));
setStripValue(((+index + 1) * 100) / response.length);
}