fixes
This commit is contained in:
@ -379,7 +379,7 @@ export const ModalTiсket = ({
|
||||
const data = await res.json();
|
||||
|
||||
// setUploadedFile(data);
|
||||
attachFile(data[0].id)
|
||||
attachFile(data[0].id);
|
||||
}
|
||||
|
||||
// function deleteLoadedFile() {
|
||||
|
@ -29,13 +29,13 @@ import { useNotification } from "@hooks/useNotification";
|
||||
import { getCorrectDate } from "@components/Calendar/calendarHelper";
|
||||
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 TrackerModal from "@components/Modal/Tracker/TrackerModal/TrackerModal";
|
||||
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 FileTracker from "@components/FileTracker/FileTracker";
|
||||
|
||||
import arrow from "assets/icons/arrows/arrowCalendar.png";
|
||||
import arrowStart from "assets/icons/arrows/arrowStart.png";
|
||||
@ -502,7 +502,7 @@ export const TicketFullScreen = () => {
|
||||
|
||||
function deleteFile(file) {
|
||||
setTaskFiles((prevValue) =>
|
||||
prevValue.filter((item) => item.id !== file.id)
|
||||
prevValue.filter((item) => item.id !== file.id)
|
||||
);
|
||||
}
|
||||
|
||||
@ -807,12 +807,12 @@ export const TicketFullScreen = () => {
|
||||
<div className="task__files filesFullScreen">
|
||||
{taskFiles.map((file) => {
|
||||
return (
|
||||
<FileTracker
|
||||
key={file.id}
|
||||
file={file}
|
||||
setDeletedTask={deleteFile}
|
||||
taskId={taskInfo.id}
|
||||
/>
|
||||
<FileTracker
|
||||
key={file.id}
|
||||
file={file}
|
||||
setDeletedTask={deleteFile}
|
||||
taskId={taskInfo.id}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
@ -321,6 +321,7 @@ export const TrackerModal = ({
|
||||
} else {
|
||||
setCorrectProjectUsers(projectUsers);
|
||||
}
|
||||
initListeners()
|
||||
}, [active]);
|
||||
|
||||
useEffect(() => {
|
||||
@ -335,6 +336,38 @@ export const TrackerModal = ({
|
||||
}
|
||||
}, [taskTags, projectMarks]);
|
||||
|
||||
const initListeners = () => {
|
||||
document.addEventListener("click", closeByClickingOut);
|
||||
};
|
||||
|
||||
const closeByClickingOut = (event) => {
|
||||
const path = event.path || (event.composedPath && event.composedPath());
|
||||
|
||||
if (
|
||||
event &&
|
||||
!path.find(
|
||||
(div) =>
|
||||
div.classList &&
|
||||
(div.classList.contains("tags__selected__name") ||
|
||||
div.classList.contains("tags__dropDown"))
|
||||
)
|
||||
) {
|
||||
setSelectTagsOpen(false)
|
||||
}
|
||||
|
||||
if (
|
||||
event &&
|
||||
!path.find(
|
||||
(div) =>
|
||||
div.classList &&
|
||||
(div.classList.contains("select__executor") ||
|
||||
div.classList.contains("select__executor__dropDown"))
|
||||
)
|
||||
) {
|
||||
setSelectExecutorTaskOpen(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<ModalLayout
|
||||
active={active}
|
||||
|
Reference in New Issue
Block a user