diff --git a/src/pages/ProjectTracker/ProjectTracker.js b/src/pages/ProjectTracker/ProjectTracker.js index d0c82de6..4816d468 100644 --- a/src/pages/ProjectTracker/ProjectTracker.js +++ b/src/pages/ProjectTracker/ProjectTracker.js @@ -1,14 +1,12 @@ import React, { useEffect, useRef, useState } from "react"; +import { HexColorPicker } from "react-colorful"; import { useDispatch, useSelector } from "react-redux"; import { Link, useParams } from "react-router-dom"; -import { - HexColorPicker -} from "react-colorful"; import { activeLoader, - deletePersonOnProject, addNewTagToProject, + deletePersonOnProject, filterCreatedByMe, filteredExecutorTasks, filteredParticipateTasks, @@ -55,7 +53,6 @@ import accept from "assets/images/accept.png"; import archive from "assets/images/archiveIcon.png"; import avatarMok from "assets/images/avatarMok.png"; - import { getCorrectDate } from "../../components/Calendar/calendarHelper"; export const ProjectTracker = () => { @@ -73,10 +70,10 @@ export const ProjectTracker = () => { const [personListOpen, setPersonListOpen] = useState(false); const [tags, setTags] = useState({ open: false, - add: false - }) + add: false, + }); const [color, setColor] = useState("#aabbcc"); - const [tagInfo, setTagInfo] = useState({description: '', name: ''}) + const [tagInfo, setTagInfo] = useState({ description: "", name: "" }); const [checkBoxParticipateTasks, setCheckBoxParticipateTasks] = useState(false); const [filteredNoTasks, setFilteredNoTasks] = useState(false); @@ -294,14 +291,14 @@ export const ProjectTracker = () => { dispatch(setProjectBoardFetch(projectId.id)); } - function addNewTag () { + function addNewTag() { apiRequest("/mark/create", { method: "POST", data: { title: tagInfo.description, slug: tagInfo.name, color: color, - status: 1 + status: 1, }, }).then((data) => { apiRequest("/mark/attach", { @@ -309,16 +306,16 @@ export const ProjectTracker = () => { data: { mark_id: data.id, entity_type: 1, - entity_id: projectId.id - } + entity_id: projectId.id, + }, }).then((data) => { - dispatch(addNewTagToProject(data.mark)) + dispatch(addNewTagToProject(data.mark)); setTags((prevState) => ({ ...prevState, - add: false - })) - }) - }) + add: false, + })); + }); + }); } return ( @@ -570,85 +567,117 @@ export const ProjectTracker = () => { )}
Список тегов
+- {tag.title} -
-+ {tag.title} +
+- Добавить новый тег -
- - + - -Добавить новый тег
+ +Вернуться на проекты
diff --git a/src/redux/projectsTrackerSlice.js b/src/redux/projectsTrackerSlice.js index 94ed6399..5e984c59 100644 --- a/src/redux/projectsTrackerSlice.js +++ b/src/redux/projectsTrackerSlice.js @@ -46,7 +46,7 @@ export const projectsTrackerSlice = createSlice({ state.projectBoard.projectUsers.push(action.payload); }, addNewTagToProject: (state, action) => { - state.projectBoard.mark.push(action.payload) + state.projectBoard.mark.push(action.payload); }, activeLoader: (state) => { state.boardLoader = true;