2023-03-07 19:40:52 +03:00
|
|
|
|
import React, { 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";
|
|
|
|
|
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";
|
|
|
|
|
import { getProjects } from "../../redux/projectsTrackerSlice";
|
|
|
|
|
|
2023-03-08 11:36:34 +03:00
|
|
|
|
import ModalTiket from "../../components/UI/ModalTiket/ModalTiket";
|
2023-03-22 21:48:06 +03:00
|
|
|
|
import ModalCreate from "../../components/UI/ModalCreate/ModalCreate";
|
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-22 21:48:06 +03:00
|
|
|
|
import search from "../../images/search.svg";
|
2023-03-03 18:49:02 +03:00
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
import "./tracker.scss";
|
2023-02-17 15:19:49 +03:00
|
|
|
|
|
|
|
|
|
export const Tracker = () => {
|
2023-03-07 19:40:52 +03:00
|
|
|
|
const [toggleTab, setToggleTab] = useState(1);
|
2023-03-23 21:18:48 +03:00
|
|
|
|
|
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-13 23:33:12 +03:00
|
|
|
|
const [completeTasks] = useState([
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PR - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PK - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PE - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PA - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PB - 2245",
|
|
|
|
|
description: "Верстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PC - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PD - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "PA - 2245",
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
2023-03-22 21:48:06 +03:00
|
|
|
|
dateComplete: "07/мар/23",
|
2023-03-13 23:33:12 +03:00
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
},
|
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-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("");
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
const [selectedTab, setSelectedTab] = useState({
|
|
|
|
|
name: "",
|
|
|
|
|
indexTab: 0,
|
|
|
|
|
task: [],
|
|
|
|
|
});
|
2023-03-22 21:48:06 +03:00
|
|
|
|
|
|
|
|
|
const [startWrapperIndex, setStartWrapperIndex] = useState(null);
|
|
|
|
|
const [wrapperHover, setWrapperHover] = useState([
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
]);
|
|
|
|
|
|
2023-03-23 16:43:37 +03:00
|
|
|
|
const projects = useSelector(getProjects);
|
2023-03-07 19:40:52 +03:00
|
|
|
|
|
|
|
|
|
const toggleTabs = (index) => {
|
|
|
|
|
setToggleTab(index);
|
|
|
|
|
};
|
2023-03-10 01:20:15 +03:00
|
|
|
|
|
2023-03-22 21:48:06 +03:00
|
|
|
|
function toggleMoreTasks(wrapperIndex) {
|
|
|
|
|
setTabTaskMok((prevArray) =>
|
|
|
|
|
prevArray.map((elem, index) => {
|
|
|
|
|
if (wrapperIndex === index) {
|
|
|
|
|
return { ...elem, open: !elem.open };
|
|
|
|
|
} else {
|
|
|
|
|
return elem;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-10 01:20:15 +03:00
|
|
|
|
function dragStartHandler(e, task, wrapperIndex) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
setStartWrapperIndex({ task: task, index: wrapperIndex });
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dragEnterHandler(wrapperIndex) {
|
|
|
|
|
if (wrapperIndex === startWrapperIndex.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) => {
|
|
|
|
|
if (index === wrapperIndex) {
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
);
|
2023-03-10 01:20:15 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dragDropHandler(e, wrapperIndex) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
e.preventDefault();
|
2023-03-10 01:20:15 +03:00
|
|
|
|
if (startWrapperIndex.index === wrapperIndex) {
|
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;
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
setTabTaskMok((prevArray) =>
|
|
|
|
|
prevArray.map((elem, index) => {
|
|
|
|
|
if (index === wrapperIndex) {
|
|
|
|
|
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-03-24 19:26:27 +03:00
|
|
|
|
function selectedTabTask(e, wrapperIndex, name, tasks) {
|
|
|
|
|
let tab = { name: name, indexTab: wrapperIndex, task: tasks };
|
|
|
|
|
setSelectedTab(tab);
|
|
|
|
|
setModalCreateTiket(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createTiket() {
|
|
|
|
|
tabTaskMok.filter((item) => {
|
|
|
|
|
if (item.name == selectedTab.name) {
|
|
|
|
|
let newTiket = {
|
|
|
|
|
task: valueTiket,
|
|
|
|
|
description: "Сверстать часть таблицы. Сверстать часть таблицы",
|
|
|
|
|
comments: 0,
|
|
|
|
|
files: 0,
|
|
|
|
|
avatarCreated: avatarTest,
|
|
|
|
|
avatarDo: avatarTest,
|
|
|
|
|
id: item.tasks.length + 1,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
item.tasks.push(newTiket);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
setModalCreateTiket(false);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
return (
|
|
|
|
|
<div className="tracker">
|
|
|
|
|
<ProfileHeader />
|
|
|
|
|
<div className="container">
|
|
|
|
|
<div className="tracker__content">
|
|
|
|
|
<h2 className="tracker__title">Трекер</h2>
|
|
|
|
|
<div className="tracker__tabs">
|
|
|
|
|
<div className="tracker__tabs__head">
|
|
|
|
|
<div
|
|
|
|
|
className={toggleTab === 1 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(1)}
|
|
|
|
|
>
|
|
|
|
|
<img src={project} alt="img" />
|
|
|
|
|
<p>Проекты </p>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
className={toggleTab === 2 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(2)}
|
|
|
|
|
>
|
|
|
|
|
<img src={tasks} alt="img" />
|
|
|
|
|
<p>Задачи</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
className={toggleTab === 3 ? "tab active-tab" : "tab"}
|
|
|
|
|
onClick={() => toggleTabs(3)}
|
|
|
|
|
>
|
|
|
|
|
<img src={archive} alt="img" />
|
|
|
|
|
<p>Архив</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tracker__tabs__content">
|
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
toggleTab === 1
|
|
|
|
|
? "tracker__tabs__content__projects active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
2023-03-07 12:40:16 +03:00
|
|
|
|
}
|
2023-03-07 19:40:52 +03:00
|
|
|
|
>
|
|
|
|
|
{projects.map((project, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<div className="project" key={index}>
|
|
|
|
|
<h3>{project.name}</h3>
|
|
|
|
|
<div className="project__info">
|
|
|
|
|
<p>Открытые задачи</p>
|
|
|
|
|
<span className="count">{project.count}</span>
|
|
|
|
|
<span className="add">+</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<ModalCreate
|
|
|
|
|
active={modalCreateProject}
|
|
|
|
|
setActive={setModalCreateProject}
|
|
|
|
|
title={"Укажите название проекта:"}
|
2023-03-08 11:36:34 +03:00
|
|
|
|
/>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
<button onClick={() => setModalCreateProject(true)}>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<span>+</span>Создать проект
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
toggleTab === 2
|
|
|
|
|
? "tracker__tabs__content__tasks tasks active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<div className="tasks__head">
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<ModalCreate
|
|
|
|
|
active={modalCreateColl}
|
|
|
|
|
setActive={setModalCreateColl}
|
|
|
|
|
title={"Добавить колонку: "}
|
|
|
|
|
/>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<h4>Проект : Разработка трекера</h4>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<span
|
|
|
|
|
className="tasks__head__add"
|
|
|
|
|
onClick={() => setModalCreateColl(true)}
|
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</span>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<div className="tasks__head__persons">
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<img src={avatarTest} alt="avatar" />
|
|
|
|
|
<span>+9</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tasks__head__select">
|
|
|
|
|
<span>Учавствую</span>
|
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tasks__head__select">
|
|
|
|
|
<span>Мои</span>
|
|
|
|
|
<img src={selectArrow} alt="arrow" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<ModalTiket
|
|
|
|
|
active={modalActiveTicket}
|
|
|
|
|
setActive={setModalActiveTicket}
|
|
|
|
|
/>
|
|
|
|
|
|
2023-03-24 19:26:27 +03:00
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
modalCreateTiket ? "modal-project active" : "modal-project"
|
|
|
|
|
}
|
|
|
|
|
onClick={() => setModalCreateTiket(false)}
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
className="modal-project__content"
|
|
|
|
|
onClick={(e) => e.stopPropagation()}
|
|
|
|
|
>
|
|
|
|
|
<div className="title-project">
|
|
|
|
|
<h4>Введите название карточки</h4>
|
|
|
|
|
<div className="input-container">
|
|
|
|
|
<input
|
|
|
|
|
className="name-project"
|
|
|
|
|
value={valueTiket}
|
|
|
|
|
onChange={(e) => setValueTiket(e.target.value)}
|
|
|
|
|
></input>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button className="create-project" onClick={createTiket}>
|
|
|
|
|
Создать
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<div className="tasks__container">
|
2023-03-10 01:20:15 +03:00
|
|
|
|
{tabTaskMok.map((section, wrapperIndex) => {
|
2023-03-07 19:40:52 +03:00
|
|
|
|
return (
|
|
|
|
|
<div
|
2023-03-10 01:20:15 +03:00
|
|
|
|
key={wrapperIndex}
|
|
|
|
|
onDragOver={(e) => dragOverHandler(e)}
|
|
|
|
|
onDragEnter={(e) => dragEnterHandler(wrapperIndex)}
|
|
|
|
|
onDrop={(e) => dragDropHandler(e, wrapperIndex)}
|
2023-03-22 21:48:06 +03:00
|
|
|
|
className={`tasks__board ${
|
|
|
|
|
section.tasks.length >= 3 ? "tasks__board__more" : ""
|
|
|
|
|
} ${
|
|
|
|
|
wrapperHover[wrapperIndex]
|
|
|
|
|
? "tasks__board__hover"
|
|
|
|
|
: ""
|
|
|
|
|
}`}
|
2023-03-07 19:40:52 +03:00
|
|
|
|
>
|
|
|
|
|
<div className="board__head">
|
2023-03-10 01:20:15 +03:00
|
|
|
|
<span className={wrapperIndex === 3 ? "done" : ""}>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
{section.name}
|
|
|
|
|
</span>
|
|
|
|
|
<div>
|
2023-03-24 19:26:27 +03:00
|
|
|
|
<span
|
|
|
|
|
className="add"
|
|
|
|
|
onClick={(e) =>
|
|
|
|
|
selectedTabTask(
|
|
|
|
|
e,
|
|
|
|
|
wrapperIndex,
|
|
|
|
|
section.name,
|
|
|
|
|
section.tasks
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
+
|
|
|
|
|
</span>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<span className="more">...</span>
|
|
|
|
|
</div>
|
2023-03-03 18:49:02 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
{section.tasks.map((task, index) => {
|
2023-03-13 23:33:12 +03:00
|
|
|
|
if (index > 2) {
|
|
|
|
|
if (!section.open) {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return;
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-07 19:40:52 +03:00
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
key={index}
|
|
|
|
|
className="tasks__board__item"
|
2023-03-10 01:20:15 +03:00
|
|
|
|
draggable={true}
|
2023-03-22 21:48:06 +03:00
|
|
|
|
onDragStart={(e) =>
|
|
|
|
|
dragStartHandler(e, task, wrapperIndex)
|
|
|
|
|
}
|
2023-03-10 01:20:15 +03:00
|
|
|
|
onDragEnd={(e) => dragEndHandler(e)}
|
2023-03-07 19:40:52 +03:00
|
|
|
|
onClick={() => setModalActiveTicket(true)}
|
|
|
|
|
>
|
|
|
|
|
<div className="tasks__board__item__title">
|
|
|
|
|
<p>{task.task}</p>
|
|
|
|
|
</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>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="tasks__board__item__info__more">
|
|
|
|
|
<img src={filesBoard} alt="filesImg" />
|
|
|
|
|
<span>{task.files} файлов</span>
|
2023-03-07 12:40:16 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
<div className="tasks__board__item__info__avatars">
|
|
|
|
|
<img src={task.avatarCreated} alt="avatar" />
|
|
|
|
|
<img src={task.avatarDo} alt="avatar" />
|
2023-03-07 12:40:16 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-03-07 12:40:16 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
);
|
|
|
|
|
})}
|
2023-03-13 23:33:12 +03:00
|
|
|
|
{section.tasks.length > 3 && (
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<span
|
|
|
|
|
className={
|
|
|
|
|
section.open
|
|
|
|
|
? "lessItems openItems"
|
|
|
|
|
: "moreItems openItems"
|
|
|
|
|
}
|
|
|
|
|
onClick={() => toggleMoreTasks(wrapperIndex)}
|
|
|
|
|
>
|
|
|
|
|
{section.open ? "-" : "+"}
|
|
|
|
|
</span>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2023-03-03 18:49:02 +03:00
|
|
|
|
</div>
|
2023-03-07 19:40:52 +03:00
|
|
|
|
</div>
|
2023-03-13 23:33:12 +03:00
|
|
|
|
<div
|
|
|
|
|
className={
|
|
|
|
|
toggleTab === 3
|
2023-03-22 21:48:06 +03:00
|
|
|
|
? "tracker__tabs__content__archive tasks active__content"
|
|
|
|
|
: "tracker__tabs__content__projects"
|
2023-03-13 23:33:12 +03:00
|
|
|
|
}
|
|
|
|
|
>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<div className="archive__title">
|
2023-03-13 23:33:12 +03:00
|
|
|
|
<h3>Архив:</h3>
|
|
|
|
|
<p>{filterCompleteTasks.length} задач(а)</p>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<div className="archive__search">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
onChange={(event) => filterArchiveTasks(event)}
|
|
|
|
|
/>
|
|
|
|
|
<img src={search} alt="search" />
|
2023-03-13 23:33:12 +03:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-03-22 21:48:06 +03:00
|
|
|
|
<div className="archive__tasksWrapper">
|
2023-03-13 23:33:12 +03:00
|
|
|
|
{filterCompleteTasks.map((task, index) => {
|
2023-03-22 21:48:06 +03:00
|
|
|
|
return (
|
|
|
|
|
<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" />
|
|
|
|
|
<p>{task.name}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2023-03-13 23:33:12 +03:00
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</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
|
|
|
|
};
|