diff --git a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx index 8da9f485..5e23fdca 100644 --- a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx +++ b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx @@ -40,6 +40,7 @@ import crossWhite from "assets/icons/crossWhite.svg"; import avatarMok from "assets/images/avatarMok.png"; import "./trackerModal.scss"; +import { Loader } from "@components/Common/Loader/Loader"; registerLocale("ru", ru); @@ -90,6 +91,7 @@ export const TrackerModal = ({ const [deadLineDate, setDeadLineDate] = useState(""); const [datePickerOpen, setDatePickerOpen] = useState(false); const [startDate, setStartDate] = useState(new Date()); + const [loader, setLoader] = useState(false) const priority = [ { @@ -138,6 +140,8 @@ export const TrackerModal = ({ return; } + setLoader(true) + apiRequest("/task/create-task", { method: "POST", data: { @@ -158,6 +162,7 @@ export const TrackerModal = ({ text: "Задача с таким именем уже существует", type: "error" }); + setLoader(false) } else { for (let i = 0; i < taskTags.length; i++) { apiRequest("/mark/attach", { @@ -185,9 +190,11 @@ export const TrackerModal = ({ setDescriptionTicket(""); setSelectedExecutorTask("Выберите исполнителя"); setSelectedPriority(null); + setLoader(false) }); } else { setActive(false); + setLoader(false) setValueTicket(""); setDescriptionTicket(""); dispatch(setProjectBoardFetch(projectBoard.id)); @@ -702,9 +709,11 @@ export const TrackerModal = ({ - + {loader ? : + Создать - + + } )} diff --git a/src/components/Notification/notification.scss b/src/components/Notification/notification.scss index 7bf0b0fd..9cdba5ce 100644 --- a/src/components/Notification/notification.scss +++ b/src/components/Notification/notification.scss @@ -5,7 +5,7 @@ position: fixed; bottom: 25px; right: 25px; - z-index: 20; + z-index: 10000; &__info { display: flex; diff --git a/src/pages/PartnerAddRequest/PartnerAddRequest.js b/src/pages/PartnerAddRequest/PartnerAddRequest.js index d56f0f94..6b34fc99 100644 --- a/src/pages/PartnerAddRequest/PartnerAddRequest.js +++ b/src/pages/PartnerAddRequest/PartnerAddRequest.js @@ -56,6 +56,7 @@ export const PartnerAddRequest = () => { } useEffect(() => { + initListeners(); apiRequest(`/profile/positions-list`).then((el) => setSpecializationList(el) ); @@ -141,6 +142,31 @@ export const PartnerAddRequest = () => { } }; + 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("form__block__section__selects") || + div.classList.contains("form__block__dropDown") + || div.classList.contains("form__block__skills") || + div.classList.contains("form__block__section__select")) + ) + ) { + setOpenSkillsSelect(false) + setOpenSpecializationListOpen(false) + setOpenLevelList(false) + setOpenCountList(false) + } + }; + return (