tracker-tasks

This commit is contained in:
Николай Полтщук 2023-06-29 03:41:59 +03:00
parent 6f534bb82b
commit 4180cb5858
3 changed files with 59 additions and 64 deletions

View File

@ -25,9 +25,9 @@ import file from "assets/icons/fileModal.svg";
import link from "assets/icons/link.svg"; import link from "assets/icons/link.svg";
import send from "assets/icons/send.svg"; import send from "assets/icons/send.svg";
import watch from "assets/icons/watch.svg"; import watch from "assets/icons/watch.svg";
import avatarMok from "assets/images/avatarMok.png";
import "./modalTicket.scss"; import "./modalTicket.scss";
import avatarMok from "assets/images/avatarMok.png";
export const ModalTiсket = ({ export const ModalTiсket = ({
active, active,
@ -472,11 +472,10 @@ export const ModalTiсket = ({
<p>Исполнитель: {executor.fio}</p> <p>Исполнитель: {executor.fio}</p>
<img <img
src={ src={
executor?.avatar executor?.avatar ? urlForLocal(executor.avatar) : avatarMok
? urlForLocal(executor.avatar)
: avatarMok
} }
alt="avatar" /> alt="avatar"
/>
<img <img
src={close} src={close}
className="delete" className="delete"
@ -513,7 +512,7 @@ export const ModalTiсket = ({
? urlForLocal(person.user.avatar) ? urlForLocal(person.user.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
</div> </div>
); );
@ -537,7 +536,7 @@ export const ModalTiсket = ({
? urlForLocal(member.avatar) ? urlForLocal(member.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
<img <img
src={close} src={close}
@ -581,7 +580,7 @@ export const ModalTiсket = ({
? urlForLocal(person.user.avatar) ? urlForLocal(person.user.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
</div> </div>
); );

View File

@ -7,8 +7,9 @@ import { Link, useNavigate, useParams } from "react-router-dom";
import { import {
deletePersonOnProject, deletePersonOnProject,
getBoarderLoader, getBoarderLoader,
modalToggle, setProjectBoardFetch, modalToggle,
setToggleTab setProjectBoardFetch,
setToggleTab,
} from "@redux/projectsTrackerSlice"; } from "@redux/projectsTrackerSlice";
import { getCorrectRequestDate, urlForLocal } from "@utils/helper"; import { getCorrectRequestDate, urlForLocal } from "@utils/helper";
@ -47,7 +48,7 @@ export const TicketFullScreen = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const navigate = useNavigate(); const navigate = useNavigate();
const boardLoader = useSelector(getBoarderLoader); const boardLoader = useSelector(getBoarderLoader);
const [projectInfo, setProjectInfo] = useState({}) const [projectInfo, setProjectInfo] = useState({});
const [taskInfo, setTaskInfo] = useState({}); const [taskInfo, setTaskInfo] = useState({});
const [editOpen, setEditOpen] = useState(false); const [editOpen, setEditOpen] = useState(false);
const [inputsValue, setInputsValue] = useState({}); const [inputsValue, setInputsValue] = useState({});
@ -112,10 +113,12 @@ export const TicketFullScreen = () => {
} }
}); });
}); });
apiRequest(`/project/get-project?project_id=${taskInfo.project_id}&expand=columns`).then((res) => { apiRequest(
setProjectInfo(res) `/project/get-project?project_id=${taskInfo.project_id}&expand=columns`
setCorrectProjectUsers(res.projectUsers) ).then((res) => {
}) setProjectInfo(res);
setCorrectProjectUsers(res.projectUsers);
});
setLoader(boardLoader); setLoader(boardLoader);
}); });
}, []); }, []);
@ -307,8 +310,8 @@ export const TicketFullScreen = () => {
setTaskInfo((prevState) => ({ setTaskInfo((prevState) => ({
...prevState, ...prevState,
executor_id: null, executor_id: null,
executor: null executor: null,
})) }));
}); });
} }
@ -324,8 +327,8 @@ export const TicketFullScreen = () => {
setTaskInfo((prevState) => ({ setTaskInfo((prevState) => ({
...prevState, ...prevState,
executor_id: res.executor_id, executor_id: res.executor_id,
executor: res.executor executor: res.executor,
})) }));
}); });
} }
@ -339,8 +342,10 @@ export const TicketFullScreen = () => {
}).then(() => { }).then(() => {
setTaskInfo((prevState) => ({ setTaskInfo((prevState) => ({
...prevState, ...prevState,
taskUsers: taskInfo.taskUsers.filter((item) => item.user_id !== person.user_id) taskUsers: taskInfo.taskUsers.filter(
})) (item) => item.user_id !== person.user_id
),
}));
}); });
} }
@ -355,7 +360,7 @@ export const TicketFullScreen = () => {
setDropListMembersOpen(false); setDropListMembersOpen(false);
setTaskInfo((prevValue) => ({ setTaskInfo((prevValue) => ({
...prevValue, ...prevValue,
taskUsers: [...prevValue.taskUsers, res] taskUsers: [...prevValue.taskUsers, res],
})); }));
}); });
} }
@ -422,12 +427,7 @@ export const TicketFullScreen = () => {
)} )}
<div className="projectPersons"> <div className="projectPersons">
{projectInfo.projectUsers?.length && {projectInfo.projectUsers?.length &&
projectInfo.projectUsers projectInfo.projectUsers.slice(0, 3).map((person) => {
.slice(
0,
3
)
.map((person) => {
return ( return (
<img <img
key={person.user_id} key={person.user_id}
@ -634,7 +634,8 @@ export const TicketFullScreen = () => {
? urlForLocal(taskInfo.executor.avatar) ? urlForLocal(taskInfo.executor.avatar)
: avatarMok : avatarMok
} }
alt="avatar" /> alt="avatar"
/>
<img <img
src={close} src={close}
className="delete" className="delete"
@ -671,7 +672,7 @@ export const TicketFullScreen = () => {
? urlForLocal(person.user.avatar) ? urlForLocal(person.user.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
</div> </div>
); );
@ -694,7 +695,7 @@ export const TicketFullScreen = () => {
? urlForLocal(member.avatar) ? urlForLocal(member.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
<img <img
src={close} src={close}
@ -737,7 +738,7 @@ export const TicketFullScreen = () => {
? urlForLocal(person.user.avatar) ? urlForLocal(person.user.avatar)
: avatarMok : avatarMok
} }
alt='avatar' alt="avatar"
/> />
</div> </div>
); );

View File

@ -327,12 +327,7 @@ export const ProjectTracker = () => {
)} )}
<div className="projectPersons"> <div className="projectPersons">
{projectBoard.projectUsers?.length && {projectBoard.projectUsers?.length &&
projectBoard.projectUsers projectBoard.projectUsers.slice(0, 3).map((person) => {
.slice(
0,
3
)
.map((person) => {
return ( return (
<img <img
key={person.user_id} key={person.user_id}