diff --git a/src/components/FileTracker/FileTracker.jsx b/src/components/FileTracker/FileTracker.jsx index 5b967636..e4c0ca3c 100644 --- a/src/components/FileTracker/FileTracker.jsx +++ b/src/components/FileTracker/FileTracker.jsx @@ -1,47 +1,50 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; + import { backendImg } from "@utils/helper"; + +import { apiRequest } from "@api/request"; + import close from "assets/icons/closeProjectPersons.svg"; -import {apiRequest} from "@api/request"; - const FileTracker = ({ file, setDeletedTask, taskId }) => { - const [openImg, setOpenImg] = useState(false) - function deleteFile(file) { - apiRequest("/file/detach", { - method: "DELETE", - data: { - file_id: file.id, - entity_type: 2, - entity_id: taskId, - status: 0, - }, - }).then(() => { - setDeletedTask(file); - }); - } + const [openImg, setOpenImg] = useState(false); + function deleteFile(file) { + apiRequest("/file/detach", { + method: "DELETE", + data: { + file_id: file.id, + entity_type: 2, + entity_id: taskId, + status: 0, + }, + }).then(() => { + setDeletedTask(file); + }); + } - return ( -
- {if(openImg) setOpenImg(!openImg)}} - > - img - {if(!openImg) setOpenImg(!openImg)}} - /> - {!openImg && -
deleteFile(file)} - > - delete -
- } + return ( +
{ + if (openImg) setOpenImg(!openImg); + }} + > + img { + if (!openImg) setOpenImg(!openImg); + }} + /> + {!openImg && ( +
deleteFile(file)}> + delete
- ); + )} +
+ ); }; export default FileTracker; diff --git a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx index 8e249358..363611e8 100644 --- a/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx +++ b/src/components/Modal/Tracker/ModalTicket/ModalTicket.jsx @@ -22,10 +22,10 @@ import { apiRequest } from "@api/request"; import { useNotification } from "@hooks/useNotification"; +import FileTracker from "@components/FileTracker/FileTracker"; import AcceptModal from "@components/Modal/AcceptModal/AcceptModal"; import TrackerModal from "@components/Modal/Tracker/TrackerModal/TrackerModal"; import TrackerTaskComment from "@components/TrackerTaskComment/TrackerTaskComment"; -import FileTracker from "@components/FileTracker/FileTracker"; import archive from "assets/icons/archive.svg"; import arrow from "assets/icons/arrows/arrowStart.png"; @@ -53,7 +53,7 @@ export const ModalTiсket = ({ projectId, projectName, projectUsers, - projectOwnerId + projectOwnerId, }) => { const dispatch = useDispatch(); const [addSubtask, setAddSubtask] = useState(false); @@ -373,9 +373,9 @@ export const ModalTiсket = ({ } function deleteFile(file) { - setTaskFiles((prevValue) => - prevValue.filter((item) => item.id !== file.id) - ); + setTaskFiles((prevValue) => + prevValue.filter((item) => item.id !== file.id) + ); } function startTimer() { @@ -525,12 +525,12 @@ export const ModalTiсket = ({
{taskFiles.map((file) => { return ( - + ); })}
@@ -823,12 +823,27 @@ export const ModalTiсket = ({

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

-
+

в архив

-
+

удалить

diff --git a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx index e226ad79..a624be02 100644 --- a/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx +++ b/src/components/Modal/Tracker/TicketFullScreen/TicketFullScreen.jsx @@ -6,6 +6,7 @@ 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 { deletePersonOnProject, getBoarderLoader, @@ -13,8 +14,6 @@ import { setToggleTab, } from "@redux/projectsTrackerSlice"; -import { getProfileInfo } from "@redux/outstaffingSlice"; - import { backendImg, caseOfNum, @@ -1000,13 +999,26 @@ export const TicketFullScreen = () => { link

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

-
+
arch

в архив

-
delete

удалить