- {workers.map((worker, index) => {
+ {Boolean(taskInfo.taskUsers?.length) && taskInfo.taskUsers.map((worker, index) => {
return (
+
удалить
diff --git a/src/pages/ProjectTracker/ProjectTracker.js b/src/pages/ProjectTracker/ProjectTracker.js
index 3af6307f..e22afda0 100644
--- a/src/pages/ProjectTracker/ProjectTracker.js
+++ b/src/pages/ProjectTracker/ProjectTracker.js
@@ -1,5 +1,5 @@
import React, {useEffect, useRef, useState} from "react";
-import {Link} from "react-router-dom";
+import {Link, useParams} from "react-router-dom";
import { ProfileHeader } from "../../components/ProfileHeader/ProfileHeader";
import { ProfileBreadcrumbs } from "../../components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { Footer } from "../../components/Footer/Footer";
@@ -18,18 +18,36 @@ import selectArrow from "../../images/select.svg";
import commentsBoard from "../../images/commentsBoard.svg";
import filesBoard from "../../images/filesBoard.svg";
import arrow from "../../images/arrowCalendar.png";
+import del from "../../images/delete.svg";
+import edit from "../../images/edit.svg";
import {apiRequest} from "../../api/request";
import { Navigation } from "../../components/Navigation/Navigation";
export const ProjectTracker = () => {
const dispatch = useDispatch();
- const currentUrl = useState(window.location.pathname)
- const projectId = currentUrl[0].split('/').at(-1)
+ const projectId = useParams()
+ const [openColumnSelect, setOpenColumnSelect] = useState({})
+ const [selectedTab, setSelectedTab] = useState(0);
+ const startWrapperIndexTest = useRef({})
+ const [wrapperHover, setWrapperHover] = useState([
+ false,
+ false,
+ false,
+ false,
+ ]);
+ const projectBoard = useSelector(getProjectBoard);
+ useEffect(() => {
+ dispatch(setProjectBoardFetch(projectId.id))
+ }, [])
useEffect(() => {
- dispatch(setProjectBoardFetch(projectId))
- }, [])
+ if (Object.keys(projectBoard).length) {
+ projectBoard.columns.forEach(column => {
+ setOpenColumnSelect(prevState => ({...prevState, [column.id]: false}))
+ })
+ }
+ }, [projectBoard])
// Modal State
const [modalActiveTicket, setModalActiveTicket] = useState(false);
@@ -42,18 +60,6 @@ export const ProjectTracker = () => {
const [valueColl, setValueColl] = useState("");
//
- const [selectedTab, setSelectedTab] = useState(0);
-
- const startWrapperIndexTest = useRef({})
- const [wrapperHover, setWrapperHover] = useState([
- false,
- false,
- false,
- false,
- ]);
-
- const projectBoard = useSelector(getProjectBoard);
-
// function toggleMoreTasks(columnId) {
// setTabTaskMok((prevArray) =>
// prevArray.map((elem, index) => {
@@ -168,6 +174,19 @@ export const ProjectTracker = () => {
setModalCreateColl(false);
}
+ function deleteColumn(id) {
+ apiRequest('/project-column/update-column', {
+ method: 'PUT',
+ data: {
+ column_id: id,
+ project_id: projectBoard.id,
+ status: 0
+ }
+ }).then((res) => {
+ dispatch(setProjectBoardFetch(projectBoard.id))
+ })
+ }
+
return (
@@ -340,18 +359,34 @@ export const ProjectTracker = () => {
{/*
*/}
- {column.title}
-
+ {column.title}
+
- selectedTabTask(column.id)}
- >
- +
-
- ...
+ selectedTabTask(column.id)}
+ >
+ +
+
+ {
+ setOpenColumnSelect(prevState => ({...prevState, [column.id]: true}))
+ }} className="more">...
+ {openColumnSelect[column.id] &&
+
+
{
+ setOpenColumnSelect(prevState => ({...prevState, [column.id]: false}))
+ }}>
+
+
Изменить
+
+
deleteColumn(column.id)}>
+
+
Удалить
+
+
+ }
{column.tasks.map((task, index) => {
if (index > 2) {
if (!column.open) {
@@ -401,8 +436,8 @@ export const ProjectTracker = () => {
}
// onClick={() => toggleMoreTasks(column.id)}
>
- {column.open ? "-" : "+"}
-
+ {column.open ? "-" : "+"}
+
)}
);
diff --git a/src/pages/Tracker/tracker.scss b/src/pages/Tracker/tracker.scss
index 344fe765..834712a9 100644
--- a/src/pages/Tracker/tracker.scss
+++ b/src/pages/Tracker/tracker.scss
@@ -501,6 +501,31 @@
&__more {
padding-bottom: 50px;
}
+
+ .column__select {
+ position: absolute;
+ padding: 15px;
+ background: #e1fccf;
+ border-radius: 12px;
+ right: -75px;
+ z-index: 10;
+ row-gap: 10px;
+ display: flex;
+ flex-direction: column;
+
+ &__item {
+ cursor: pointer;
+ display: flex;
+ align-content: center;
+ img {
+ margin-right: 5px;
+ }
+
+ span {
+ font-size: 14px;
+ }
+ }
+ }
}
.board {