2023-05-04 18:38:56 +03:00
|
|
|
|
import React, { useEffect, useState } from "react";
|
2023-05-24 19:23:24 +03:00
|
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
2023-05-31 08:36:15 +03:00
|
|
|
|
import { Link, useNavigate, useParams } from "react-router-dom";
|
2023-05-30 10:10:34 +03:00
|
|
|
|
|
2023-05-23 23:02:39 +03:00
|
|
|
|
import {
|
|
|
|
|
deletePersonOnProject,
|
2023-05-31 08:36:15 +03:00
|
|
|
|
getBoarderLoader,
|
|
|
|
|
getProjectBoard,
|
2023-05-23 23:02:39 +03:00
|
|
|
|
modalToggle,
|
|
|
|
|
setProjectBoardFetch,
|
|
|
|
|
setToggleTab,
|
2023-05-30 10:10:34 +03:00
|
|
|
|
} from "@redux/projectsTrackerSlice";
|
2023-05-31 08:36:15 +03:00
|
|
|
|
|
2023-05-30 10:10:34 +03:00
|
|
|
|
import { urlForLocal } from "@utils/helper";
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-31 08:36:15 +03:00
|
|
|
|
import { apiRequest } from "@api/request";
|
|
|
|
|
|
|
|
|
|
import { getCorrectDate } from "@components/Calendar/calendarHelper";
|
|
|
|
|
import BaseButton from "@components/Common/BaseButton/BaseButton";
|
|
|
|
|
import { Footer } from "@components/Common/Footer/Footer";
|
|
|
|
|
import { Loader } from "@components/Common/Loader/Loader";
|
|
|
|
|
import TrackerModal from "@components/Modal/TrackerModal/TrackerModal";
|
|
|
|
|
import { Navigation } from "@components/Navigation/Navigation";
|
|
|
|
|
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
|
|
|
|
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
|
|
|
|
|
|
|
|
|
|
import archive2 from "assets/icons/archive.svg";
|
2023-05-30 10:10:34 +03:00
|
|
|
|
import archive from "assets/icons/archiveTracker.svg";
|
|
|
|
|
import arrow from "assets/icons/arrows/arrowCalendar.png";
|
2023-05-31 08:36:15 +03:00
|
|
|
|
import arrow2 from "assets/icons/arrows/arrowStart.png";
|
|
|
|
|
import selectArrow from "assets/icons/arrows/select.svg";
|
|
|
|
|
import close from "assets/icons/closeProjectPersons.svg";
|
2023-05-30 10:10:34 +03:00
|
|
|
|
import del from "assets/icons/delete.svg";
|
|
|
|
|
import edit from "assets/icons/edit.svg";
|
2023-05-31 08:36:15 +03:00
|
|
|
|
import file from "assets/icons/fileModal.svg";
|
|
|
|
|
import link from "assets/icons/link.svg";
|
|
|
|
|
import plus from "assets/icons/plus.svg";
|
|
|
|
|
import send from "assets/icons/send.svg";
|
|
|
|
|
import project from "assets/icons/trackerProject.svg";
|
|
|
|
|
import tasks from "assets/icons/trackerTasks.svg";
|
|
|
|
|
import watch from "assets/icons/watch.svg";
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
|
|
|
|
import "./ticketFullScreen.scss";
|
|
|
|
|
|
2023-05-31 11:24:46 +03:00
|
|
|
|
export const TicketFullScreen = () => {
|
2023-04-20 20:10:08 +03:00
|
|
|
|
const [modalAddWorker, setModalAddWorker] = useState(false);
|
2023-05-04 18:38:56 +03:00
|
|
|
|
const ticketId = useParams();
|
2023-05-02 18:51:19 +03:00
|
|
|
|
const dispatch = useDispatch();
|
2023-05-03 20:01:23 +03:00
|
|
|
|
const navigate = useNavigate();
|
2023-05-23 23:02:39 +03:00
|
|
|
|
const projectBoard = useSelector(getProjectBoard);
|
|
|
|
|
const boardLoader = useSelector(getBoarderLoader);
|
2023-05-04 18:38:56 +03:00
|
|
|
|
const [taskInfo, setTaskInfo] = useState({});
|
2023-05-16 00:24:52 +03:00
|
|
|
|
const [editOpen, setEditOpen] = useState(false);
|
2023-05-17 23:18:46 +03:00
|
|
|
|
const [inputsValue, setInputsValue] = useState({});
|
|
|
|
|
const [loader, setLoader] = useState(true);
|
|
|
|
|
const [comments, setComments] = useState([]);
|
2023-05-24 19:23:24 +03:00
|
|
|
|
const [commentsEditOpen, setCommentsEditOpen] = useState({});
|
|
|
|
|
const [commentsEditText, setCommentsEditText] = useState({});
|
|
|
|
|
const [personListOpen, setPersonListOpen] = useState(false);
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-03 20:01:23 +03:00
|
|
|
|
useEffect(() => {
|
|
|
|
|
apiRequest(`/task/get-task?task_id=${ticketId.id}`).then((taskInfo) => {
|
2023-05-04 18:38:56 +03:00
|
|
|
|
setTaskInfo(taskInfo);
|
2023-05-24 19:23:24 +03:00
|
|
|
|
setInputsValue({
|
|
|
|
|
title: taskInfo.title,
|
|
|
|
|
description: taskInfo.description,
|
|
|
|
|
comment: "",
|
|
|
|
|
});
|
|
|
|
|
apiRequest(
|
|
|
|
|
`/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}`
|
|
|
|
|
).then((res) => {
|
|
|
|
|
setComments(res);
|
2023-05-23 23:02:39 +03:00
|
|
|
|
res.forEach((item) => {
|
2023-05-24 19:23:24 +03:00
|
|
|
|
setCommentsEditOpen((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
[item.id]: false,
|
|
|
|
|
}));
|
|
|
|
|
setCommentsEditText((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
[item.id]: item.text,
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
});
|
2023-05-23 23:02:39 +03:00
|
|
|
|
dispatch(setProjectBoardFetch(taskInfo.project_id));
|
2023-05-24 19:23:24 +03:00
|
|
|
|
setLoader(boardLoader);
|
2023-05-04 18:38:56 +03:00
|
|
|
|
});
|
|
|
|
|
}, []);
|
2023-05-03 20:01:23 +03:00
|
|
|
|
|
|
|
|
|
function deleteTask() {
|
|
|
|
|
apiRequest("/task/update-task", {
|
|
|
|
|
method: "PUT",
|
|
|
|
|
data: {
|
|
|
|
|
task_id: ticketId.id,
|
|
|
|
|
status: 0,
|
|
|
|
|
},
|
2023-05-31 11:24:46 +03:00
|
|
|
|
}).then(() => {
|
2023-05-04 18:38:56 +03:00
|
|
|
|
navigate(`/tracker/project/${taskInfo.project_id}`);
|
2023-05-03 20:01:23 +03:00
|
|
|
|
});
|
|
|
|
|
}
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-16 00:24:52 +03:00
|
|
|
|
function editTask() {
|
|
|
|
|
apiRequest("/task/update-task", {
|
|
|
|
|
method: "PUT",
|
|
|
|
|
data: {
|
|
|
|
|
task_id: taskInfo.id,
|
|
|
|
|
title: inputsValue.title,
|
2023-05-24 19:23:24 +03:00
|
|
|
|
description: inputsValue.description,
|
2023-05-16 00:24:52 +03:00
|
|
|
|
},
|
2023-05-31 11:24:46 +03:00
|
|
|
|
}).then(() => {});
|
2023-05-16 00:24:52 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-23 23:02:39 +03:00
|
|
|
|
function createComment() {
|
2023-05-17 23:18:46 +03:00
|
|
|
|
apiRequest("/comment/create", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
data: {
|
|
|
|
|
text: inputsValue.comment,
|
|
|
|
|
entity_type: 2,
|
2023-05-24 19:23:24 +03:00
|
|
|
|
entity_id: taskInfo.id,
|
|
|
|
|
},
|
2023-05-17 23:18:46 +03:00
|
|
|
|
}).then((res) => {
|
2023-05-24 19:23:24 +03:00
|
|
|
|
let newComment = res;
|
|
|
|
|
newComment.created_at = new Date();
|
|
|
|
|
setInputsValue((prevValue) => ({ ...prevValue, comment: "" }));
|
|
|
|
|
setComments((prevValue) => [...prevValue, newComment]);
|
|
|
|
|
setCommentsEditOpen((prevValue) => ({ ...prevValue, [res.id]: false }));
|
|
|
|
|
setCommentsEditText((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
[res.id]: res.text,
|
|
|
|
|
}));
|
|
|
|
|
});
|
2023-05-17 23:18:46 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-23 23:02:39 +03:00
|
|
|
|
function deleteComment(commentId) {
|
|
|
|
|
apiRequest("/comment/update", {
|
|
|
|
|
method: "PUT",
|
|
|
|
|
data: {
|
|
|
|
|
comment_id: commentId,
|
2023-05-24 19:23:24 +03:00
|
|
|
|
status: 0,
|
|
|
|
|
},
|
2023-05-31 11:24:46 +03:00
|
|
|
|
}).then(() => {
|
2023-05-24 19:23:24 +03:00
|
|
|
|
setComments((prevValue) =>
|
|
|
|
|
prevValue.filter((item) => item.id !== commentId)
|
|
|
|
|
);
|
|
|
|
|
});
|
2023-05-23 23:02:39 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editComment(commentId) {
|
|
|
|
|
apiRequest("/comment/update", {
|
|
|
|
|
method: "PUT",
|
|
|
|
|
data: {
|
|
|
|
|
comment_id: commentId,
|
2023-05-24 19:23:24 +03:00
|
|
|
|
text: commentsEditText[commentId],
|
|
|
|
|
},
|
2023-05-31 11:24:46 +03:00
|
|
|
|
}).then(() => {});
|
2023-05-23 23:02:39 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deletePerson(userId) {
|
|
|
|
|
apiRequest("/project/del-user", {
|
|
|
|
|
method: "DELETE",
|
|
|
|
|
data: {
|
|
|
|
|
project_id: projectBoard.id,
|
2023-05-24 19:23:24 +03:00
|
|
|
|
user_id: userId,
|
2023-05-23 23:02:39 +03:00
|
|
|
|
},
|
2023-05-31 11:24:46 +03:00
|
|
|
|
}).then(() => {
|
2023-05-24 19:23:24 +03:00
|
|
|
|
dispatch(deletePersonOnProject(userId));
|
2023-05-23 23:02:39 +03:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-20 20:10:08 +03:00
|
|
|
|
const toggleTabs = (index) => {
|
2023-05-02 18:51:19 +03:00
|
|
|
|
dispatch(setToggleTab(index));
|
2023-04-20 20:10:08 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<section className="ticket-full-screen">
|
|
|
|
|
<ProfileHeader />
|
2023-05-03 16:47:20 +03:00
|
|
|
|
<Navigation />
|
2023-04-20 20:10:08 +03:00
|
|
|
|
<div className="container">
|
|
|
|
|
<div className="tracker__content">
|
|
|
|
|
<ProfileBreadcrumbs
|
|
|
|
|
links={[
|
|
|
|
|
{ name: "Главная", link: "/profile" },
|
|
|
|
|
{ name: "Трекер", link: "/profile/tracker" },
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
<h2 className="tracker__title">Управление проектами с трекером</h2>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tracker__tabs">
|
|
|
|
|
<div className="tracker__tabs__head">
|
2023-05-02 18:51:19 +03:00
|
|
|
|
<Link
|
2023-05-03 16:47:20 +03:00
|
|
|
|
to="/profile/tracker"
|
2023-05-02 18:51:19 +03:00
|
|
|
|
className="tab active-tab"
|
2023-04-20 20:10:08 +03:00
|
|
|
|
onClick={() => toggleTabs(1)}
|
|
|
|
|
>
|
|
|
|
|
<img src={project} alt="img" />
|
|
|
|
|
<p>Проекты </p>
|
2023-05-02 18:51:19 +03:00
|
|
|
|
</Link>
|
|
|
|
|
<Link
|
2023-05-03 16:47:20 +03:00
|
|
|
|
to="/profile/tracker"
|
2023-05-02 18:51:19 +03:00
|
|
|
|
className="tab"
|
2023-04-20 20:10:08 +03:00
|
|
|
|
onClick={() => toggleTabs(2)}
|
|
|
|
|
>
|
|
|
|
|
<img src={tasks} alt="img" />
|
2023-05-02 18:51:19 +03:00
|
|
|
|
<p>Все мои задачи</p>
|
|
|
|
|
</Link>
|
|
|
|
|
<Link
|
2023-05-03 16:47:20 +03:00
|
|
|
|
to="/profile/tracker"
|
2023-05-02 18:51:19 +03:00
|
|
|
|
className="tab"
|
2023-04-20 20:10:08 +03:00
|
|
|
|
onClick={() => toggleTabs(3)}
|
|
|
|
|
>
|
|
|
|
|
<img src={archive} alt="img" />
|
2023-05-02 18:51:19 +03:00
|
|
|
|
<p>Архив</p>
|
|
|
|
|
</Link>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
{loader ? (
|
|
|
|
|
<Loader />
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<div className="tracker__tabs__content content-tabs">
|
|
|
|
|
<div className="tasks__head">
|
|
|
|
|
<div className="tasks__head__wrapper">
|
|
|
|
|
<h4>Проект : {projectBoard.name}</h4>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<TrackerModal
|
|
|
|
|
active={modalAddWorker}
|
|
|
|
|
setActive={setModalAddWorker}
|
|
|
|
|
></TrackerModal>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="tasks__head__persons">
|
|
|
|
|
{/*<img src={avatarTest} alt="avatar" />*/}
|
|
|
|
|
{/*<img src={avatarTest} alt="avatar" />*/}
|
|
|
|
|
<span className="countPersons">
|
|
|
|
|
{projectBoard.projectUsers?.length}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
className="addPerson"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setPersonListOpen(true);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</span>
|
|
|
|
|
<p>добавить участника</p>
|
|
|
|
|
{personListOpen && (
|
|
|
|
|
<div className="persons__list">
|
|
|
|
|
<img
|
|
|
|
|
className="persons__list__close"
|
|
|
|
|
src={close}
|
|
|
|
|
alt="close"
|
|
|
|
|
onClick={() => setPersonListOpen(false)}
|
|
|
|
|
/>
|
|
|
|
|
<div className="persons__list__count">
|
|
|
|
|
<span>{projectBoard.projectUsers?.length}</span>
|
|
|
|
|
участник
|
|
|
|
|
</div>
|
|
|
|
|
<div className="persons__list__info">
|
|
|
|
|
В проекте - <span>“{projectBoard.name}”</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="persons__list__items">
|
|
|
|
|
{projectBoard.projectUsers?.map((person) => {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className="persons__list__item"
|
|
|
|
|
key={person.user_id}
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
className="avatar"
|
|
|
|
|
src={urlForLocal(person.user.avatar)}
|
|
|
|
|
alt="avatar"
|
|
|
|
|
/>
|
|
|
|
|
<span>{person.user.fio}</span>
|
|
|
|
|
<img
|
|
|
|
|
className="delete"
|
|
|
|
|
src={close}
|
|
|
|
|
alt="delete"
|
|
|
|
|
onClick={() => deletePerson(person.user_id)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
className="persons__list__add"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(modalToggle("addWorker"));
|
|
|
|
|
setModalAddWorker(true);
|
|
|
|
|
setPersonListOpen(false);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<span className="addPerson">+</span>
|
|
|
|
|
<p>Добавить участников</p>
|
|
|
|
|
</div>
|
2023-05-23 23:02:39 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
)}
|
2023-05-23 23:02:39 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="tasks__head__select">
|
|
|
|
|
<span>Учавствую</span>
|
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
2023-05-23 23:02:39 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="tasks__head__select">
|
|
|
|
|
<span>Мои</span>
|
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
|
|
|
|
</div>
|
|
|
|
|
<Link to={`/profile/tracker`} className="link">
|
|
|
|
|
<div className="tasks__head__back">
|
|
|
|
|
<p>Вернуться на проекты</p>
|
|
|
|
|
<img src={arrow} alt="arrow" />
|
|
|
|
|
</div>
|
|
|
|
|
</Link>
|
2023-05-23 23:02:39 +03:00
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-05-29 15:01:38 +03:00
|
|
|
|
<div className="tracker-ticket ticket">
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="content ticket-whith">
|
|
|
|
|
<div className="content__task">
|
|
|
|
|
<span>Задача</span>
|
|
|
|
|
{editOpen ? (
|
|
|
|
|
<input
|
|
|
|
|
value={inputsValue.title}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
setInputsValue((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
title: e.target.value,
|
|
|
|
|
}));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<h5>{inputsValue.title}</h5>
|
|
|
|
|
)}
|
|
|
|
|
<div className="content__description">
|
|
|
|
|
{editOpen ? (
|
|
|
|
|
<input
|
|
|
|
|
value={inputsValue.description}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
setInputsValue((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
description: e.target.value,
|
|
|
|
|
}));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<p>{inputsValue.description}</p>
|
|
|
|
|
)}
|
2023-05-23 23:02:39 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="content__communication">
|
|
|
|
|
<p className="tasks">
|
2023-05-29 15:01:38 +03:00
|
|
|
|
<BaseButton
|
2023-05-24 19:23:24 +03:00
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(modalToggle("addSubtask"));
|
2023-05-29 15:01:38 +03:00
|
|
|
|
setAddSubtask(true);
|
2023-05-24 19:23:24 +03:00
|
|
|
|
}}
|
2023-05-29 15:01:38 +03:00
|
|
|
|
styles={"tasks__button"}
|
2023-05-24 19:23:24 +03:00
|
|
|
|
>
|
|
|
|
|
<img src={plus}></img>
|
|
|
|
|
Добавить под задачу
|
2023-05-29 15:01:38 +03:00
|
|
|
|
</BaseButton>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
</p>
|
|
|
|
|
<p className="file">
|
2023-05-29 15:01:38 +03:00
|
|
|
|
<BaseButton styles={"file__button"}>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<img src={file}></img>
|
|
|
|
|
Загрузить файл
|
2023-05-29 15:01:38 +03:00
|
|
|
|
</BaseButton>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<span>{0}</span>
|
|
|
|
|
Файлов
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="content__input">
|
|
|
|
|
<input
|
|
|
|
|
placeholder="Оставить комментарий"
|
|
|
|
|
value={inputsValue.comment}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
setInputsValue((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
comment: e.target.value,
|
|
|
|
|
}));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<img src={send} onClick={createComment}></img>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="comments__list">
|
|
|
|
|
{comments.map((comment) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="comments__list__item" key={comment.id}>
|
|
|
|
|
<div className="comments__list__item__info">
|
|
|
|
|
<span>{getCorrectDate(comment.created_at)}</span>
|
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
commentsEditOpen[comment.id]
|
|
|
|
|
? "edit edit__open"
|
|
|
|
|
: "edit"
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
src={edit}
|
|
|
|
|
alt="edit"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
if (commentsEditOpen[comment.id]) {
|
|
|
|
|
editComment(comment.id);
|
|
|
|
|
}
|
|
|
|
|
setCommentsEditOpen((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
[comment.id]: !prevValue[comment.id],
|
|
|
|
|
}));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<img
|
|
|
|
|
src={del}
|
|
|
|
|
alt="delete"
|
|
|
|
|
onClick={() => deleteComment(comment.id)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{commentsEditOpen[comment.id] ? (
|
|
|
|
|
<input
|
|
|
|
|
value={commentsEditText[comment.id]}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
setCommentsEditText((prevValue) => ({
|
|
|
|
|
...prevValue,
|
|
|
|
|
[comment.id]: e.target.value,
|
|
|
|
|
}));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<p>{commentsEditText[comment.id]}</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="workers">
|
|
|
|
|
<div className="workers_box">
|
|
|
|
|
<p className="workers__creator">
|
|
|
|
|
Создатель : <span>{taskInfo.user?.fio}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<div>
|
|
|
|
|
{Boolean(taskInfo.taskUsers?.length) &&
|
|
|
|
|
taskInfo.taskUsers.map((worker, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="worker" key={index}>
|
|
|
|
|
<img src={worker.avatar}></img>
|
|
|
|
|
<p>{worker.name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="add-worker moreItems">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(modalToggle("addWorker"));
|
|
|
|
|
setModalAddWorker(true);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</button>
|
|
|
|
|
<span>Добавить исполнителя</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="add-worker moreItems">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(modalToggle("addWorker"));
|
|
|
|
|
setModalAddWorker(true);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</button>
|
|
|
|
|
<span>Добавить участников</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="workers_box-middle">
|
|
|
|
|
<div className="time">
|
|
|
|
|
<img src={watch}></img>
|
|
|
|
|
<span>Длительность : </span>
|
|
|
|
|
<p>{"0:00:00"}</p>
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<button className="start">
|
|
|
|
|
Начать делать <img src={arrow2}></img>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
|
2023-05-24 19:23:24 +03:00
|
|
|
|
<div className="workers_box-bottom">
|
|
|
|
|
<div
|
|
|
|
|
className={editOpen ? "edit" : ""}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
if (editOpen) {
|
|
|
|
|
setEditOpen(!editOpen);
|
|
|
|
|
editTask();
|
|
|
|
|
} else {
|
|
|
|
|
setEditOpen(!editOpen);
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<img src={edit}></img>
|
|
|
|
|
<p>{editOpen ? "сохранить" : "редактировать"}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<img src={link}></img>
|
|
|
|
|
<p>ссылка на проект</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<img src={archive2}></img>
|
|
|
|
|
<p>в архив</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div onClick={deleteTask}>
|
|
|
|
|
<img src={del}></img>
|
|
|
|
|
<p>удалить</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-04-20 20:10:08 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-05-24 19:23:24 +03:00
|
|
|
|
</>
|
|
|
|
|
)}
|
2023-04-20 20:10:08 +03:00
|
|
|
|
</div>
|
|
|
|
|
<Footer />
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TicketFullScreen;
|