diff --git a/src/api/request.js b/src/api/request.js index 2e90024d..aefaf36f 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -19,7 +19,7 @@ export const apiRequest = ( "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", }, - } = {}, + } = {} ) => { const fullHeaders = { ...headers, ...getToken() }; let urWithParams = urlHasParams(url); @@ -41,7 +41,7 @@ export const apiRequest = ( // dispatch(auth(false)); } return resolve(response); - }), + }) ) .then((response) => new Promise((resolve) => resolve(response.data))); }; diff --git a/src/components/AuthBox/AuthBox.jsx b/src/components/AuthBox/AuthBox.jsx index e1c4f31b..855d8cc8 100644 --- a/src/components/AuthBox/AuthBox.jsx +++ b/src/components/AuthBox/AuthBox.jsx @@ -63,7 +63,7 @@ export const AuthBox = ({ title }) => { localStorage.setItem("role_status", res.status); localStorage.setItem( "access_token_expired_at", - res.access_token_expired_at, + res.access_token_expired_at ); dispatch(auth(true)); dispatch(setUserInfo(res)); diff --git a/src/components/Calendar/CalendarComponent.jsx b/src/components/Calendar/CalendarComponent.jsx index 59c58674..18943d90 100644 --- a/src/components/Calendar/CalendarComponent.jsx +++ b/src/components/Calendar/CalendarComponent.jsx @@ -89,7 +89,7 @@ const CalendarComponent = ({ onSelect }) => { {currentMonthAndDay(day)} - )), + )) )} diff --git a/src/components/Calendar/calendarHelper.js b/src/components/Calendar/calendarHelper.js index e0b8af47..3ee0de81 100644 --- a/src/components/Calendar/calendarHelper.js +++ b/src/components/Calendar/calendarHelper.js @@ -17,7 +17,7 @@ export function calendarHelper(value) { calendar.push( Array(1) .fill(0) - .map(() => day.add(1, "day").clone()), + .map(() => day.add(1, "day").clone()) ); } @@ -45,7 +45,7 @@ export function getReports(value) { export function getCreatedDate(day) { if (day) { return `${new Date(day).getFullYear()}-${correctDay( - new Date(day).getMonth() + 1, + new Date(day).getMonth() + 1 )}-${correctDay(new Date(day).getDate())}`; } else { const date = new Date(); diff --git a/src/components/Candidate/Candidate.jsx b/src/components/Candidate/Candidate.jsx index dd0adbf8..b7a4126c 100644 --- a/src/components/Candidate/Candidate.jsx +++ b/src/components/Candidate/Candidate.jsx @@ -48,7 +48,7 @@ const Candidate = () => { useEffect(() => { apiRequest(`/user/me`, {}).then((el) => - dispatch(currentCandidate(el.userCard)), + dispatch(currentCandidate(el.userCard)) ); }, [dispatch]); diff --git a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx index bf4b7029..d4286bcd 100644 --- a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx +++ b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx @@ -70,7 +70,7 @@ export const ModalTiсket = ({ const [deadLine, setDeadLine] = useState(task.dead_line); const [datePickerOpen, setDatePickerOpen] = useState(false); const [startDate, setStartDate] = useState( - task.dead_line ? new Date(task.dead_line) : new Date(), + task.dead_line ? new Date(task.dead_line) : new Date() ); const [dropListOpen, setDropListOpen] = useState(false); const [dropListMembersOpen, setDropListMembersOpen] = useState(false); @@ -190,7 +190,7 @@ export const ModalTiсket = ({ function commentDelete(comment) { setComments((prevValue) => - prevValue.filter((item) => item.id !== comment.id), + prevValue.filter((item) => item.id !== comment.id) ); if (comment.subComments.length) { // promiseAll @@ -221,7 +221,7 @@ export const ModalTiсket = ({ deleteSubComment.forEach((comment, index) => { if (comment.id === subComment.parent_id) { deleteSubComment[index].subComments = comment.subComments.filter( - (item) => item.id !== subComment.id, + (item) => item.id !== subComment.id ); } }); @@ -328,7 +328,7 @@ export const ModalTiсket = ({ useEffect(() => { initListeners(); apiRequest( - `/comment/get-by-entity?entity_type=2&entity_id=${task.id}`, + `/comment/get-by-entity?entity_type=2&entity_id=${task.id}` ).then((res) => { const comments = res.reduce((acc, cur) => { if (!cur.parent_id) { @@ -362,7 +362,7 @@ export const ModalTiсket = ({ setTimerInfo(time); } }); - }, + } ); apiRequest(`/file/get-by-entity?entity_type=2&entity_id=${task.id}`).then( @@ -370,15 +370,15 @@ export const ModalTiсket = ({ if (Array.isArray(res)) { setTaskFiles(res); } - }, + } ); if ( localStorage.getItem("role_status") !== "18" && Boolean( !correctProjectUsers.find( - (item) => item.user_id === profileInfo.id_user, - ), + (item) => item.user_id === profileInfo.id_user + ) ) ) { setCorrectProjectUsers((prevState) => [ @@ -400,7 +400,7 @@ export const ModalTiсket = ({ projectMarks.reduce((acc, cur) => { if (!tagIds.includes(cur.id)) acc.push(cur); return acc; - }, []), + }, []) ); }, [taskTags]); @@ -440,7 +440,7 @@ export const ModalTiсket = ({ function deleteFile(file) { setTaskFiles((prevValue) => - prevValue.filter((item) => item.id !== file.id), + prevValue.filter((item) => item.id !== file.id) ); } @@ -448,7 +448,7 @@ export const ModalTiсket = ({ setTimerId( setInterval(() => { run(); - }, 1000), + }, 1000) ); } @@ -485,13 +485,13 @@ export const ModalTiсket = ({ projectUsers.reduce((acc, cur) => { if (!ids.includes(cur.user_id)) acc.push(cur); return acc; - }, []), + }, []) ); }, [members]); function copyTicketLink() { navigator.clipboard.writeText( - `https://itguild.info/tracker/task/${task.id}`, + `https://itguild.info/tracker/task/${task.id}` ); showNotification({ show: true, @@ -558,7 +558,7 @@ export const ModalTiсket = ({ (div) => div.classList && (div.classList.contains("button-add-worker") || - div.classList.contains("dropdownList")), + div.classList.contains("dropdownList")) ) ) { setDropListOpen(false); @@ -571,7 +571,7 @@ export const ModalTiсket = ({ (div) => div.classList && (div.classList.contains("deadLine") || - div.classList.contains("react-datepicker-popper")), + div.classList.contains("react-datepicker-popper")) ) ) { setDatePickerOpen(false); @@ -583,7 +583,7 @@ export const ModalTiсket = ({ (div) => div.classList && (div.classList.contains("tags") || - div.classList.contains("tags__dropDown")), + div.classList.contains("tags__dropDown")) ) ) { setSelectTagsOpen(false); diff --git a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx index be29b703..e948f1f9 100644 --- a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx +++ b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx @@ -128,7 +128,7 @@ export const TicketFullScreen = () => { setDeadLine(taskInfo.dead_line); setTaskPriority(taskInfo.execution_priority); setStartDate( - taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date(), + taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date() ); setInputsValue({ title: taskInfo.title, @@ -137,7 +137,7 @@ export const TicketFullScreen = () => { }); setTaskTags(taskInfo.mark); apiRequest( - `/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`, + `/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` ).then((res) => { const comments = res.reduce((acc, cur) => { if (!cur.parent_id) { @@ -152,14 +152,14 @@ export const TicketFullScreen = () => { setComments(comments); }); apiRequest( - `/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`, + `/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` ).then((res) => { if (Array.isArray(res)) { setTaskFiles(res); } }); apiRequest( - `/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`, + `/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` ).then((res) => { let timerSeconds = 0; res.length && @@ -181,13 +181,13 @@ export const TicketFullScreen = () => { }); }); apiRequest( - `/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark`, + `/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark` ).then((res) => { setProjectInfo(res); setCorrectProjectUsers(res.projectUsers); }); setLoader(boardLoader); - }, + } ); }, []); @@ -198,7 +198,7 @@ export const TicketFullScreen = () => { projectInfo.mark.reduce((acc, cur) => { if (!tagIds.includes(cur.id)) acc.push(cur); return acc; - }, []), + }, []) ); } }, [taskTags, projectInfo]); @@ -306,7 +306,7 @@ export const TicketFullScreen = () => { function commentDelete(comment) { setComments((prevValue) => - prevValue.filter((item) => item.id !== comment.id), + prevValue.filter((item) => item.id !== comment.id) ); if (comment.subComments.length) { comment.subComments.forEach((subComment) => { @@ -336,7 +336,7 @@ export const TicketFullScreen = () => { deleteSubComment.forEach((comment, index) => { if (comment.id === subComment.parent_id) { deleteSubComment[index].subComments = comment.subComments.filter( - (item) => item.id !== subComment.id, + (item) => item.id !== subComment.id ); } }); @@ -349,7 +349,7 @@ export const TicketFullScreen = () => { function copyTicketLink() { navigator.clipboard.writeText( - `https://itguild.info/tracker/task/${taskInfo.id}`, + `https://itguild.info/tracker/task/${taskInfo.id}` ); } @@ -357,7 +357,7 @@ export const TicketFullScreen = () => { setTimerId( setInterval(() => { run(); - }, 1000), + }, 1000) ); } @@ -368,7 +368,7 @@ export const TicketFullScreen = () => { projectInfo.projectUsers.reduce((acc, cur) => { if (!ids.includes(cur.user_id)) acc.push(cur); return acc; - }, []), + }, []) ); } }, [taskInfo.taskUsers, projectInfo]); @@ -444,7 +444,7 @@ export const TicketFullScreen = () => { setTaskInfo((prevState) => ({ ...prevState, taskUsers: taskInfo.taskUsers.filter( - (item) => item.user_id !== person.user_id, + (item) => item.user_id !== person.user_id ), })); }); @@ -538,7 +538,7 @@ export const TicketFullScreen = () => { function deleteFile(file) { setTaskFiles((prevValue) => - prevValue.filter((item) => item.id !== file.id), + prevValue.filter((item) => item.id !== file.id) ); } @@ -586,7 +586,7 @@ export const TicketFullScreen = () => { (div) => div.classList && (div.classList.contains("button-add-worker") || - div.classList.contains("dropdownList")), + div.classList.contains("dropdownList")) ) ) { setDropListOpen(false); @@ -599,7 +599,7 @@ export const TicketFullScreen = () => { (div) => div.classList && (div.classList.contains("deadLine") || - div.classList.contains("react-datepicker-popper")), + div.classList.contains("react-datepicker-popper")) ) ) { setDatePickerOpen(false); @@ -611,7 +611,7 @@ export const TicketFullScreen = () => { (div) => div.classList && (div.classList.contains("tags") || - div.classList.contains("tags__dropDown")), + div.classList.contains("tags__dropDown")) ) ) { setSelectTagsOpen(false); @@ -623,7 +623,7 @@ export const TicketFullScreen = () => { (div) => div.classList && (div.classList.contains("addPerson") || - div.classList.contains("persons__list")), + div.classList.contains("persons__list")) ) ) { setPersonListOpen(false); diff --git a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx index 560f2054..eb6675ac 100644 --- a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx +++ b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx @@ -71,10 +71,10 @@ export const TrackerModal = ({ const [selectWorkersOpen, setSelectWorkersOpen] = useState(false); const [selectedWorker, setSelectedWorker] = useState(null); const [selectColumnPriority, setSelectColumnPriority] = useState( - "Выберите приоритет колонки", + "Выберите приоритет колонки" ); const [selectedExecutorTask, setSelectedExecutorTask] = useState( - "Выберите исполнителя задачи", + "Выберите исполнителя задачи" ); const [selectExecutorTaskOpen, setSelectExecutorTaskOpen] = useState(false); const [correctProjectUsers, setCorrectProjectUsers] = useState([]); @@ -316,7 +316,7 @@ export const TrackerModal = ({ persons.reduce((acc, cur) => { if (!ids.includes(cur.user_id)) acc.push(cur); return acc; - }, []), + }, []) ); }) : ""; @@ -324,7 +324,7 @@ export const TrackerModal = ({ localStorage.getItem("role_status") !== "18" && projectUsers && Boolean( - !projectUsers.find((item) => item.user_id === profileInfo.id_user), + !projectUsers.find((item) => item.user_id === profileInfo.id_user) ) ) { setCorrectProjectUsers([ @@ -350,7 +350,7 @@ export const TrackerModal = ({ projectMarks.reduce((acc, cur) => { if (!tagIds.includes(cur.id)) acc.push(cur); return acc; - }, []), + }, []) ); } }, [taskTags, projectMarks]); @@ -368,7 +368,7 @@ export const TrackerModal = ({ (div) => div.classList && (div.classList.contains("tags__selected__name") || - div.classList.contains("tags__dropDown")), + div.classList.contains("tags__dropDown")) ) ) { setSelectTagsOpen(false); @@ -380,7 +380,7 @@ export const TrackerModal = ({ (div) => div.classList && (div.classList.contains("select__executor") || - div.classList.contains("select__executor__dropDown")), + div.classList.contains("select__executor__dropDown")) ) ) { setSelectExecutorTaskOpen(false); @@ -555,8 +555,8 @@ export const TrackerModal = ({ onClick={() => setTaskTags((prevState) => prevState.filter( - (prevTag) => prevTag.id !== tag.id, - ), + (prevTag) => prevTag.id !== tag.id + ) ) } /> diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index 4d0ec579..0239ec47 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -15,7 +15,7 @@ export const Navigation = () => { const profileInfo = useSelector(getProfileInfo); const [user] = useState( - localStorage.getItem("role_status") === "18" ? "partner" : "developer", + localStorage.getItem("role_status") === "18" ? "partner" : "developer" ); const [navInfo] = useState({ @@ -79,9 +79,9 @@ export const Navigation = () => { apiRequest(`/user/me`).then((profileInfo) => dispatch( setProfileInfo( - profileInfo.userCard ? profileInfo.userCard : profileInfo, - ), - ), + profileInfo.userCard ? profileInfo.userCard : profileInfo + ) + ) ); }, [dispatch]); diff --git a/src/components/ProfileCalendar/ProfileCalendar.jsx b/src/components/ProfileCalendar/ProfileCalendar.jsx index 21fb6e62..4a7078f9 100644 --- a/src/components/ProfileCalendar/ProfileCalendar.jsx +++ b/src/components/ProfileCalendar/ProfileCalendar.jsx @@ -64,8 +64,8 @@ export const ProfileCalendar = () => { } apiRequest( `/reports/reports-by-date?${requestDates}&user_card_id=${localStorage.getItem( - "cardId", - )}`, + "cardId" + )}` ).then((reports) => { let spendTime = 0; for (const report of reports) { diff --git a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx index 5ca45e6e..f79c3c7b 100644 --- a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx +++ b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx @@ -86,7 +86,7 @@ export const ProfileCalendarComponent = React.memo( for (const date of reports) { if ( `${new Date(day).getFullYear()}-${correctDay( - new Date(day).getMonth() + 1, + new Date(day).getMonth() + 1 )}-${correctDay(new Date(day).getDate())}` === date.created_at ) { return `before`; @@ -101,7 +101,7 @@ export const ProfileCalendarComponent = React.memo( for (const date of reports) { if ( `${new Date(day).getFullYear()}-${correctDay( - new Date(day).getMonth() + 1, + new Date(day).getMonth() + 1 )}-${correctDay(new Date(day).getDate())}` === date.created_at ) { return "#"; @@ -122,15 +122,15 @@ export const ProfileCalendarComponent = React.memo( const requestDates = startDate < endDay ? `fromDate=${getCorrectYYMMDD( - startDate._d, + startDate._d )}&toDate=${getCorrectYYMMDD(endDay._d)}` : `fromDate=${getCorrectYYMMDD(endDay._d)}&toDate=${getCorrectYYMMDD( - startDate._d, + startDate._d )}`; apiRequest( `/reports/reports-by-date?${requestDates}&user_card_id=${localStorage.getItem( - "cardId", - )}`, + "cardId" + )}` ).then((reports) => { let spendTime = 0; for (const report of reports) { @@ -298,7 +298,7 @@ export const ProfileCalendarComponent = React.memo( {currentMonthAndDay(day)} - )), + )) )} @@ -316,15 +316,15 @@ export const ProfileCalendarComponent = React.memo( ? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}` : `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}` : activePeriod - ? "Выберите диапазон на календаре" - : "Выбрать диапазон"} + ? "Выберите диапазон на календаре" + : "Выбрать диапазон"} {totalRangeHours ? `${totalRangeHours} ${hourOfNum(totalRangeHours)}` : endDate - ? "0 часов" - : ""} + ? "0 часов" + : ""} {endDate && ( } ); - }, + } ); diff --git a/src/components/ProfileHeader/ProfileHeader.jsx b/src/components/ProfileHeader/ProfileHeader.jsx index 27847c93..6a692b1c 100644 --- a/src/components/ProfileHeader/ProfileHeader.jsx +++ b/src/components/ProfileHeader/ProfileHeader.jsx @@ -15,7 +15,7 @@ export const ProfileHeader = () => { const dispatch = useDispatch(); const profileInfo = useSelector(getProfileInfo); const [user] = useState( - localStorage.getItem("role_status") === "18" ? "partner" : "developer", + localStorage.getItem("role_status") === "18" ? "partner" : "developer" ); const [isLoggingOut, setIsLoggingOut] = useState(false); @@ -30,8 +30,8 @@ export const ProfileHeader = () => { apiRequest(`/user/me`).then((profileInfo) => { dispatch( setProfileInfo( - profileInfo.userCard ? profileInfo.userCard : profileInfo, - ), + profileInfo.userCard ? profileInfo.userCard : profileInfo + ) ); }); }, [dispatch]); diff --git a/src/components/ProjectTiket/ProjectTiket.jsx b/src/components/ProjectTiket/ProjectTiket.jsx index 09faa0a7..0c24b3fd 100644 --- a/src/components/ProjectTiket/ProjectTiket.jsx +++ b/src/components/ProjectTiket/ProjectTiket.jsx @@ -46,7 +46,7 @@ export const ProjectTiket = ({ project, index }) => { event && !path.find( (div) => - div.classList && div.classList.contains(`project-${project.id}`), + div.classList && div.classList.contains(`project-${project.id}`) ) ) { setModalSelect(false); @@ -91,7 +91,7 @@ export const ProjectTiket = ({ project, index }) => { {project.columns.reduce( (accumulator, currentValue) => accumulator + currentValue.tasks.length, - 0, + 0 )} # diff --git a/src/components/ReportForm/ReportForm.jsx b/src/components/ReportForm/ReportForm.jsx index 4a01dc39..9cc9fd93 100644 --- a/src/components/ReportForm/ReportForm.jsx +++ b/src/components/ReportForm/ReportForm.jsx @@ -43,7 +43,7 @@ const ReportForm = () => { const [isFetching, setIsFetching] = useState(false); const [reportSuccess, setReportSuccess] = useState(""); const [startDate, setStartDate] = useState( - reportDate ? new Date(reportDate._d) : new Date(), + reportDate ? new Date(reportDate._d) : new Date() ); const [datePickerOpen, setDatePickerOpen] = useState(false); @@ -73,7 +73,7 @@ const ReportForm = () => { (div) => div.classList && (div.classList.contains("report-form__block-img") || - div.classList.contains("react-datepicker-popper")), + div.classList.contains("react-datepicker-popper")) ) ) { setDatePickerOpen(false); @@ -210,7 +210,7 @@ const ReportForm = () => { task: e.target.value, } : input; - }), + }) ) } /> @@ -236,7 +236,7 @@ const ReportForm = () => { hours_spent: Number(e.target.value), } : input; - }), + }) ) } /> diff --git a/src/components/ShortReport/ShortReport.jsx b/src/components/ShortReport/ShortReport.jsx index 107f3fe0..7b45da0c 100644 --- a/src/components/ShortReport/ShortReport.jsx +++ b/src/components/ShortReport/ShortReport.jsx @@ -40,8 +40,8 @@ export const ShortReport = () => { setTotalHours(0); apiRequest( `reports/find-by-date?user_card_id=${localStorage.getItem( - "cardId", - )}&date=${day}`, + "cardId" + )}&date=${day}` ).then((res) => { let spendTime = 0; for (const item of res) { diff --git a/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx b/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx index cd6dfdf8..bba1e559 100644 --- a/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx +++ b/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx @@ -28,7 +28,7 @@ export const TrackerSelectColumn = ({ columns, task, currentColumn }) => { moveProjectTask({ startWrapperIndex: { index: currentColumn.id, task }, columnId: column.id, - }), + }) ); }} > diff --git a/src/components/features/quiz/Results.jsx b/src/components/features/quiz/Results.jsx index 927e0fcd..1180d4d9 100644 --- a/src/components/features/quiz/Results.jsx +++ b/src/components/features/quiz/Results.jsx @@ -14,7 +14,7 @@ export const Results = () => { useEffect(() => { dispatch(fetchResultTest(test.uuid)); apiRequest( - `/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}`, + `/user-questionnaire/get-points-number?user_questionnaire_uuid=${test.uuid}` ).then((res) => setMaxScore(res.sum_point)); }, [apiRequest, dispatch, test]); diff --git a/src/components/features/quiz/Task.js b/src/components/features/quiz/Task.js index d1d94686..a07faa65 100644 --- a/src/components/features/quiz/Task.js +++ b/src/components/features/quiz/Task.js @@ -40,7 +40,7 @@ export const TaskQuiz = () => { (response) => { dispatch(fetchGetAnswers(response[0].id)); setStripValue(((+index + 1) * 100) / response.length); - }, + } ); }, [dispatch]); diff --git a/src/index.js b/src/index.js index cedc262f..d03a525d 100644 --- a/src/index.js +++ b/src/index.js @@ -9,5 +9,5 @@ import { store } from "./store/store"; ReactDOM.createRoot(document.getElementById("root")).render( - , + ); diff --git a/src/pages/Home/Home.jsx b/src/pages/Home/Home.jsx index fa376cb8..9f96970e 100644 --- a/src/pages/Home/Home.jsx +++ b/src/pages/Home/Home.jsx @@ -43,7 +43,7 @@ const Home = () => { const tempTags = values.map((value, index) => value.map((val) => { return { id: val.id, value: val.tags, name: keys[index] }; - }), + }) ); dispatch(tags(tempTags)); }); diff --git a/src/pages/PartnerAddRequest/PartnerAddRequest.js b/src/pages/PartnerAddRequest/PartnerAddRequest.js index 4aee4b4c..40f40cc7 100644 --- a/src/pages/PartnerAddRequest/PartnerAddRequest.js +++ b/src/pages/PartnerAddRequest/PartnerAddRequest.js @@ -40,11 +40,11 @@ export const PartnerAddRequest = () => { const [editRequest, setEditRequest] = useState(false); const [selectedSkills, setSelectedSkills] = useState([]); const [selectedSpecialization, setSelectedSpecialization] = useState( - "Выберите специализацию", + "Выберите специализацию" ); const [selectedLevel, setSelectedLevel] = useState("Выберите уровень"); const [selectedCount, setSelectedCount] = useState( - "Выберите кол-во сотрудников", + "Выберите кол-во сотрудников" ); const [inputs, setInputs] = useState({ title: "", description: "" }); @@ -57,7 +57,7 @@ export const PartnerAddRequest = () => { useEffect(() => { apiRequest(`/profile/positions-list`).then((el) => - setSpecializationList(el), + setSpecializationList(el) ); apiRequest(`/profile/level-list`).then((el) => setLevelList(el)); apiRequest(`/skills/get-skills-list`).then((el) => { @@ -247,7 +247,7 @@ export const PartnerAddRequest = () => { setSelectedSkills( selectedSkills.filter((skill, indexSkill) => { return indexSkill !== index; - }), + }) ); }} /> @@ -263,7 +263,7 @@ export const PartnerAddRequest = () => { return skill.name .toLowerCase() .includes(e.target.value.toLowerCase()); - }), + }) ); }} /> @@ -282,12 +282,12 @@ export const PartnerAddRequest = () => { setFilteredSkills( filteredSkills.filter((skill, skillIndex) => { return skillIndex !== index; - }), + }) ); setSkills( skills.filter((initSkill) => { return initSkill.id !== skill.id; - }), + }) ); setOpenSkillsSelect(false); }} diff --git a/src/pages/PartnerBid/PartnerBid.jsx b/src/pages/PartnerBid/PartnerBid.jsx index c3cd0cf1..9d1a74db 100644 --- a/src/pages/PartnerBid/PartnerBid.jsx +++ b/src/pages/PartnerBid/PartnerBid.jsx @@ -140,8 +140,8 @@ export const PartnerBid = () => { partnerRequests[ partnerRequests.findIndex((el) => el.id === requestId) - 1 - ].id, - ), + ].id + ) ); }} > @@ -162,8 +162,8 @@ export const PartnerBid = () => { partnerRequests[ partnerRequests.findIndex((el) => el.id === requestId) + 1 - ].id, - ), + ].id + ) ); }} > diff --git a/src/pages/PartnerRequests/PartnerRequests.jsx b/src/pages/PartnerRequests/PartnerRequests.jsx index 54cca7fb..7cf2f776 100644 --- a/src/pages/PartnerRequests/PartnerRequests.jsx +++ b/src/pages/PartnerRequests/PartnerRequests.jsx @@ -33,8 +33,8 @@ export const PartnerRequests = () => { useEffect(() => { apiRequest( `/request/get-request-list?user_id=${localStorage.getItem( - "id", - )}&search_depth=3`, + "id" + )}&search_depth=3` ).then((el) => { setRequests(el); setLoader(false); diff --git a/src/pages/Profile/Profile.js b/src/pages/Profile/Profile.js index b9b82b05..25af6d3d 100644 --- a/src/pages/Profile/Profile.js +++ b/src/pages/Profile/Profile.js @@ -23,7 +23,7 @@ import "./profile.scss"; export const Profile = () => { const profileInfo = useSelector(getProfileInfo); const [user] = useState( - localStorage.getItem("role_status") === "18" ? "partner" : "developer", + localStorage.getItem("role_status") === "18" ? "partner" : "developer" ); const [profileItemsInfo] = useState({ developer: [ diff --git a/src/pages/ProjectTracker/ProjectTracker.js b/src/pages/ProjectTracker/ProjectTracker.js index e98a8f5d..3510b598 100644 --- a/src/pages/ProjectTracker/ProjectTracker.js +++ b/src/pages/ProjectTracker/ProjectTracker.js @@ -169,7 +169,7 @@ export const ProjectTracker = () => { startTask: startWrapperIndexTest.current.task, finishTask: task, finishIndex: finishTask, - }), + }) ); } @@ -207,7 +207,7 @@ export const ProjectTracker = () => { moveProjectTask({ startWrapperIndex: startWrapperIndexTest.current, columnId, - }), + }) ); } } @@ -382,7 +382,7 @@ export const ProjectTracker = () => { (div) => div.classList && (div.classList.contains("addPerson") || - div.classList.contains("persons__list")), + div.classList.contains("persons__list")) ) ) { setPersonListOpen(false); @@ -394,7 +394,7 @@ export const ProjectTracker = () => { (div) => div.classList && (div.classList.contains("tasks__head__executor") || - div.classList.contains("tasks__head__executorDropdown")), + div.classList.contains("tasks__head__executorDropdown")) ) ) { setSelectedExecutorOpen(false); @@ -406,7 +406,7 @@ export const ProjectTracker = () => { (div) => div.classList && (div.classList.contains("tasks__head__tags") || - div.classList.contains("tags__list")), + div.classList.contains("tags__list")) ) ) { setTags({ @@ -427,7 +427,7 @@ export const ProjectTracker = () => { (div) => div.classList && (div.classList.contains("board__head__more") || - div.classList.contains("column__select")), + div.classList.contains("column__select")) ) ) { setOpenColumnSelect((prevState) => { @@ -577,7 +577,7 @@ export const ProjectTracker = () => { {projectBoard.projectUsers?.length} {caseOfNum( projectBoard.projectUsers?.length, - "persons", + "persons" )}
@@ -880,7 +880,7 @@ export const ProjectTracker = () => { column.id, projectBoard?.columns && column.tasks.length ? column.tasks[0].priority - 1 - : 1, + : 1 ); }} > @@ -959,7 +959,7 @@ export const ProjectTracker = () => { onClick={() => { if (window.innerWidth < 985) { window.location.replace( - `/tracker/task/${task.id}`, + `/tracker/task/${task.id}` ); } }} @@ -1037,7 +1037,7 @@ export const ProjectTracker = () => { {task.comment_count}{" "} {caseOfNum( task.comment_count, - "comments", + "comments" )}
@@ -1051,7 +1051,7 @@ export const ProjectTracker = () => { item.id !== column.id, + (item) => item.id !== column.id )} currentColumn={column} task={task} diff --git a/src/pages/Summary/Summary.js b/src/pages/Summary/Summary.js index e254fcb2..86273214 100644 --- a/src/pages/Summary/Summary.js +++ b/src/pages/Summary/Summary.js @@ -34,7 +34,7 @@ export const Summary = () => { useEffect(() => { apiRequest( - `/profile/portfolio-projects?card_id=${localStorage.getItem("cardId")}`, + `/profile/portfolio-projects?card_id=${localStorage.getItem("cardId")}` ).then((responseGit) => setGitInfo(responseGit)); }, []); diff --git a/src/pages/Tracker/Tracker.jsx b/src/pages/Tracker/Tracker.jsx index 3e1dce17..73ef2440 100644 --- a/src/pages/Tracker/Tracker.jsx +++ b/src/pages/Tracker/Tracker.jsx @@ -57,8 +57,8 @@ export const Tracker = () => { setLoader(true); apiRequest( `/project/project-list?user_id=${localStorage.getItem( - "id", - )}&expand=columns`, + "id" + )}&expand=columns` ).then((el) => { dispatch(setAllProjects(el.projects)); setLoader(false); @@ -74,9 +74,7 @@ export const Tracker = () => { // }, [])) }); apiRequest( - `/task/get-user-tasks?user_id=${localStorage.getItem( - "id", - )}&expand=timers`, + `/task/get-user-tasks?user_id=${localStorage.getItem("id")}&expand=timers` ).then((el) => { const allTasks = el ? el.filter((item) => item.status !== 0) : []; const completedTasks = el ? el.filter((item) => item.status === 0) : []; @@ -105,7 +103,7 @@ export const Tracker = () => { ) { return item; } - }), + }) ); } @@ -123,7 +121,7 @@ export const Tracker = () => { ) { return item; } - }), + }) ); } @@ -207,7 +205,7 @@ export const Tracker = () => { {typeof projects === "object" && (!Boolean(projects.length) || !Boolean( - projects.filter((project) => project.status !== 10).length, + projects.filter((project) => project.status !== 10).length )) && !loader && (
@@ -473,7 +471,7 @@ export const Tracker = () => { ? "-" : task.timers.map((item) => { let time = new Date( - item.deltaSeconds * 1000, + item.deltaSeconds * 1000 ) .toISOString() .slice(11, 19); @@ -509,13 +507,13 @@ export const Tracker = () => { ${caseOfNum( projects.filter((project) => project.status === 10) .length, - "projects", + "projects" )}`}

{Boolean( - projects.filter((project) => project.status === 10).length, + projects.filter((project) => project.status === 10).length ) ? ( projects.map((project, index) => { return project.status === 10 ? ( diff --git a/src/pages/ViewReport/ViewReport.jsx b/src/pages/ViewReport/ViewReport.jsx index 8d55f0dd..b984f102 100644 --- a/src/pages/ViewReport/ViewReport.jsx +++ b/src/pages/ViewReport/ViewReport.jsx @@ -42,8 +42,8 @@ export const ViewReport = () => { setTomorrowTask([]); apiRequest( `reports/find-by-date?user_card_id=${localStorage.getItem( - "cardId", - )}&date=${day}`, + "cardId" + )}&date=${day}` ).then((res) => { let spendTime = 0; for (const item of res) { diff --git a/src/pages/quiz/QuizPage.js b/src/pages/quiz/QuizPage.js index 35f532a9..dac31b9f 100644 --- a/src/pages/quiz/QuizPage.js +++ b/src/pages/quiz/QuizPage.js @@ -103,7 +103,7 @@ export const QuizPage = () => { useEffect(() => { apiRequest( - `/user-questionnaire/questionnaires-list?user_id=${userId}`, + `/user-questionnaire/questionnaires-list?user_id=${userId}` ).then((res) => dispatch(setQuestionnaires(res))); }, []); diff --git a/src/redux/projectsTrackerSlice.js b/src/redux/projectsTrackerSlice.js index 724cb38b..6ec215c0 100644 --- a/src/redux/projectsTrackerSlice.js +++ b/src/redux/projectsTrackerSlice.js @@ -14,7 +14,7 @@ const initialState = { }; export const setProjectBoardFetch = createAsyncThunk("userInfo", (id) => - apiRequest(`/project/get-project?project_id=${id}&expand=columns,mark`), + apiRequest(`/project/get-project?project_id=${id}&expand=columns,mark`) ); export const projectsTrackerSlice = createSlice({ @@ -39,12 +39,12 @@ export const projectsTrackerSlice = createSlice({ }, deletePersonOnProject: (state, action) => { state.projectBoard.projectUsers = state.projectBoard.projectUsers.filter( - (person) => person.user_id !== action.payload, + (person) => person.user_id !== action.payload ); }, deleteTagProject: (state, action) => { state.projectBoard.mark = state.projectBoard.mark.filter( - (tag) => tag.id !== action.payload, + (tag) => tag.id !== action.payload ); }, addPersonToProject: (state, action) => { @@ -74,7 +74,7 @@ export const projectsTrackerSlice = createSlice({ } if (column.id === action.payload.startWrapperIndex.index) { state.projectBoard.columns[index].tasks = column.tasks.filter( - (task) => task.id !== action.payload.startWrapperIndex.task.id, + (task) => task.id !== action.payload.startWrapperIndex.task.id ); } }); @@ -83,7 +83,7 @@ export const projectsTrackerSlice = createSlice({ state.projectBoard.columns.forEach((column, index) => { if (column.id === action.payload.startTask.column_id) { state.projectBoard.columns[index].tasks = column.tasks.filter( - (task) => task.id !== action.payload.startTask.id, + (task) => task.id !== action.payload.startTask.id ); } if (column.id === action.payload.finishTask.column_id) { @@ -119,21 +119,21 @@ export const projectsTrackerSlice = createSlice({ filterCreatedByMe: (state, action) => { state.projectBoard.columns.forEach((column) => { column.tasks = column.tasks.filter( - (task) => task.user_id === action.payload, + (task) => task.user_id === action.payload ); }); }, filteredParticipateTasks: (state, action) => { state.projectBoard.columns.forEach((column) => { column.tasks = column.tasks.filter((task) => - task.taskUsers.some((person) => person.user_id === action.payload), + task.taskUsers.some((person) => person.user_id === action.payload) ); }); }, filteredExecutorTasks: (state, action) => { state.projectBoard.columns.forEach((column) => { column.tasks = column.tasks.filter( - (task) => task.executor_id === action.payload, + (task) => task.executor_id === action.payload ); }); }, diff --git a/src/redux/quizSlice.js b/src/redux/quizSlice.js index 9609a3b1..79264f9b 100644 --- a/src/redux/quizSlice.js +++ b/src/redux/quizSlice.js @@ -76,7 +76,7 @@ const initialState = { userInfo: null, }; export const setUserInfo = createAsyncThunk("userInfo", (id) => - apiRequest(`/profile/get-main-data?user_id=${id}`), + apiRequest(`/profile/get-main-data?user_id=${id}`) ); export const fetchUserAnswersMany = createAsyncThunk( @@ -85,7 +85,7 @@ export const fetchUserAnswersMany = createAsyncThunk( apiRequest("/user-response/set-responses", { method: "POST", data: { userResponses: checkedValues }, - }), + }) ); export const fetchUserAnswerOne = createAsyncThunk( @@ -94,17 +94,17 @@ export const fetchUserAnswerOne = createAsyncThunk( apiRequest("/user-response/set-response", { method: "POST", data: checkedValues[0], - }), + }) ); export const fetchGetAnswers = createAsyncThunk("answers", (question_id) => - apiRequest(`/answer/get-answers?question_id=${question_id}`), + apiRequest(`/answer/get-answers?question_id=${question_id}`) ); export const fetchResultTest = createAsyncThunk("result", (uuid) => apiRequest( - `/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}`, - ), + `/user-questionnaire/questionnaire-completed?user_questionnaire_uuid=${uuid}` + ) ); export const quizSlice = createSlice({ diff --git a/src/utils/helper.js b/src/utils/helper.js index ac0e0b6e..5c952c8e 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -89,6 +89,6 @@ export function caseOfNum(number, type) { export function copyProjectLink(projectId) { navigator.clipboard.writeText( - `https://itguild.info/tracker/project/${projectId}`, + `https://itguild.info/tracker/project/${projectId}` ); }