From a367f8b09c81ce49829c5e34df64a5dc20631b64 Mon Sep 17 00:00:00 2001 From: Gubar Nikita Date: Thu, 4 Jul 2024 16:54:34 +0300 Subject: [PATCH] add ModalTicketToReport and add OpenRequest, fix LandingTracker, fix url ModalTicket --- .../Modal/Tracker/ModalTicket/ModalTicket.jsx | 44 +- .../Tracker/ModalTicket/modalTicket.scss | 52 +- .../ModalTicketToReport.jsx | 69 + .../modalTicketToReport.scss | 167 ++ .../TicketFullScreen/TicketFullScreen.jsx | 2200 ++++++++--------- .../TrackerCardTask/TrackerCardTask.jsx | 9 +- src/pages/LandingTracker/LandingTracker.jsx | 4 +- src/pages/LandingTracker/LandingTracker.scss | 26 + src/pages/OpenRequests/OpenRequest.jsx | 32 + src/pages/OpenRequests/OpenRequest.scss | 0 src/pages/Profile/Profile.jsx | 2 +- src/pages/ProjectTracker/ProjectTracker.jsx | 29 +- src/pages/roles/DeveloperPage.jsx | 14 +- src/pages/roles/PartnerPage.jsx | 6 - 14 files changed, 1499 insertions(+), 1155 deletions(-) create mode 100644 src/components/Modal/Tracker/ModalTicketToReport/ModalTicketToReport.jsx create mode 100644 src/components/Modal/Tracker/ModalTicketToReport/modalTicketToReport.scss create mode 100644 src/pages/OpenRequests/OpenRequest.jsx create mode 100644 src/pages/OpenRequests/OpenRequest.scss diff --git a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx index 00f29fdf..19361a8c 100644 --- a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx +++ b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx @@ -5,7 +5,7 @@ import React, { useEffect, useState } from "react"; import DatePicker, { registerLocale } from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { useDispatch, useSelector } from "react-redux"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import { getProfileInfo } from "@redux/outstaffingSlice"; import { setProjectBoardFetch } from "@redux/projectsTrackerSlice"; @@ -44,6 +44,7 @@ import watch from "assets/icons/watch.svg"; import avatarMok from "assets/images/avatarMok.webp"; import { getCorrectDate } from "../../../../utils/calendarHelper"; +import ModalTicketToReport from "../ModalTicketToReport/ModalTicketToReport"; import "./modalTicket.scss"; registerLocale("ru", ru); @@ -59,6 +60,8 @@ export const ModalTiсket = ({ projectMarks }) => { const dispatch = useDispatch(); + const location = useLocation(); + const [addSubtask, setAddSubtask] = useState(false); const [editOpen, setEditOpen] = useState(false); const [inputsValue, setInputsValue] = useState({ @@ -87,6 +90,12 @@ export const ModalTiсket = ({ minute: 0, seconds: 0 }); + const additionalData = { + id: task.id, + title: inputsValue.title, + link: null, + nameProject: projectName + }; const [timerId, setTimerId] = useState(null); const [taskFiles, setTaskFiles] = useState([]); const [correctProjectUsers, setCorrectProjectUsers] = useState(projectUsers); @@ -98,9 +107,21 @@ export const ModalTiсket = ({ const [selectPriorityOpen, setSelectPriorityOpen] = useState(false); const { showNotification } = useNotification(); const [commentSendDisable, setCommentSendDisable] = useState(false); + const [showModalToReport, setShowModalToReport] = useState(false); + + const openModalToReport = () => { + setShowModalToReport(!showModalToReport); + }; + + const closeModalToReport = () => { + setShowModalToReport(!showModalToReport); + }; const closeModal = () => { setActive(false); + const currentUrl = window.location.pathname; + const newUrl = currentUrl.replace(/\/task\/\d+$/, ""); + window.history.replaceState({}, "", newUrl); // Восстанавливаем скролл при закрытии модального окна document.body.style.overflow = "auto"; }; @@ -1072,7 +1093,7 @@ export const ModalTiсket = ({
{ if (editOpen) { editTask(); @@ -1084,30 +1105,39 @@ export const ModalTiсket = ({

{editOpen ? "сохранить" : "редактировать"}

-
+

ссылка на задачу

+
+ +

выгрузка в отчет

+ +

в архив

удалить

diff --git a/src/components/Modal/Tracker/ModalTicket/modalTicket.scss b/src/components/Modal/Tracker/ModalTicket/modalTicket.scss index b43637f7..890a6fd9 100644 --- a/src/components/Modal/Tracker/ModalTicket/modalTicket.scss +++ b/src/components/Modal/Tracker/ModalTicket/modalTicket.scss @@ -1178,33 +1178,35 @@ font-size: 14px; line-height: 32px; - div { - display: flex; - cursor: pointer; - align-items: center; - padding-left: 10px; + .bottom { + &-button { + display: flex; + cursor: pointer; + align-items: center; + padding-left: 10px; - img { - width: 11px; + img { + width: 11px; + } + + p { + margin: 0 0 0 5px; + } + + &.edit { + background: #52b709; + border-radius: 50px; + width: fit-content; + p { + font-weight: 700; + padding-right: 10px; + } + } + + p:hover { + text-decoration: underline; + } } - - p { - margin: 0 0 0 5px; - } - } - - .edit { - background: #52b709; - border-radius: 50px; - width: fit-content; - p { - font-weight: 700; - padding-right: 10px; - } - } - - p:hover { - text-decoration: underline; } } } diff --git a/src/components/Modal/Tracker/ModalTicketToReport/ModalTicketToReport.jsx b/src/components/Modal/Tracker/ModalTicketToReport/ModalTicketToReport.jsx new file mode 100644 index 00000000..857dd55d --- /dev/null +++ b/src/components/Modal/Tracker/ModalTicketToReport/ModalTicketToReport.jsx @@ -0,0 +1,69 @@ +import axios from "axios"; +import React, { useState } from "react"; +import DatePicker from "react-datepicker"; +import "react-datepicker/dist/react-datepicker.css"; + +import BaseButton from "@components/Common/BaseButton/BaseButton"; + +import "./modalTicketToReport.scss"; + +const ModalTicketToReport = ({ show, onClose, additionalData }) => { + const [date, setDate] = useState(new Date()); + + const handleSubmit = async () => { + const data = { + date, + ...additionalData + }; + + try { + await axios.post( + "https://itguild.info/profile/calendar/reports/create", + data + ); + } catch (error) { + console.error("Error:", error); + } + }; + + return ( +
+
e.stopPropagation()} + > +
+

Выгрузка в отчет

+
+ setDate(date)} + dateFormat="dd/MM/yyyy" + /> +
+ +
+ + Выгрузить в отчет + + + Выгрузить и перейти в отчет + +
+
+
+ ); +}; + +export default ModalTicketToReport; diff --git a/src/components/Modal/Tracker/ModalTicketToReport/modalTicketToReport.scss b/src/components/Modal/Tracker/ModalTicketToReport/modalTicketToReport.scss new file mode 100644 index 00000000..24df8c4d --- /dev/null +++ b/src/components/Modal/Tracker/ModalTicketToReport/modalTicketToReport.scss @@ -0,0 +1,167 @@ +.modal-report { + &-backdrop { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + align-items: center; + justify-content: center; + z-index: 1000; + display: none; + + &.show { + display: flex; + } + } + + &-content { + cursor: auto; + background: white; + padding: 20px; + border-radius: 5px; + position: relative; + max-width: 500px; + height: 500px; + width: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + &-close { + cursor: pointer; + position: absolute; + top: 15px; + right: 15px; + width: 13px; + height: 13px; + display: flex; + align-items: center; + justify-content: center; + + &::after { + content: ""; + position: absolute; + width: 16px; + height: 2px; + background: #263238; + transform: rotate(-45deg); + } + &::before { + content: ""; + position: absolute; + width: 16px; + height: 2px; + background: #263238; + transform: rotate(45deg); + } + } + + &-date-picker { + // .datePicker { + // visibility: hidden; + // height: 0; + // padding: 0; + // width: 0; + // position: absolute; + // } + + .react-datepicker-wrapper { + // position: absolute; + } + + .react-datepicker { + border: 1px solid #e8ede4; + border-radius: 8px; + } + + .react-datepicker-popper { + top: -150px !important; + left: 180px !important; + z-index: 10; + + @media (max-width: 880px) { + left: 0 !important; + top: -15px !important; + } + } + + .react-datepicker__current-month { + font-size: 18px; + text-transform: capitalize; + } + + .react-datepicker__navigation-icon { + width: 20px; + height: 20px; + border-radius: 50px; + border: 2px solid #cbd1d2; + display: flex; + justify-content: center; + align-items: center; + font-size: 0; + + &:hover { + background-color: white; + } + } + + .react-datepicker__navigation-icon--next::before { + border-width: 2px 2px 0 0; + top: auto; + left: 4px; + height: 6px; + width: 6px; + } + + .react-datepicker__navigation-icon--previous::before { + border-width: 2px 2px 0 0; + top: auto; + left: 6px; + height: 6px; + width: 6px; + } + + .react-datepicker__header { + padding: 5px 0 10px; + border-bottom: 1px solid #baacc0; + } + + .react-datepicker__day { + font-size: 16px; + width: 35px; + border-radius: 50px; + padding: 7px; + } + + .react-datepicker__day-name { + font-size: 18px; + width: 35px; + font-weight: 500; + } + + .react-datepicker__triangle { + display: none; + // left: 85px !important; + + // &:before { + // border: 1px solid #e8ede4; + // } + } + } + + &__buttons { + display: flex; + justify-content: center; + column-gap: 100px; + margin: 30px 0; + + .button { + height: 47px; + font-size: 15px; + line-height: 16px; + } + } +} diff --git a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx index b2ce7a11..c8b189d5 100644 --- a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx +++ b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx @@ -1,1157 +1,1157 @@ -import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; -import { CKEditor } from "@ckeditor/ckeditor5-react"; -import ru from "date-fns/locale/ru"; -import React, { useEffect, useState } from "react"; -import DatePicker, { registerLocale } from "react-datepicker"; -import { useDispatch, useSelector } from "react-redux"; -import { Link, useNavigate, useParams } from "react-router-dom"; +// import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; +// import { CKEditor } from "@ckeditor/ckeditor5-react"; +// import ru from "date-fns/locale/ru"; +// import React, { useEffect, useState } from "react"; +// import DatePicker, { registerLocale } from "react-datepicker"; +// import { useDispatch, useSelector } from "react-redux"; +// import { Link, useNavigate, useParams } from "react-router-dom"; -import { getProfileInfo } from "@redux/outstaffingSlice"; -import { getBoarderLoader, setToggleTab } from "@redux/projectsTrackerSlice"; +// import { getProfileInfo } from "@redux/outstaffingSlice"; +// import { getBoarderLoader, setToggleTab } from "@redux/projectsTrackerSlice"; -import { getCorrectDate } from "@utils/calendarHelper"; -import { - backendImg, - caseOfNum, - getCorrectRequestDate, - getToken, - removeLast, - urlForLocal -} from "@utils/helper"; +// import { getCorrectDate } from "@utils/calendarHelper"; +// import { +// backendImg, +// caseOfNum, +// getCorrectRequestDate, +// getToken, +// removeLast, +// urlForLocal +// } from "@utils/helper"; -import { apiRequest } from "@api/request"; +// import { apiRequest } from "@api/request"; -import { useNotification } from "@hooks/useNotification"; +// import { useNotification } from "@hooks/useNotification"; -import { Footer } from "@components/Common/Footer/Footer"; -import { Loader } from "@components/Common/Loader/Loader"; -import FileTracker from "@components/FileTracker/FileTracker"; -import AcceptModal from "@components/Modal/AcceptModal/AcceptModal"; -import { Navigation } from "@components/Navigation/Navigation"; -import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; -import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; -import TrackerTaskComment from "@components/TrackerTaskComment/TrackerTaskComment"; +// import { Footer } from "@components/Common/Footer/Footer"; +// import { Loader } from "@components/Common/Loader/Loader"; +// import FileTracker from "@components/FileTracker/FileTracker"; +// import AcceptModal from "@components/Modal/AcceptModal/AcceptModal"; +// import { Navigation } from "@components/Navigation/Navigation"; +// import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; +// import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; +// import TrackerTaskComment from "@components/TrackerTaskComment/TrackerTaskComment"; -import arrow from "assets/icons/arrows/arrowRight.png"; -import arrowStart from "assets/icons/arrows/arrowStart.png"; -import arrowDown from "assets/icons/arrows/selectArrow.png"; -import calendarIcon from "assets/icons/calendar.svg"; -import fileDelete from "assets/icons/closeProjectPersons.svg"; -import close from "assets/icons/crossWhite.svg"; -import del from "assets/icons/delete.svg"; -import edit from "assets/icons/edit.svg"; -import file from "assets/icons/fileModal.svg"; -import link from "assets/icons/link.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"; -import archive from "assets/images/archiveIcon.webp"; -import avatarMok from "assets/images/avatarMok.webp"; +// import arrow from "assets/icons/arrows/arrowRight.png"; +// import arrowStart from "assets/icons/arrows/arrowStart.png"; +// import arrowDown from "assets/icons/arrows/selectArrow.png"; +// import calendarIcon from "assets/icons/calendar.svg"; +// import fileDelete from "assets/icons/closeProjectPersons.svg"; +// import close from "assets/icons/crossWhite.svg"; +// import del from "assets/icons/delete.svg"; +// import edit from "assets/icons/edit.svg"; +// import file from "assets/icons/fileModal.svg"; +// import link from "assets/icons/link.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"; +// import archive from "assets/images/archiveIcon.webp"; +// import avatarMok from "assets/images/avatarMok.webp"; -import "./ticketFullScreen.scss"; +// import "./ticketFullScreen.scss"; -registerLocale("ru", ru); +// registerLocale("ru", ru); -export const TicketFullScreen = () => { - const ticketId = useParams(); - const dispatch = useDispatch(); - const navigate = useNavigate(); - const boardLoader = useSelector(getBoarderLoader); - const [projectInfo, setProjectInfo] = useState({}); - const [taskInfo, setTaskInfo] = useState({}); - const [editOpen, setEditOpen] = useState(false); - const [inputsValue, setInputsValue] = useState({}); - const [loader, setLoader] = useState(true); - const [comments, setComments] = useState([]); - const [timerStart, setTimerStart] = useState(false); - const [timerInfo, setTimerInfo] = useState({}); - const [currentTimerCount, setCurrentTimerCount] = useState({ - hours: 0, - minute: 0, - seconds: 0 - }); - const profileInfo = useSelector(getProfileInfo); - const [timerId, setTimerId] = useState(null); - const [dropListOpen, setDropListOpen] = useState(false); - const [correctProjectUsers, setCorrectProjectUsers] = useState([]); - const [dropListMembersOpen, setDropListMembersOpen] = useState(false); - const [users, setUsers] = useState([]); - const [deadLine, setDeadLine] = useState(""); - const [datePickerOpen, setDatePickerOpen] = useState(false); - const [startDate, setStartDate] = useState(null); - const [uploadedFile, setUploadedFile] = useState(null); - const [taskFiles, setTaskFiles] = useState([]); - const [taskPriority, setTaskPriority] = useState(""); - const [acceptModalOpen, setAcceptModalOpen] = useState(false); - const [taskTags, setTaskTags] = useState([]); - const [selectTagsOpen, setSelectTagsOpen] = useState(false); - const [selectPriorityOpen, setSelectPriorityOpen] = useState(false); - const [correctProjectTags, setCorrectProjectTags] = useState([]); - const { showNotification } = useNotification(); - const [commentSendDisable, setCommentSendDisable] = useState(false); +// export const TicketFullScreen = () => { +// const ticketId = useParams(); +// const dispatch = useDispatch(); +// const navigate = useNavigate(); +// const boardLoader = useSelector(getBoarderLoader); +// const [projectInfo, setProjectInfo] = useState({}); +// const [taskInfo, setTaskInfo] = useState({}); +// const [editOpen, setEditOpen] = useState(false); +// const [inputsValue, setInputsValue] = useState({}); +// const [loader, setLoader] = useState(true); +// const [comments, setComments] = useState([]); +// const [timerStart, setTimerStart] = useState(false); +// const [timerInfo, setTimerInfo] = useState({}); +// const [currentTimerCount, setCurrentTimerCount] = useState({ +// hours: 0, +// minute: 0, +// seconds: 0 +// }); +// const profileInfo = useSelector(getProfileInfo); +// const [timerId, setTimerId] = useState(null); +// const [dropListOpen, setDropListOpen] = useState(false); +// const [correctProjectUsers, setCorrectProjectUsers] = useState([]); +// const [dropListMembersOpen, setDropListMembersOpen] = useState(false); +// const [users, setUsers] = useState([]); +// const [deadLine, setDeadLine] = useState(""); +// const [datePickerOpen, setDatePickerOpen] = useState(false); +// const [startDate, setStartDate] = useState(null); +// const [uploadedFile, setUploadedFile] = useState(null); +// const [taskFiles, setTaskFiles] = useState([]); +// const [taskPriority, setTaskPriority] = useState(""); +// const [acceptModalOpen, setAcceptModalOpen] = useState(false); +// const [taskTags, setTaskTags] = useState([]); +// const [selectTagsOpen, setSelectTagsOpen] = useState(false); +// const [selectPriorityOpen, setSelectPriorityOpen] = useState(false); +// const [correctProjectTags, setCorrectProjectTags] = useState([]); +// const { showNotification } = useNotification(); +// const [commentSendDisable, setCommentSendDisable] = useState(false); - const priority = { - 2: "Высокий", - 1: "Средний", - 0: "Низкий" - }; +// const priority = { +// 2: "Высокий", +// 1: "Средний", +// 0: "Низкий" +// }; - const priorityTypes = [ - { - name: "Высокий", - key: 2 - }, - { - name: "Средний", - key: 1 - }, - { - name: "Низкий", - key: 0 - } - ]; +// const priorityTypes = [ +// { +// name: "Высокий", +// key: 2 +// }, +// { +// name: "Средний", +// key: 1 +// }, +// { +// name: "Низкий", +// key: 0 +// } +// ]; - useEffect(() => { - initListeners(); - apiRequest(`/task/get-task?task_id=${ticketId.id}&expand=mark`).then( - (taskInfo) => { - setTaskInfo(taskInfo); - setDeadLine(taskInfo.dead_line); - setTaskPriority(taskInfo.execution_priority); - setStartDate( - taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date() - ); - setInputsValue({ - title: taskInfo.title, - description: taskInfo.description, - comment: "" - }); - setTaskTags(taskInfo.mark); - apiRequest( - `/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` - ).then((res) => { - const comments = res.reduce((acc, cur) => { - if (!cur.parent_id) { - acc.push({ ...cur, subComments: [] }); - } else { - acc.forEach((item) => { - if (item.id === cur.parent_id) item.subComments.push(cur); - }); - } - return acc; - }, []); - setComments(comments); - }); - apiRequest( - `/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` - ).then((res) => { - if (Array.isArray(res)) { - setTaskFiles(res); - } - }); - apiRequest( - `/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` - ).then((res) => { - let timerSeconds = 0; - res.length && - res.forEach((time) => { - timerSeconds += time.deltaSeconds; - setCurrentTimerCount({ - hours: Math.floor(timerSeconds / 60 / 60), - minute: Math.floor((timerSeconds / 60) % 60), - seconds: timerSeconds % 60 - }); - updateTimerHours = Math.floor(timerSeconds / 60 / 60); - updateTimerMinute = Math.floor((timerSeconds / 60) % 60); - updateTimerSec = timerSeconds % 60; - if (!time.stopped_at) { - setTimerStart(true); - startTimer(); - setTimerInfo(time); - } - }); - }); - apiRequest( - `/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark` - ).then((res) => { - setProjectInfo(res); - setCorrectProjectUsers(res.projectUsers); - }); - setLoader(boardLoader); - } - ); - }, []); +// useEffect(() => { +// initListeners(); +// apiRequest(`/task/get-task?task_id=${ticketId.id}&expand=mark`).then( +// (taskInfo) => { +// setTaskInfo(taskInfo); +// setDeadLine(taskInfo.dead_line); +// setTaskPriority(taskInfo.execution_priority); +// setStartDate( +// taskInfo.dead_line ? new Date(taskInfo.dead_line) : new Date() +// ); +// setInputsValue({ +// title: taskInfo.title, +// description: taskInfo.description, +// comment: "" +// }); +// setTaskTags(taskInfo.mark); +// apiRequest( +// `/comment/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` +// ).then((res) => { +// const comments = res.reduce((acc, cur) => { +// if (!cur.parent_id) { +// acc.push({ ...cur, subComments: [] }); +// } else { +// acc.forEach((item) => { +// if (item.id === cur.parent_id) item.subComments.push(cur); +// }); +// } +// return acc; +// }, []); +// setComments(comments); +// }); +// apiRequest( +// `/file/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` +// ).then((res) => { +// if (Array.isArray(res)) { +// setTaskFiles(res); +// } +// }); +// apiRequest( +// `/timer/get-by-entity?entity_type=2&entity_id=${taskInfo.id}` +// ).then((res) => { +// let timerSeconds = 0; +// res.length && +// res.forEach((time) => { +// timerSeconds += time.deltaSeconds; +// setCurrentTimerCount({ +// hours: Math.floor(timerSeconds / 60 / 60), +// minute: Math.floor((timerSeconds / 60) % 60), +// seconds: timerSeconds % 60 +// }); +// updateTimerHours = Math.floor(timerSeconds / 60 / 60); +// updateTimerMinute = Math.floor((timerSeconds / 60) % 60); +// updateTimerSec = timerSeconds % 60; +// if (!time.stopped_at) { +// setTimerStart(true); +// startTimer(); +// setTimerInfo(time); +// } +// }); +// }); +// apiRequest( +// `/project/get-project?project_id=${taskInfo.project_id}&expand=columns,mark` +// ).then((res) => { +// setProjectInfo(res); +// setCorrectProjectUsers(res.projectUsers); +// }); +// setLoader(boardLoader); +// } +// ); +// }, []); - useEffect(() => { - let tagIds = taskTags.map((tag) => tag.id); - if (projectInfo.mark) { - setCorrectProjectTags( - projectInfo.mark.reduce((acc, cur) => { - if (!tagIds.includes(cur.id)) acc.push(cur); - return acc; - }, []) - ); - } - }, [taskTags, projectInfo]); +// useEffect(() => { +// let tagIds = taskTags.map((tag) => tag.id); +// if (projectInfo.mark) { +// setCorrectProjectTags( +// projectInfo.mark.reduce((acc, cur) => { +// if (!tagIds.includes(cur.id)) acc.push(cur); +// return acc; +// }, []) +// ); +// } +// }, [taskTags, projectInfo]); - function deleteTask() { - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: ticketId.id, - status: 0 - } - }).then(() => { - navigate(`/tracker/project/${taskInfo.project_id}`); - }); - } +// function deleteTask() { +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: ticketId.id, +// status: 0 +// } +// }).then(() => { +// navigate(`/tracker/project/${taskInfo.project_id}`); +// }); +// } - function archiveTask() { - setAcceptModalOpen(true); - } +// function archiveTask() { +// setAcceptModalOpen(true); +// } - function editTask() { - if (!inputsValue.title || !inputsValue.description) { - return showNotification({ - show: true, - text: "Заполните поля", - type: "error" - }); - } - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: taskInfo.id, - title: inputsValue.title, - description: inputsValue.description - } - }).then(() => { - showNotification({ - show: true, - text: "Изменения сохранены", - type: "success" - }); - setEditOpen(!editOpen); - }); - } +// function editTask() { +// if (!inputsValue.title || !inputsValue.description) { +// return showNotification({ +// show: true, +// text: "Заполните поля", +// type: "error" +// }); +// } +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: taskInfo.id, +// title: inputsValue.title, +// description: inputsValue.description +// } +// }).then(() => { +// showNotification({ +// show: true, +// text: "Изменения сохранены", +// type: "success" +// }); +// setEditOpen(!editOpen); +// }); +// } - function createComment() { - if (!inputsValue.comment) return; - setCommentSendDisable(true); - apiRequest("/comment/create", { - method: "POST", - data: { - text: inputsValue.comment, - entity_type: 2, - entity_id: taskInfo.id - } - }).then((res) => { - let newComment = res; - setCommentSendDisable(false); - newComment.created_at = new Date(); - newComment.subComments = []; - setInputsValue((prevValue) => ({ ...prevValue, comment: "" })); - setComments((prevValue) => [...prevValue, newComment]); - }); - } +// function createComment() { +// if (!inputsValue.comment) return; +// setCommentSendDisable(true); +// apiRequest("/comment/create", { +// method: "POST", +// data: { +// text: inputsValue.comment, +// entity_type: 2, +// entity_id: taskInfo.id +// } +// }).then((res) => { +// let newComment = res; +// setCommentSendDisable(false); +// newComment.created_at = new Date(); +// newComment.subComments = []; +// setInputsValue((prevValue) => ({ ...prevValue, comment: "" })); +// setComments((prevValue) => [...prevValue, newComment]); +// }); +// } - function startTaskTimer() { - apiRequest("/timer/create", { - method: "POST", - data: { - entity_type: 2, - entity_id: taskInfo.id, - created_at: getCorrectRequestDate(new Date()) - } - }).then((res) => { - setTimerStart(true); - setTimerInfo(res); - startTimer(); - }); - } +// function startTaskTimer() { +// apiRequest("/timer/create", { +// method: "POST", +// data: { +// entity_type: 2, +// entity_id: taskInfo.id, +// created_at: getCorrectRequestDate(new Date()) +// } +// }).then((res) => { +// setTimerStart(true); +// setTimerInfo(res); +// startTimer(); +// }); +// } - function stopTaskTimer() { - apiRequest("/timer/update", { - method: "PUT", - data: { - timer_id: timerInfo.id, - stopped_at: getCorrectRequestDate(new Date()) - } - }).then(() => { - setTimerStart(false); - clearInterval(timerId); - }); - } +// function stopTaskTimer() { +// apiRequest("/timer/update", { +// method: "PUT", +// data: { +// timer_id: timerInfo.id, +// stopped_at: getCorrectRequestDate(new Date()) +// } +// }).then(() => { +// setTimerStart(false); +// clearInterval(timerId); +// }); +// } - function commentDelete(comment) { - setComments((prevValue) => - prevValue.filter((item) => item.id !== comment.id) - ); - if (comment.subComments.length) { - comment.subComments.forEach((subComment) => { - apiRequest("/comment/update", { - method: "PUT", - data: { - comment_id: subComment.id, - status: 0 - } - }).then(() => {}); - }); - } - } +// function commentDelete(comment) { +// setComments((prevValue) => +// prevValue.filter((item) => item.id !== comment.id) +// ); +// if (comment.subComments.length) { +// comment.subComments.forEach((subComment) => { +// apiRequest("/comment/update", { +// method: "PUT", +// data: { +// comment_id: subComment.id, +// status: 0 +// } +// }).then(() => {}); +// }); +// } +// } - function addSubComment(commentId, subComment) { - const addSubComment = comments; - addSubComment.forEach((comment) => { - if (comment.id === commentId) { - comment.subComments.push(subComment); - } - }); - setComments(addSubComment); - } +// function addSubComment(commentId, subComment) { +// const addSubComment = comments; +// addSubComment.forEach((comment) => { +// if (comment.id === commentId) { +// comment.subComments.push(subComment); +// } +// }); +// setComments(addSubComment); +// } - function subCommentDelete(subComment) { - const deleteSubComment = comments; - deleteSubComment.forEach((comment, index) => { - if (comment.id === subComment.parent_id) { - deleteSubComment[index].subComments = comment.subComments.filter( - (item) => item.id !== subComment.id - ); - } - }); - setComments([...deleteSubComment]); - } +// function subCommentDelete(subComment) { +// const deleteSubComment = comments; +// deleteSubComment.forEach((comment, index) => { +// if (comment.id === subComment.parent_id) { +// deleteSubComment[index].subComments = comment.subComments.filter( +// (item) => item.id !== subComment.id +// ); +// } +// }); +// setComments([...deleteSubComment]); +// } - const toggleTabs = (index) => { - dispatch(setToggleTab(index)); - }; +// const toggleTabs = (index) => { +// dispatch(setToggleTab(index)); +// }; - function copyTicketLink() { - navigator.clipboard.writeText( - `https://itguild.info/tracker/task/${taskInfo.id}` - ); - } +// function copyTicketLink() { +// navigator.clipboard.writeText( +// `https://itguild.info/tracker/task/${taskInfo.id}` +// ); +// } - function startTimer() { - setTimerId( - setInterval(() => { - run(); - }, 1000) - ); - } +// function startTimer() { +// setTimerId( +// setInterval(() => { +// run(); +// }, 1000) +// ); +// } - useEffect(() => { - if (taskInfo.taskUsers && projectInfo.projectUsers) { - let ids = taskInfo.taskUsers.map((user) => user.user_id); - setUsers( - projectInfo.projectUsers.reduce((acc, cur) => { - if (!ids.includes(cur.user_id)) acc.push(cur); - return acc; - }, []) - ); - } - }, [taskInfo.taskUsers, projectInfo]); +// useEffect(() => { +// if (taskInfo.taskUsers && projectInfo.projectUsers) { +// let ids = taskInfo.taskUsers.map((user) => user.user_id); +// setUsers( +// projectInfo.projectUsers.reduce((acc, cur) => { +// if (!ids.includes(cur.user_id)) acc.push(cur); +// return acc; +// }, []) +// ); +// } +// }, [taskInfo.taskUsers, projectInfo]); - let updateTimerSec = currentTimerCount.seconds, - updateTimerMinute = currentTimerCount.minute, - updateTimerHours = currentTimerCount.hours; +// let updateTimerSec = currentTimerCount.seconds, +// updateTimerMinute = currentTimerCount.minute, +// updateTimerHours = currentTimerCount.hours; - function run() { - updateTimerSec++; - if (updateTimerSec > 60) { - updateTimerMinute++; - updateTimerSec = 0; - } - if (updateTimerMinute === 60) { - updateTimerMinute = 0; - updateTimerHours++; - } +// function run() { +// updateTimerSec++; +// if (updateTimerSec > 60) { +// updateTimerMinute++; +// updateTimerSec = 0; +// } +// if (updateTimerMinute === 60) { +// updateTimerMinute = 0; +// updateTimerHours++; +// } - return setCurrentTimerCount({ - hours: updateTimerHours, - minute: updateTimerMinute, - seconds: updateTimerSec - }); - } +// return setCurrentTimerCount({ +// hours: updateTimerHours, +// minute: updateTimerMinute, +// seconds: updateTimerSec +// }); +// } - function correctTimerTime(time) { - if (time < 10) return `0${time}`; - if (time > 10) return time; - } +// function correctTimerTime(time) { +// if (time < 10) return `0${time}`; +// if (time > 10) return time; +// } - function deleteTaskExecutor() { - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: taskInfo.id, - executor_id: 0 - } - }).then(() => { - setTaskInfo((prevState) => ({ - ...prevState, - executor_id: null, - executor: null - })); - }); - } +// function deleteTaskExecutor() { +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: taskInfo.id, +// executor_id: 0 +// } +// }).then(() => { +// setTaskInfo((prevState) => ({ +// ...prevState, +// executor_id: null, +// executor: null +// })); +// }); +// } - function taskExecutor(person) { - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: taskInfo.id, - executor_id: person.user_id - } - }).then((res) => { - setDropListOpen(false); - setTaskInfo((prevState) => ({ - ...prevState, - executor_id: res.executor_id, - executor: res.executor - })); - }); - } +// function taskExecutor(person) { +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: taskInfo.id, +// executor_id: person.user_id +// } +// }).then((res) => { +// setDropListOpen(false); +// setTaskInfo((prevState) => ({ +// ...prevState, +// executor_id: res.executor_id, +// executor: res.executor +// })); +// }); +// } - function deleteMember(person) { - apiRequest("/task/del-user", { - method: "DELETE", - data: { - task_id: taskInfo.id, - user_id: person.user_id - } - }).then(() => { - setTaskInfo((prevState) => ({ - ...prevState, - taskUsers: taskInfo.taskUsers.filter( - (item) => item.user_id !== person.user_id - ) - })); - }); - } +// function deleteMember(person) { +// apiRequest("/task/del-user", { +// method: "DELETE", +// data: { +// task_id: taskInfo.id, +// user_id: person.user_id +// } +// }).then(() => { +// setTaskInfo((prevState) => ({ +// ...prevState, +// taskUsers: taskInfo.taskUsers.filter( +// (item) => item.user_id !== person.user_id +// ) +// })); +// }); +// } - function addMember(person) { - apiRequest("/task/add-user-to-task", { - method: "POST", - data: { - task_id: taskInfo.id, - user_id: person.user_id - } - }).then((res) => { - setDropListMembersOpen(false); - setTaskInfo((prevValue) => ({ - ...prevValue, - taskUsers: [...prevValue.taskUsers, res] - })); - }); - } +// function addMember(person) { +// apiRequest("/task/add-user-to-task", { +// method: "POST", +// data: { +// task_id: taskInfo.id, +// user_id: person.user_id +// } +// }).then((res) => { +// setDropListMembersOpen(false); +// setTaskInfo((prevValue) => ({ +// ...prevValue, +// taskUsers: [...prevValue.taskUsers, res] +// })); +// }); +// } - function selectDeadLine(date) { - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: taskInfo.id, - dead_line: getCorrectRequestDate(date) - } - }).then(() => {}); - } +// function selectDeadLine(date) { +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: taskInfo.id, +// dead_line: getCorrectRequestDate(date) +// } +// }).then(() => {}); +// } - async function handleUpload(event) { - const formData = new FormData(); - formData.append("uploadFile", event.target.files[0]); - const res = await fetch("https://itguild.info/api/file/upload", { - method: "POST", - body: formData, - headers: { ...getToken() } - }); +// async function handleUpload(event) { +// const formData = new FormData(); +// formData.append("uploadFile", event.target.files[0]); +// const res = await fetch("https://itguild.info/api/file/upload", { +// method: "POST", +// body: formData, +// headers: { ...getToken() } +// }); - const data = await res.json(); +// const data = await res.json(); - setUploadedFile(data); - } +// setUploadedFile(data); +// } - function attachFile() { - apiRequest("/file/attach", { - method: "POST", - data: { - file_id: uploadedFile[0].id, - entity_type: 2, - entity_id: taskInfo.id, - status: 1 - } - }).then((res) => { - setTaskFiles((prevValue) => [...prevValue, res]); - setUploadedFile(null); - }); - } +// function attachFile() { +// apiRequest("/file/attach", { +// method: "POST", +// data: { +// file_id: uploadedFile[0].id, +// entity_type: 2, +// entity_id: taskInfo.id, +// status: 1 +// } +// }).then((res) => { +// setTaskFiles((prevValue) => [...prevValue, res]); +// setUploadedFile(null); +// }); +// } - function deleteLoadedFile() { - setUploadedFile(null); - } +// function deleteLoadedFile() { +// setUploadedFile(null); +// } - function updateTaskPriority(key) { - setSelectPriorityOpen(false); - apiRequest("/task/update-task", { - method: "PUT", - data: { - task_id: taskInfo.id, - execution_priority: key - } - }).then(() => {}); - } +// function updateTaskPriority(key) { +// setSelectPriorityOpen(false); +// apiRequest("/task/update-task", { +// method: "PUT", +// data: { +// task_id: taskInfo.id, +// execution_priority: key +// } +// }).then(() => {}); +// } - // function deleteFile(file) { - // apiRequest("/file/detach", { - // method: "DELETE", - // data: { - // file_id: file.id, - // entity_type: 2, - // entity_id: taskInfo.id, - // status: 0, - // }, - // }).then(() => { - // setTaskFiles((prevValue) => - // prevValue.filter((item) => item.id !== file.id) - // ); - // }); - // } +// // function deleteFile(file) { +// // apiRequest("/file/detach", { +// // method: "DELETE", +// // data: { +// // file_id: file.id, +// // entity_type: 2, +// // entity_id: taskInfo.id, +// // status: 0, +// // }, +// // }).then(() => { +// // setTaskFiles((prevValue) => +// // prevValue.filter((item) => item.id !== file.id) +// // ); +// // }); +// // } - function deleteFile(file) { - setTaskFiles((prevValue) => - prevValue.filter((item) => item.id !== file.id) - ); - } +// function deleteFile(file) { +// setTaskFiles((prevValue) => +// prevValue.filter((item) => item.id !== file.id) +// ); +// } - function closeAcceptModal() { - setAcceptModalOpen(false); - } +// function closeAcceptModal() { +// setAcceptModalOpen(false); +// } - function deleteTagFromTask(tagId) { - apiRequest("/mark/detach", { - method: "DELETE", - data: { - mark_id: tagId, - entity_type: 2, - entity_id: taskInfo.id - } - }).then(() => { - setTaskTags((prevValue) => prevValue.filter((tag) => tag.id !== tagId)); - }); - } +// function deleteTagFromTask(tagId) { +// apiRequest("/mark/detach", { +// method: "DELETE", +// data: { +// mark_id: tagId, +// entity_type: 2, +// entity_id: taskInfo.id +// } +// }).then(() => { +// setTaskTags((prevValue) => prevValue.filter((tag) => tag.id !== tagId)); +// }); +// } - function addTagToTask(tagId) { - apiRequest("/mark/attach", { - method: "POST", - data: { - mark_id: tagId, - entity_type: 2, - entity_id: taskInfo.id - } - }).then((data) => { - setSelectTagsOpen(false); - setTaskTags((prevValue) => [...prevValue, data.mark]); - }); - } +// function addTagToTask(tagId) { +// apiRequest("/mark/attach", { +// method: "POST", +// data: { +// mark_id: tagId, +// entity_type: 2, +// entity_id: taskInfo.id +// } +// }).then((data) => { +// setSelectTagsOpen(false); +// setTaskTags((prevValue) => [...prevValue, data.mark]); +// }); +// } - const initListeners = () => { - document.addEventListener("click", closeByClickingOut); - }; +// const initListeners = () => { +// document.addEventListener("click", closeByClickingOut); +// }; - const closeByClickingOut = (event) => { - const path = event.path || (event.composedPath && event.composedPath()); +// const closeByClickingOut = (event) => { +// const path = event.path || (event.composedPath && event.composedPath()); - if ( - event && - !path.find( - (div) => - div.classList && - (div.classList.contains("button-add-worker") || - div.classList.contains("dropdown-list")) - ) - ) { - setDropListOpen(false); - setDropListMembersOpen(false); - } +// if ( +// event && +// !path.find( +// (div) => +// div.classList && +// (div.classList.contains("button-add-worker") || +// div.classList.contains("dropdown-list")) +// ) +// ) { +// setDropListOpen(false); +// setDropListMembersOpen(false); +// } - if ( - event && - !path.find( - (div) => - div.classList && - (div.classList.contains("dead-line") || - div.classList.contains("react-datepicker-popper")) - ) - ) { - setDatePickerOpen(false); - } +// if ( +// event && +// !path.find( +// (div) => +// div.classList && +// (div.classList.contains("dead-line") || +// div.classList.contains("react-datepicker-popper")) +// ) +// ) { +// setDatePickerOpen(false); +// } - if ( - event && - !path.find( - (div) => - div.classList && - (div.classList.contains("tags") || - div.classList.contains("tags__dropDown")) - ) - ) { - setSelectTagsOpen(false); - } - }; +// if ( +// event && +// !path.find( +// (div) => +// div.classList && +// (div.classList.contains("tags") || +// div.classList.contains("tags__dropDown")) +// ) +// ) { +// setSelectTagsOpen(false); +// } +// }; - return ( -
- - -
-
- -

Управление проектами с трекером

-
-
-
-
- toggleTabs(1)} - > - img -

Проекты

- - toggleTabs(2)} - > - img -

Все мои задачи

- -
- {loader ? ( - - ) : ( - <> -
-
-
-
{projectInfo.name}
- -
-

К списку задач

- arrow -
- -
-
-
-
-
-
- {editOpen ? ( - { - setInputsValue((prevValue) => ({ - ...prevValue, - title: e.target.value - })); - }} - /> - ) : ( -
- {inputsValue.title} -
- )} -
- {editOpen ? ( - { - const data = editor.getData(); - setInputsValue((prevValue) => ({ - ...prevValue, - description: data - })); - }} - /> - ) : ( -
-
-
- )} -
- {Boolean(taskFiles.length) && ( -
- {taskFiles.map((file) => { - return ( - - ); - })} -
- )} - {uploadedFile && ( -
- {uploadedFile.map((file) => { - return ( -
- img -
deleteLoadedFile(file)} - > - delete -
-
- ); - })} - -
- )} -
-
-
- - -
- {taskFiles.length ? taskFiles.length : 0} - {caseOfNum(taskFiles.length, "files")} -
-
-
- { - setInputsValue((prevValue) => ({ - ...prevValue, - comment: e.target.value - })); - }} - /> - send -
-
- {comments.map((comment) => { - return ( - - ); - })} -
-
-
-
-
-
- Создатель:

{removeLast(taskInfo.user?.fio)}

-
+// return ( +//
+// +// +//
+//
+// +//

Управление проектами с трекером

+//
+//
+//
+//
+// toggleTabs(1)} +// > +// img +//

Проекты

+// +// toggleTabs(2)} +// > +// img +//

Все мои задачи

+// +//
+// {loader ? ( +// +// ) : ( +// <> +//
+//
+//
+//
{projectInfo.name}
+// +//
+//

К списку задач

+// arrow +//
+// +//
+//
+//
+//
+//
+//
+// {editOpen ? ( +// { +// setInputsValue((prevValue) => ({ +// ...prevValue, +// title: e.target.value +// })); +// }} +// /> +// ) : ( +//
+// {inputsValue.title} +//
+// )} +//
+// {editOpen ? ( +// { +// const data = editor.getData(); +// setInputsValue((prevValue) => ({ +// ...prevValue, +// description: data +// })); +// }} +// /> +// ) : ( +//
+//
+//
+// )} +//
+// {Boolean(taskFiles.length) && ( +//
+// {taskFiles.map((file) => { +// return ( +// +// ); +// })} +//
+// )} +// {uploadedFile && ( +//
+// {uploadedFile.map((file) => { +// return ( +//
+// img +//
deleteLoadedFile(file)} +// > +// delete +//
+//
+// ); +// })} +// +//
+// )} +//
+//
+//
+// +// +//
+// {taskFiles.length ? taskFiles.length : 0} +// {caseOfNum(taskFiles.length, "files")} +//
+//
+//
+// { +// setInputsValue((prevValue) => ({ +// ...prevValue, +// comment: e.target.value +// })); +// }} +// /> +// send +//
+//
+// {comments.map((comment) => { +// return ( +// +// ); +// })} +//
+//
+//
+//
+//
+//
+// Создатель:

{removeLast(taskInfo.user?.fio)}

+//
- {taskInfo.executor ? ( - <> -
Исполнитель:
-
-

{removeLast(taskInfo.executor.fio)}

- avatar - deleteTaskExecutor()} - /> -
- - ) : ( -
- - Добавить исполнителя - {dropListOpen && ( -
- setDropListOpen(false)} - /> - {correctProjectUsers.map((person) => { - return ( -
taskExecutor(person)} - > - {removeLast(person.user.fio)} - avatar -
- ); - })} -
- )} -
- )} - {Boolean(taskInfo.taskUsers.length) && ( -
-

Участники:

-
- {taskInfo.taskUsers.map((member) => { - return ( -
-

{removeLast(member.fio)}

- avatar - deleteMember(member)} - /> -
- ); - })} -
-
- )} -
- - Добавить участника - {dropListMembersOpen && ( -
- setDropListMembersOpen(false)} - /> - {users.length ? ( - users.map((person) => { - return ( -
addMember(person)} - > - {removeLast(person.user.fio)} - avatar -
- ); - }) - ) : ( -

Нет пользователей

- )} -
- )} -
-
+// {taskInfo.executor ? ( +// <> +//
Исполнитель:
+//
+//

{removeLast(taskInfo.executor.fio)}

+// avatar +// deleteTaskExecutor()} +// /> +//
+// +// ) : ( +//
+// +// Добавить исполнителя +// {dropListOpen && ( +//
+// setDropListOpen(false)} +// /> +// {correctProjectUsers.map((person) => { +// return ( +//
taskExecutor(person)} +// > +// {removeLast(person.user.fio)} +// avatar +//
+// ); +// })} +//
+// )} +//
+// )} +// {Boolean(taskInfo.taskUsers.length) && ( +//
+//

Участники:

+//
+// {taskInfo.taskUsers.map((member) => { +// return ( +//
+//

{removeLast(member.fio)}

+// avatar +// deleteMember(member)} +// /> +//
+// ); +// })} +//
+//
+// )} +//
+// +// Добавить участника +// {dropListMembersOpen && ( +//
+// setDropListMembersOpen(false)} +// /> +// {users.length ? ( +// users.map((person) => { +// return ( +//
addMember(person)} +// > +// {removeLast(person.user.fio)} +// avatar +//
+// ); +// }) +// ) : ( +//

Нет пользователей

+// )} +//
+// )} +//
+//
-
-
-
setDatePickerOpen(!datePickerOpen)} - > -

- - {deadLine - ? getCorrectDate(deadLine) - : "Срок исполнения:"} - -
- { - setDatePickerOpen(false); - setStartDate(date); - setDeadLine(date); - selectDeadLine(date); - }} - /> -
-
-

-

- {correctTimerTime(currentTimerCount.hours)}: - {correctTimerTime(currentTimerCount.minute)}: - {correctTimerTime(currentTimerCount.seconds)} -

-
+//
+//
+//
setDatePickerOpen(!datePickerOpen)} +// > +//

+// +// {deadLine +// ? getCorrectDate(deadLine) +// : "Срок исполнения:"} +// +//
+// { +// setDatePickerOpen(false); +// setStartDate(date); +// setDeadLine(date); +// selectDeadLine(date); +// }} +// /> +//
+//
+//

+//

+// {correctTimerTime(currentTimerCount.hours)}: +// {correctTimerTime(currentTimerCount.minute)}: +// {correctTimerTime(currentTimerCount.seconds)} +//

+//
- {timerStart ? ( - - ) : ( - - )} -
-
-
-
- {taskTags.map((tag) => { - return ( -
-

{tag.slug}

- delete deleteTagFromTask(tag.id)} - /> -
- ); - })} -
-
setSelectTagsOpen(!selectTagsOpen)} - > - Выберите тег - arrow -
- {selectTagsOpen && ( -
- setSelectTagsOpen(false)} - className="tags__dropDown__close" - src={close} - alt="close" - /> - {correctProjectTags.map((tag) => { - return ( -
addTagToTask(tag.id)} - > -

{tag.slug}

- -
- ); - })} - {!Boolean(correctProjectTags.length) && ( -

Нет тегов

- )} -
- )} -
-
+// {timerStart ? ( +// +// ) : ( +// +// )} +//
+//
+//
+//
+// {taskTags.map((tag) => { +// return ( +//
+//

{tag.slug}

+// delete deleteTagFromTask(tag.id)} +// /> +//
+// ); +// })} +//
+//
setSelectTagsOpen(!selectTagsOpen)} +// > +// Выберите тег +// arrow +//
+// {selectTagsOpen && ( +//
+// setSelectTagsOpen(false)} +// className="tags__dropDown__close" +// src={close} +// alt="close" +// /> +// {correctProjectTags.map((tag) => { +// return ( +//
addTagToTask(tag.id)} +// > +//

{tag.slug}

+// +//
+// ); +// })} +// {!Boolean(correctProjectTags.length) && ( +//

Нет тегов

+// )} +//
+// )} +//
+//
-
-
setSelectPriorityOpen(!selectPriorityOpen)} - > - - {typeof taskPriority === "number" - ? `Приоритет: ${priority[taskPriority]}` - : "Выберите приоритет"} - - arrow -
- {selectPriorityOpen && ( -
- {priorityTypes.map((item) => { - return ( -
{ - setTaskPriority(item.key); - updateTaskPriority(item.key); - }} - > - {item.name} -
- ); - })} -
- )} -
-
-
{ - if (editOpen) { - editTask(); - } else { - setEditOpen(!editOpen); - } - }} - > - edit -

{editOpen ? "сохранить" : "редактировать"}

-
-
- link -

ссылка на задачу

-
-
- arch -

в архив

-
-
- delete -

удалить

-
-
-
-
- - )} -
- {acceptModalOpen && ( - - )} -
-
- ); -}; +//
+//
setSelectPriorityOpen(!selectPriorityOpen)} +// > +// +// {typeof taskPriority === "number" +// ? `Приоритет: ${priority[taskPriority]}` +// : "Выберите приоритет"} +// +// arrow +//
+// {selectPriorityOpen && ( +//
+// {priorityTypes.map((item) => { +// return ( +//
{ +// setTaskPriority(item.key); +// updateTaskPriority(item.key); +// }} +// > +// {item.name} +//
+// ); +// })} +//
+// )} +//
+//
+//
{ +// if (editOpen) { +// editTask(); +// } else { +// setEditOpen(!editOpen); +// } +// }} +// > +// edit +//

{editOpen ? "сохранить" : "редактировать"}

+//
+//
+// link +//

ссылка на задачу

+//
+//
+// arch +//

в архив

+//
+//
+// delete +//

удалить

+//
+//
+//
+//
+// +// )} +//
+// {acceptModalOpen && ( +// +// )} +//
+//
+// ); +// }; -export default TicketFullScreen; +// export default TicketFullScreen; diff --git a/src/components/TrackerCardTask/TrackerCardTask.jsx b/src/components/TrackerCardTask/TrackerCardTask.jsx index bd5322e7..48aa24b6 100644 --- a/src/components/TrackerCardTask/TrackerCardTask.jsx +++ b/src/components/TrackerCardTask/TrackerCardTask.jsx @@ -106,14 +106,7 @@ const TrackerCardTask = ({ onDrop={(e) => dragDropTaskHandler(e, task, column)} onClick={(e) => openTicket(e, task)} > -
{ - if (window.innerWidth < 985) { - window.location.replace(`/tracker/task/${task.id}`); - } - }} - > +

{task.title}

{

ITGu
ild

- +
+ +
diff --git a/src/pages/LandingTracker/LandingTracker.scss b/src/pages/LandingTracker/LandingTracker.scss index 2df20f02..5647f271 100644 --- a/src/pages/LandingTracker/LandingTracker.scss +++ b/src/pages/LandingTracker/LandingTracker.scss @@ -57,6 +57,32 @@ position: absolute; bottom: -85px; right: -150px; + + &::before { + content: "Не нужно заваривать мышь"; + display: flex; + align-items: center; + position: relative; + top: 100px; + left: -80px; + width: 182px; + height: 106px; + border-radius: 8px; + border: 0.5px solid #ffffff; + background: linear-gradient( + 110.06deg, + rgba(255, 255, 255, 0.34) 0%, + rgba(199, 206, 198, 0.34) 99.25% + ); + backdrop-filter: blur(8.6999998093px); + box-shadow: 10px 9px 14px 0 rgba(0, 0, 0, 0.06); + padding: 0 15px; + font-size: 17px; + font-weight: 700; + line-height: 19.72px; + letter-spacing: 0.01em; + text-align: center; + } } } diff --git a/src/pages/OpenRequests/OpenRequest.jsx b/src/pages/OpenRequests/OpenRequest.jsx new file mode 100644 index 00000000..1bd5f17a --- /dev/null +++ b/src/pages/OpenRequests/OpenRequest.jsx @@ -0,0 +1,32 @@ +import React from "react"; + +import { Footer } from "@components/Common/Footer/Footer"; +import { Navigation } from "@components/Navigation/Navigation"; +import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; +import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; + +import "./OpenRequest.scss"; + +export const OpenRequest = () => { + return ( +
+ + +
+
+ +

Работа в IT открытые запросы

+
+
+
+
+ ); +}; diff --git a/src/pages/OpenRequests/OpenRequest.scss b/src/pages/OpenRequests/OpenRequest.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/pages/Profile/Profile.jsx b/src/pages/Profile/Profile.jsx index 2f543d6a..e48803a6 100644 --- a/src/pages/Profile/Profile.jsx +++ b/src/pages/Profile/Profile.jsx @@ -29,7 +29,7 @@ export const Profile = () => { const [profileItemsInfo] = useState({ developer: [ { - path: "profile", + path: "profile/open-requests", img: paymentIcon, title: "Работа в IT
открытые запросы", description: "Перейдите чтобы посмотреть
открытые позиции" diff --git a/src/pages/ProjectTracker/ProjectTracker.jsx b/src/pages/ProjectTracker/ProjectTracker.jsx index 161defd9..1bee26dc 100644 --- a/src/pages/ProjectTracker/ProjectTracker.jsx +++ b/src/pages/ProjectTracker/ProjectTracker.jsx @@ -1,7 +1,7 @@ import moment from "moment"; import React, { useEffect, useRef, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { Link, useParams } from "react-router-dom"; +import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; import { activeLoader, @@ -51,6 +51,8 @@ import avatarMok from "assets/images/avatarMok.webp"; export const ProjectTracker = () => { const dispatch = useDispatch(); const projectId = useParams(); + const location = useLocation(); + const navigate = useNavigate(); const [openColumnSelect, setOpenColumnSelect] = useState({}); const [selectedTab, setSelectedTab] = useState(0); @@ -97,6 +99,24 @@ export const ProjectTracker = () => { } else { setFilteredNoTasks(false); } + + const path = location.pathname; + const match = path.match(/\/task\/(\d+)/); + console.log(match); + if (match) { + const extractedTaskId = match[1]; + + console.log(extractedTaskId); + // Убираем /task/id из URL + const newUrl = path.replace(/\/task\/\d+/, ""); + navigate(newUrl, { replace: true }); + + // Открываем тикет + console.log("asd", projectBoard); + const Dtask = tasks.find((task) => task.id === extractedTaskId); + console.log("asd", Dtask); + // openTicket(extractedTaskId); + } }, [projectBoard]); function dragOverHandler(e) { @@ -148,9 +168,16 @@ export const ProjectTracker = () => { function openTicket(e, task) { setSelectedTicket(task); setModalActiveTicket(true); + const currentUrl = window.location.pathname; + const newUrl = `${currentUrl}/task/${task.id}`; + window.history.pushState({}, "", newUrl); document.body.style.overflow = "hidden"; } + // useEffect(() => { + + // }, [location]); + function deleteColumn(column) { const priorityColumns = []; apiRequest("/project-column/update-column", { diff --git a/src/pages/roles/DeveloperPage.jsx b/src/pages/roles/DeveloperPage.jsx index b083f7c0..7f325c40 100644 --- a/src/pages/roles/DeveloperPage.jsx +++ b/src/pages/roles/DeveloperPage.jsx @@ -1,6 +1,7 @@ import React from "react"; -import { Navigate, Route, Routes } from "react-router-dom"; +import { Route, Routes } from "react-router-dom"; +import { OpenRequest } from "@pages/OpenRequests/openRequest"; import { PartnerSettings } from "@pages/PartnerSettings/PartnerSettings"; import { PartnerTreaties } from "@pages/PartnerTreaties/PartnerTreaties"; import { Payouts } from "@pages/Payouts/Payouts"; @@ -14,7 +15,6 @@ import { Summary } from "@pages/Summary/Summary"; import { Tracker } from "@pages/Tracker/Tracker"; import { ViewReport } from "@pages/ViewReport/ViewReport"; -import { TicketFullScreen } from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen"; import { ProfileCalendar } from "@components/ProfileCalendar/ProfileCalendar"; import { ReportForm } from "@components/ReportForm/ReportForm"; @@ -23,9 +23,10 @@ export const DeveloperPage = () => { } - > + path="/tracker/project/:id/task/:taskId" + element={} + /> + } /> @@ -33,6 +34,7 @@ export const DeveloperPage = () => { } /> } /> } /> + } /> } /> } /> } /> @@ -45,7 +47,7 @@ export const DeveloperPage = () => { } /> - } /> + {/* } /> */} ); }; diff --git a/src/pages/roles/PartnerPage.jsx b/src/pages/roles/PartnerPage.jsx index a94d9f5c..de52b5d5 100644 --- a/src/pages/roles/PartnerPage.jsx +++ b/src/pages/roles/PartnerPage.jsx @@ -19,7 +19,6 @@ import { ViewReport } from "@pages/ViewReport/ViewReport"; import { Calendar } from "@components/Calendar/Calendar"; import { Candidate } from "@components/Candidate/Candidate"; -import { TicketFullScreen } from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen"; export const PartnerPage = () => { return ( @@ -28,11 +27,6 @@ export const PartnerPage = () => { } /> } /> - } - > } />