diff --git a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx index 35d55407..99475330 100644 --- a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx +++ b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; +import { getProfileInfo } from "@redux/outstaffingSlice"; import { addPersonToProject, editColumnName, @@ -16,8 +17,6 @@ import { setProjectBoardFetch, } from "@redux/projectsTrackerSlice"; -import {getProfileInfo} from "@redux/outstaffingSlice"; - import { urlForLocal } from "@utils/helper"; import { apiRequest } from "@api/request"; @@ -37,7 +36,7 @@ export const TrackerModal = ({ titleProject, projectId, priorityTask, - projectUsers + projectUsers, }) => { const dispatch = useDispatch(); const projectBoard = useSelector(getProjectBoard); @@ -58,8 +57,10 @@ export const TrackerModal = ({ const [selectColumnPriority, setSelectColumnPriority] = useState( "Выберите приоритет колонки" ); - const [selectedExecutorTask, setSelectedExecutorTask] = useState('Выберите исполнителя задачи') - const [selectExecutorTaskOpen, setSelectExecutorTaskOpen] = useState(false) + const [selectedExecutorTask, setSelectedExecutorTask] = useState( + "Выберите исполнителя задачи" + ); + const [selectExecutorTaskOpen, setSelectExecutorTaskOpen] = useState(false); const [correctProjectUsers, setCorrectProjectUsers] = useState([]); const [selectColumnPriorityOpen, setSelectColumnPriorityOpen] = useState(false); @@ -114,8 +115,8 @@ export const TrackerModal = ({ setActive(false); setValueTiket(""); setDescriptionTicket(""); - setSelectedExecutorTask('Выберите исполнителя задачи') - }) + setSelectedExecutorTask("Выберите исполнителя задачи"); + }); } else { setActive(false); setValueTiket(""); @@ -237,9 +238,13 @@ export const TrackerModal = ({ }) : ""; if ( - localStorage.getItem("role_status") !== "18" && projectUsers && Boolean(!projectUsers.find((item) => item.user_id === profileInfo.id_user)) + localStorage.getItem("role_status") !== "18" && + projectUsers && + Boolean( + !projectUsers.find((item) => item.user_id === profileInfo.id_user) + ) ) { - setCorrectProjectUsers( [ + setCorrectProjectUsers([ ...projectUsers, { user: { @@ -250,7 +255,7 @@ export const TrackerModal = ({ }, ]); } else { - setCorrectProjectUsers(projectUsers) + setCorrectProjectUsers(projectUsers); } }, [active]); @@ -341,32 +346,52 @@ export const TrackerModal = ({ />