2023-04-28 14:56:59 +03:00
|
|
|
|
import React, {useEffect, useRef, useState} from "react";
|
2023-02-17 15:19:49 +03:00
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
import { ProfileHeader } from "../../components/ProfileHeader/ProfileHeader";
|
2023-04-10 21:22:22 +03:00
|
|
|
|
import { ProfileBreadcrumbs } from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
2023-03-07 19:40:52 +03:00
|
|
|
|
import { Footer } from "../../components/Footer/Footer";
|
2023-03-03 18:49:02 +03:00
|
|
|
|
|
2023-03-23 21:18:48 +03:00
|
|
|
|
import { useDispatch, useSelector } from "react-redux";
|
2023-04-28 14:56:59 +03:00
|
|
|
|
import { setAllProjects, getProjects, getProjectBoard, moveProjectTask, setProjectBoardFetch } from "../../redux/projectsTrackerSlice";
|
2023-03-23 21:18:48 +03:00
|
|
|
|
|
2023-04-20 20:10:08 +03:00
|
|
|
|
import ModalTicket from "../../components/UI/ModalTicket/ModalTicket";
|
2023-03-22 21:48:06 +03:00
|
|
|
|
import ModalCreate from "../../components/UI/ModalCreate/ModalCreate";
|
2023-04-10 21:22:22 +03:00
|
|
|
|
import ModalAdd from "../../components/UI/ModalAdd/ModalAdd";
|
2023-04-14 15:52:21 +03:00
|
|
|
|
import ProjectTiket from "../../components/ProjectTiket/ProjectTiket";
|
2023-03-08 11:36:34 +03:00
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
import project from "../../images/trackerProject.svg";
|
|
|
|
|
import tasks from "../../images/trackerTasks.svg";
|
|
|
|
|
import archive from "../../images/archiveTracker.svg";
|
|
|
|
|
import avatarTest from "../../images/AvatarTest .png";
|
|
|
|
|
import selectArrow from "../../images/select.svg";
|
|
|
|
|
import commentsBoard from "../../images/commentsBoard.svg";
|
|
|
|
|
import filesBoard from "../../images/filesBoard.svg";
|
2023-03-30 15:07:05 +03:00
|
|
|
|
import search from "../../images/serchIcon.png";
|
2023-04-10 21:22:22 +03:00
|
|
|
|
import noProjects from "../../images/noProjects.png";
|
|
|
|
|
import arrow from "../../images/arrowCalendar.png";
|
2023-03-03 18:49:02 +03:00
|
|
|
|
|
2023-04-27 14:51:01 +03:00
|
|
|
|
import {apiRequest} from "../../api/request";
|
2023-04-19 20:22:06 +03:00
|
|
|
|
import { Navigation } from "../../components/Navigation/Navigation";
|
2023-02-17 15:19:49 +03:00
|
|
|
|
|
2023-04-27 14:51:01 +03:00
|
|
|
|
import "./tracker.scss";
|
|
|
|
|
|
2023-02-17 15:19:49 +03:00
|
|
|
|
export const Tracker = () => {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
const dispatch = useDispatch();
|
2023-03-07 19:40:52 +03:00
|
|
|
|
const [toggleTab, setToggleTab] = useState(1);
|
2023-03-10 01:20:15 +03:00
|
|
|
|
const [tabTaskMok, setTabTaskMok] = useState([
|
2023-03-07 19:40:52 +03:00
|
|
|
|
{
|
|
|
|
|
name: "Открытые",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
open: false,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
tasks: [
|
2023-03-03 18:49:02 +03:00
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 1,
|
2023-03-03 18:49:02 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 2,
|
2023-03-03 18:49:02 +03:00
|
|
|
|
},
|
2023-03-07 19:40:52 +03:00
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "В процессе",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
open: false,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
tasks: [
|
2023-03-03 18:49:02 +03:00
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 3,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "На проверке",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
open: false,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
tasks: [
|
2023-03-07 12:40:16 +03:00
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 4,
|
2023-03-07 12:40:16 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 5,
|
2023-03-07 12:40:16 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 6,
|
2023-03-07 12:40:16 +03:00
|
|
|
|
},
|
2023-03-13 23:33:12 +03:00
|
|
|
|
{
|
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 9,
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
2023-03-07 19:40:52 +03:00
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Готово",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
open: false,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
tasks: [
|
2023-03-07 12:40:16 +03:00
|
|
|
|
{
|
2023-03-07 19:40:52 +03:00
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 7,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
task: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 12,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
2023-03-22 21:48:06 +03:00
|
|
|
|
id: 8,
|
2023-03-07 19:40:52 +03:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
2023-03-30 15:07:05 +03:00
|
|
|
|
const [allTasks] = useState([
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
},
|
2023-04-10 21:22:22 +03:00
|
|
|
|
]);
|
2023-03-30 15:07:05 +03:00
|
|
|
|
|
|
|
|
|
const [archiveProjects] = useState([
|
2023-04-10 21:22:22 +03:00
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "Будущее России",
|
|
|
|
|
date: "7 марта 2023 г",
|
|
|
|
|
},
|
|
|
|
|
]);
|
2023-03-30 15:07:05 +03:00
|
|
|
|
|
2023-03-13 23:33:12 +03:00
|
|
|
|
const [completeTasks] = useState([
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
2023-03-30 15:07:05 +03:00
|
|
|
|
name: "PR - 2245",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-30 15:07:05 +03:00
|
|
|
|
dateComplete: "7 марта 2023 г",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
2023-04-10 21:22:22 +03:00
|
|
|
|
project: "Будущее России",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
},
|
2023-03-22 21:48:06 +03:00
|
|
|
|
]);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
|
2023-03-22 21:48:06 +03:00
|
|
|
|
const [filterCompleteTasks, setFilterCompleteTasks] = useState(completeTasks);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
|
2023-03-24 19:26:27 +03:00
|
|
|
|
// Modal State
|
2023-03-07 19:40:52 +03:00
|
|
|
|
const [modalActiveTicket, setModalActiveTicket] = useState(false);
|
2023-04-20 20:10:08 +03:00
|
|
|
|
const [indexTicket, setIndexTicket] = useState(0);
|
2023-04-10 21:22:22 +03:00
|
|
|
|
const [modalAddWorker, setModalAddWorker] = useState(false);
|
2023-03-22 21:48:06 +03:00
|
|
|
|
const [modalCreateProject, setModalCreateProject] = useState(false);
|
|
|
|
|
const [modalCreateColl, setModalCreateColl] = useState(false);
|
2023-03-24 19:26:27 +03:00
|
|
|
|
const [modalCreateTiket, setModalCreateTiket] = useState(false);
|
|
|
|
|
const [valueTiket, setValueTiket] = useState("");
|
2023-04-28 14:56:59 +03:00
|
|
|
|
const [descriptionTicket, setDescriptionTicket] = useState("")
|
2023-03-27 19:08:01 +03:00
|
|
|
|
const [valueColl, setValueColl] = useState("");
|
2023-03-24 19:26:27 +03:00
|
|
|
|
//
|
|
|
|
|
|
2023-04-10 21:22:22 +03:00
|
|
|
|
const [projectTasksOpen, setProjectTasksOpen] = useState(false);
|
2023-03-30 15:07:05 +03:00
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
const [selectedTab, setSelectedTab] = useState(0);
|
2023-03-22 21:48:06 +03:00
|
|
|
|
|
|
|
|
|
const [startWrapperIndex, setStartWrapperIndex] = useState(null);
|
2023-04-28 14:56:59 +03:00
|
|
|
|
const startWrapperIndexTest = useRef({})
|
2023-03-22 21:48:06 +03:00
|
|
|
|
const [wrapperHover, setWrapperHover] = useState([
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
]);
|
|
|
|
|
|
2023-04-27 14:51:01 +03:00
|
|
|
|
useEffect(() => {
|
|
|
|
|
apiRequest(`/project/project-list?user_id=${localStorage.getItem('id')}&expand=columns`).then((el) => {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
dispatch(setAllProjects(el.projects))
|
2023-04-27 14:51:01 +03:00
|
|
|
|
})
|
|
|
|
|
}, [])
|
|
|
|
|
|
2023-03-23 16:43:37 +03:00
|
|
|
|
const projects = useSelector(getProjects);
|
2023-04-28 14:56:59 +03:00
|
|
|
|
const projectBoard = useSelector(getProjectBoard);
|
2023-03-07 19:40:52 +03:00
|
|
|
|
|
|
|
|
|
const toggleTabs = (index) => {
|
2023-03-30 15:07:05 +03:00
|
|
|
|
if (projectTasksOpen) {
|
2023-04-10 21:22:22 +03:00
|
|
|
|
setProjectTasksOpen(false);
|
2023-03-30 15:07:05 +03:00
|
|
|
|
}
|
2023-03-07 19:40:52 +03:00
|
|
|
|
setToggleTab(index);
|
|
|
|
|
};
|
2023-03-10 01:20:15 +03:00
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
function toggleMoreTasks(columnId) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setTabTaskMok((prevArray) =>
|
|
|
|
|
prevArray.map((elem, index) => {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (columnId === index) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return { ...elem, open: !elem.open };
|
|
|
|
|
} else {
|
|
|
|
|
return elem;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
function dragStartHandler(e, task, columnId) {
|
|
|
|
|
// setStartWrapperIndex({ task: task, index: columnId });
|
|
|
|
|
startWrapperIndexTest.current = { task: task, index: columnId };
|
2023-03-10 01:20:15 +03:00
|
|
|
|
setTimeout(() => {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
e.target.classList.add("tasks__board__item__hide");
|
|
|
|
|
}, 0);
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dragEndHandler(e) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setWrapperHover((prevArray) =>
|
|
|
|
|
prevArray.map((elem) => {
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
e.target.classList.remove("tasks__board__item__hide");
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dragOverHandler(e) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
e.preventDefault();
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
function dragEnterHandler(columnId) {
|
|
|
|
|
if (columnId === startWrapperIndexTest.current.index) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return;
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setWrapperHover((prevArray) =>
|
|
|
|
|
prevArray.map((elem, index) => {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (index === columnId) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
);
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
function dragDropHandler(e, columnId) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
e.preventDefault();
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (startWrapperIndexTest.current.index === columnId) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return;
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setWrapperHover((prevArray) =>
|
|
|
|
|
prevArray.map((elem) => {
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
);
|
2023-04-28 14:56:59 +03:00
|
|
|
|
|
|
|
|
|
if (columnId !== startWrapperIndexTest.current.index) {
|
|
|
|
|
dispatch(moveProjectTask({startWrapperIndex:startWrapperIndexTest.current, columnId}))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// setTabTaskMok((prevArray) =>
|
|
|
|
|
// prevArray.map((elem, index) => {
|
|
|
|
|
// if (index === columnId) {
|
|
|
|
|
// return { ...elem, tasks: [...elem.tasks, startWrapperIndex.task] };
|
|
|
|
|
// } else if (index === startWrapperIndex.index) {
|
|
|
|
|
// return {
|
|
|
|
|
// ...elem,
|
|
|
|
|
// tasks: elem.tasks.filter((item) => {
|
|
|
|
|
// return item.id !== startWrapperIndex.task.id;
|
|
|
|
|
// }),
|
|
|
|
|
// };
|
|
|
|
|
// } else {
|
|
|
|
|
// return elem;
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// );
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-13 23:33:12 +03:00
|
|
|
|
function filterArchiveTasks(e) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setFilterCompleteTasks(
|
|
|
|
|
completeTasks.filter((item) => {
|
|
|
|
|
if (!e.target.value) {
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
item.name.toLowerCase().startsWith(e.target.value.toLowerCase()) ||
|
|
|
|
|
item.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(e.target.value.toLowerCase())
|
|
|
|
|
) {
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
function selectedTabTask(columnId) {
|
|
|
|
|
setSelectedTab(columnId);
|
2023-03-24 19:26:27 +03:00
|
|
|
|
setModalCreateTiket(true);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-20 20:10:08 +03:00
|
|
|
|
function openTicket(e, iTicket) {
|
|
|
|
|
setIndexTicket(iTicket);
|
|
|
|
|
setModalActiveTicket(true);
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-24 19:26:27 +03:00
|
|
|
|
function createTiket() {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (!valueTiket || !descriptionTicket) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2023-03-24 19:26:27 +03:00
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
apiRequest('/task/create-task', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
project_id: projectBoard.id,
|
|
|
|
|
title: valueTiket,
|
|
|
|
|
description: descriptionTicket,
|
|
|
|
|
status: 1,
|
|
|
|
|
user_id: localStorage.getItem('id'),
|
|
|
|
|
column_id: selectedTab
|
2023-03-24 19:26:27 +03:00
|
|
|
|
}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
}).then((res) => {
|
|
|
|
|
dispatch(setProjectBoardFetch(projectBoard.id))
|
|
|
|
|
})
|
|
|
|
|
|
2023-03-24 19:26:27 +03:00
|
|
|
|
setModalCreateTiket(false);
|
2023-03-27 19:08:01 +03:00
|
|
|
|
setValueTiket("");
|
2023-04-28 14:56:59 +03:00
|
|
|
|
setDescriptionTicket("")
|
|
|
|
|
// tabTaskMok.filter((item) => {
|
|
|
|
|
// if (item.name == selectedTab.name) {
|
|
|
|
|
// let idItem = 0;
|
|
|
|
|
//
|
|
|
|
|
// item.tasks.forEach((item) => {
|
|
|
|
|
// idItem = item.id;
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// let newTiket = {
|
|
|
|
|
// task: valueTiket,
|
|
|
|
|
// description: descriptionTicket,
|
|
|
|
|
// comments: 0,
|
|
|
|
|
// files: 0,
|
|
|
|
|
// avatarCreated: avatarTest,
|
|
|
|
|
// avatarDo: avatarTest,
|
|
|
|
|
// id: idItem + 1,
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// item.tasks.push(newTiket);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2023-03-27 19:08:01 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createTab() {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (!valueColl) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2023-03-27 19:08:01 +03:00
|
|
|
|
|
2023-04-28 14:56:59 +03:00
|
|
|
|
apiRequest('/project-column/create-column', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: {
|
|
|
|
|
project_id: projectBoard.id,
|
|
|
|
|
title: valueColl
|
|
|
|
|
}
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
dispatch(setProjectBoardFetch(projectBoard.id))
|
|
|
|
|
})
|
2023-03-27 19:08:01 +03:00
|
|
|
|
setValueColl("");
|
|
|
|
|
setModalCreateColl(false);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
return (
|
|
|
|
|
<div className="tracker">
|
|
|
|
|
<ProfileHeader />
|
2023-04-19 20:22:06 +03:00
|
|
|
|
<Navigation />
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<div className="container">
|
|
|
|
|
<div className="tracker__content">
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<ProfileBreadcrumbs
|
|
|
|
|
links={[
|
|
|
|
|
{ name: "Главная", link: "/profile" },
|
|
|
|
|
{ name: "Трекер", link: "/profile/tracker" },
|
|
|
|
|
]}
|
2023-03-23 16:18:57 +03:00
|
|
|
|
/>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<h2 className="tracker__title">Управление проектами с трекером</h2>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tracker__tabs">
|
|
|
|
|
<div className="tracker__tabs__head">
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={toggleTab === 1 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(1)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<img src={project} alt="img" />
|
|
|
|
|
<p>Проекты </p>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={toggleTab === 2 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(2)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<img src={tasks} alt="img" />
|
|
|
|
|
<p>Все мои задачи</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={toggleTab === 3 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(3)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<img src={archive} alt="img" />
|
|
|
|
|
<p>Архив</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tracker__tabs__content">
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={
|
|
|
|
|
toggleTab === 1
|
|
|
|
|
? "tracker__tabs__content__projects active__content tracker__tabs__content__wrapper"
|
|
|
|
|
: "tracker__tabs__content__projects tracker__tabs__content__wrapper"
|
|
|
|
|
}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<ModalCreate
|
2023-04-10 21:22:22 +03:00
|
|
|
|
active={modalCreateProject}
|
|
|
|
|
setActive={setModalCreateProject}
|
|
|
|
|
title={"Укажите название проекта:"}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
/>
|
2023-04-13 22:10:20 +03:00
|
|
|
|
|
2023-04-10 21:22:22 +03:00
|
|
|
|
{Boolean(projects.length) &&
|
|
|
|
|
!projectTasksOpen &&
|
2023-03-30 15:07:05 +03:00
|
|
|
|
projects.map((project, index) => {
|
|
|
|
|
return (
|
2023-04-14 15:52:21 +03:00
|
|
|
|
<ProjectTiket
|
|
|
|
|
key={index}
|
|
|
|
|
project={project}
|
|
|
|
|
setOpenProject={setProjectTasksOpen}
|
|
|
|
|
></ProjectTiket>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
);
|
|
|
|
|
})}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
{!Boolean(projects.length) && !projectTasksOpen && (
|
|
|
|
|
<div className="no-projects">
|
|
|
|
|
<div className="no-projects__createNew">
|
|
|
|
|
<div>
|
|
|
|
|
<img src={noProjects} alt="noProjectImg" />
|
|
|
|
|
<p>Создайте свой первый проект</p>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<button
|
|
|
|
|
className="createProjectBtn"
|
|
|
|
|
onClick={() => setModalCreateProject(true)}
|
|
|
|
|
>
|
|
|
|
|
<span>+</span>Создать проект
|
|
|
|
|
</button>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<p className="no-projects__info">
|
|
|
|
|
Ставьте задачи, следите за прогрессом, ведите учёт рабочего
|
|
|
|
|
времени
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{Boolean(projects.length) && !projectTasksOpen && (
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="create-newProject">
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<button
|
|
|
|
|
className="createProjectBtn"
|
|
|
|
|
onClick={() => setModalCreateProject(true)}
|
|
|
|
|
>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<span>+</span>Создать проект
|
|
|
|
|
</button>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<p>
|
|
|
|
|
Ставьте задачи, следите за прогрессом, ведите учёт рабочего
|
|
|
|
|
времени
|
|
|
|
|
</p>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={
|
|
|
|
|
toggleTab === 1 && projectTasksOpen
|
|
|
|
|
? "tracker__tabs__content__tasks tasks active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
|
|
|
|
}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<div className="tasks__head">
|
|
|
|
|
<div className="tasks__head__wrapper">
|
2023-04-28 14:56:59 +03:00
|
|
|
|
<h4>Проект : {projectBoard.name}</h4>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
|
|
|
|
|
<ModalAdd
|
|
|
|
|
active={modalCreateColl}
|
|
|
|
|
setActive={setModalCreateColl}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div className="title-project">
|
|
|
|
|
<h4>Введите название колонки</h4>
|
|
|
|
|
<div className="input-container">
|
|
|
|
|
<input
|
|
|
|
|
className="name-project"
|
|
|
|
|
value={valueColl}
|
|
|
|
|
onChange={(e) => setValueColl(e.target.value)}
|
|
|
|
|
></input>
|
2023-03-27 19:08:01 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<button className="button-add" onClick={createTab}>
|
|
|
|
|
Создать
|
|
|
|
|
</button>
|
|
|
|
|
</ModalAdd>
|
|
|
|
|
|
2023-04-12 18:22:25 +03:00
|
|
|
|
<ModalAdd active={modalAddWorker} setActive={setModalAddWorker}>
|
|
|
|
|
<div className="title-project">
|
|
|
|
|
<h4>Добавьте участника</h4>
|
|
|
|
|
<p className="title-project__decs">
|
|
|
|
|
Введите имя или e-mail{" "}
|
|
|
|
|
</p>
|
|
|
|
|
<div className="input-container">
|
|
|
|
|
<input
|
|
|
|
|
className="name-project"
|
|
|
|
|
value={valueTiket}
|
|
|
|
|
onChange={(e) => setValueTiket(e.target.value)}
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button
|
|
|
|
|
className="button-add"
|
|
|
|
|
onClick={(e) => e.preventDefault()}
|
|
|
|
|
>
|
|
|
|
|
Добавить
|
|
|
|
|
</button>
|
|
|
|
|
</ModalAdd>
|
|
|
|
|
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="tasks__head__add">
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<span onClick={() => setModalCreateColl(true)}>+</span>
|
2023-04-27 14:51:01 +03:00
|
|
|
|
<p>добавить колонку</p>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="tasks__head__persons">
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<span className="countPersons">+9</span>
|
2023-04-12 18:22:25 +03:00
|
|
|
|
<span className="addPerson" onClick={setModalAddWorker}>
|
|
|
|
|
+
|
|
|
|
|
</span>
|
2023-04-27 14:51:01 +03:00
|
|
|
|
<p>добавить участника</p>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="tasks__head__select">
|
2023-04-27 14:51:01 +03:00
|
|
|
|
<span>Участвую</span>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="tasks__head__select">
|
|
|
|
|
<span>Мои</span>
|
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div
|
|
|
|
|
className="tasks__head__back"
|
|
|
|
|
onClick={() => setProjectTasksOpen(false)}
|
|
|
|
|
>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<p>Вернуться на проекты</p>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<img src={arrow} alt="arrow" />
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
|
2023-04-20 20:10:08 +03:00
|
|
|
|
<ModalTicket
|
2023-04-10 21:22:22 +03:00
|
|
|
|
active={modalActiveTicket}
|
|
|
|
|
setActive={setModalActiveTicket}
|
2023-04-20 20:10:08 +03:00
|
|
|
|
index={indexTicket}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
/>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<ModalAdd active={modalCreateTiket} setActive={setModalCreateTiket}>
|
|
|
|
|
<div className="title-project">
|
2023-04-28 14:56:59 +03:00
|
|
|
|
<h4>Введите название и описание задачи</h4>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div className="input-container">
|
|
|
|
|
<input
|
|
|
|
|
className="name-project"
|
|
|
|
|
value={valueTiket}
|
|
|
|
|
onChange={(e) => setValueTiket(e.target.value)}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
placeholder='Название задачи'
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="input-container">
|
|
|
|
|
<input
|
|
|
|
|
className="name-project"
|
|
|
|
|
value={descriptionTicket}
|
|
|
|
|
onChange={(e) => setDescriptionTicket(e.target.value)}
|
|
|
|
|
placeholder='Описание задачи'
|
2023-04-10 21:22:22 +03:00
|
|
|
|
></input>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
</div>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<button className="button-add" onClick={createTiket}>
|
|
|
|
|
Создать
|
|
|
|
|
</button>
|
|
|
|
|
</ModalAdd>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="tasks__container">
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{Boolean(projectBoard?.columns) && Boolean(projectBoard.columns.length) && projectBoard.columns.map((column) => {
|
2023-03-30 15:07:05 +03:00
|
|
|
|
return (
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div
|
2023-04-28 14:56:59 +03:00
|
|
|
|
key={column.id}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
onDragOver={(e) => dragOverHandler(e)}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
onDragEnter={(e) => dragEnterHandler(column.id)}
|
|
|
|
|
onDrop={(e) => dragDropHandler(e, column.id)}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={`tasks__board ${
|
2023-04-28 14:56:59 +03:00
|
|
|
|
column.tasks.length >= 3 ? "tasks__board__more" : ""
|
2023-04-10 21:22:22 +03:00
|
|
|
|
} ${
|
2023-04-28 14:56:59 +03:00
|
|
|
|
wrapperHover[column.id] ? "tasks__board__hover" : ""
|
2023-04-10 21:22:22 +03:00
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
<div className="board__head">
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{/*<span className={wrapperIndex === 3 ? "done" : ""}>*/}
|
|
|
|
|
<span>
|
|
|
|
|
{column.title}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</span>
|
|
|
|
|
<div>
|
|
|
|
|
<span
|
|
|
|
|
className="add"
|
2023-04-28 14:56:59 +03:00
|
|
|
|
onClick={() => selectedTabTask(column.id)}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</span>
|
|
|
|
|
<span className="more">...</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{column.tasks.map((task, index) => {
|
2023-04-10 21:22:22 +03:00
|
|
|
|
if (index > 2) {
|
2023-04-28 14:56:59 +03:00
|
|
|
|
if (!column.open) {
|
2023-04-10 21:22:22 +03:00
|
|
|
|
return;
|
2023-03-30 15:07:05 +03:00
|
|
|
|
}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div
|
2023-04-28 14:56:59 +03:00
|
|
|
|
key={task.id}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className="tasks__board__item"
|
|
|
|
|
draggable={true}
|
|
|
|
|
onDragStart={(e) =>
|
2023-04-28 14:56:59 +03:00
|
|
|
|
dragStartHandler(e, task, column.id)
|
2023-04-10 21:22:22 +03:00
|
|
|
|
}
|
|
|
|
|
onDragEnd={(e) => dragEndHandler(e)}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
onClick={(e) => openTicket(e, task.id)}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
>
|
|
|
|
|
<div className="tasks__board__item__title">
|
2023-04-28 14:56:59 +03:00
|
|
|
|
<p>{task.title}</p>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</div>
|
|
|
|
|
<p className="tasks__board__item__description">
|
|
|
|
|
{task.description}
|
|
|
|
|
</p>
|
|
|
|
|
<div className="tasks__board__item__info">
|
|
|
|
|
<div className="tasks__board__item__info__more">
|
|
|
|
|
<img src={commentsBoard} alt="commentsImg" />
|
|
|
|
|
<span>{task.comments} коментариев</span>
|
2023-03-07 12:40:16 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div className="tasks__board__item__info__more">
|
|
|
|
|
<img src={filesBoard} alt="filesImg" />
|
|
|
|
|
<span>{task.files} файлов</span>
|
|
|
|
|
</div>
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{/*<div className="tasks__board__item__info__avatars">*/}
|
|
|
|
|
{/* <img src={task.avatarCreated} alt="avatar" />*/}
|
|
|
|
|
{/* <img src={task.avatarDo} alt="avatar" />*/}
|
|
|
|
|
{/*</div>*/}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{column.tasks.length > 3 && (
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<span
|
|
|
|
|
className={
|
2023-04-28 14:56:59 +03:00
|
|
|
|
column.open
|
2023-04-10 21:22:22 +03:00
|
|
|
|
? "lessItems openItems"
|
|
|
|
|
: "moreItems openItems"
|
|
|
|
|
}
|
2023-04-28 14:56:59 +03:00
|
|
|
|
onClick={() => toggleMoreTasks(column.id)}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
>
|
2023-04-28 14:56:59 +03:00
|
|
|
|
{column.open ? "-" : "+"}
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={
|
|
|
|
|
toggleTab === 2
|
|
|
|
|
? "tracker__tabs__content__allTasks taskList tasks active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
|
|
|
|
}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<div className="taskList__head">
|
|
|
|
|
<h3>Список всех задач</h3>
|
|
|
|
|
<div className="taskList__head__search">
|
|
|
|
|
<img src={search} alt="search" />
|
|
|
|
|
<input
|
2023-04-10 21:22:22 +03:00
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Найти задачу"
|
|
|
|
|
onChange={(event) => filterArchiveTasks(event)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
/>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="taskList__wrapper">
|
|
|
|
|
{allTasks.map((task, index) => {
|
2023-04-10 21:22:22 +03:00
|
|
|
|
return (
|
|
|
|
|
<div className="task" key={index}>
|
|
|
|
|
<div className="task__info">
|
|
|
|
|
<h5>{task.name}</h5>
|
|
|
|
|
<p>{task.description}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="task__person">
|
|
|
|
|
<img src={task.avatarDo} alt="avatar" />
|
|
|
|
|
<div className="task__project">
|
|
|
|
|
<p>{task.project}</p>
|
|
|
|
|
<span>{task.dateComplete}</span>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
2023-04-10 21:22:22 +03:00
|
|
|
|
className={
|
|
|
|
|
toggleTab === 3
|
|
|
|
|
? "tracker__tabs__content__archive active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
|
|
|
|
}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
>
|
|
|
|
|
<div className="archive__tasks">
|
|
|
|
|
<div className="archive__title">
|
|
|
|
|
<h3>Архив задач:</h3>
|
|
|
|
|
<p>{filterCompleteTasks.length} задач(а)</p>
|
|
|
|
|
<div className="archive__tasks__search">
|
|
|
|
|
<img src={search} alt="search" />
|
|
|
|
|
<input
|
2023-04-10 21:22:22 +03:00
|
|
|
|
type="text"
|
|
|
|
|
placeholder="Найти задачу"
|
|
|
|
|
onChange={(event) => filterArchiveTasks(event)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
/>
|
2023-03-13 23:33:12 +03:00
|
|
|
|
</div>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="archive__tasksWrapper">
|
2023-04-10 21:22:22 +03:00
|
|
|
|
{Boolean(filterCompleteTasks.length) ? (
|
2023-03-30 15:07:05 +03:00
|
|
|
|
filterCompleteTasks.map((task, index) => {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return (
|
2023-04-10 21:22:22 +03:00
|
|
|
|
<div className="archive__completeTask" key={index}>
|
|
|
|
|
<div className="archive__completeTask__description">
|
|
|
|
|
<p>{task.description}</p>
|
|
|
|
|
<p className="date">{task.dateComplete}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="archive__completeTask__info">
|
|
|
|
|
<img src={task.avatarDo} alt="avatar" />
|
|
|
|
|
<div className="archive__completeTask__info__project">
|
|
|
|
|
<span>Проект</span>
|
|
|
|
|
<p>{task.project}</p>
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
</div>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
);
|
2023-03-30 15:07:05 +03:00
|
|
|
|
})
|
2023-04-10 21:22:22 +03:00
|
|
|
|
) : (
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="archive__noItem">
|
|
|
|
|
<p>В архиве задач нет</p>
|
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
)}
|
2023-03-30 15:07:05 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="archive__projects">
|
|
|
|
|
<div className="archive__title">
|
|
|
|
|
<h3>Архив проектов:</h3>
|
|
|
|
|
<p>{archiveProjects.length} проект(ов)</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="archive__tasksWrapper">
|
2023-04-10 21:22:22 +03:00
|
|
|
|
{Boolean(archiveProjects) ? (
|
2023-03-30 15:07:05 +03:00
|
|
|
|
archiveProjects.map((project, index) => {
|
2023-04-10 21:22:22 +03:00
|
|
|
|
return (
|
|
|
|
|
<div className="archive__completeTask" key={index}>
|
|
|
|
|
<div className="archive__completeTask__description">
|
|
|
|
|
<p>{project.name}</p>
|
|
|
|
|
<p className="date">{project.date}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
) : (
|
2023-03-30 15:07:05 +03:00
|
|
|
|
<div className="archive__noItem">
|
|
|
|
|
<p>В архиве проектов нет</p>
|
|
|
|
|
</div>
|
2023-04-10 21:22:22 +03:00
|
|
|
|
)}
|
2023-03-13 23:33:12 +03:00
|
|
|
|
</div>
|
2023-03-03 18:49:02 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-02-17 15:19:49 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
|
|
|
|
<Footer />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2023-02-17 15:19:49 +03:00
|
|
|
|
};
|