pop-up notifications
This commit is contained in:
parent
8797ba0778
commit
727d55798a
10
package-lock.json
generated
10
package-lock.json
generated
@ -8148,9 +8148,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001458",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001458.tgz",
|
||||
"integrity": "sha512-lQ1VlUUq5q9ro9X+5gOEyH7i3vm+AYVT1WDCVB69XOZ17KZRhnZ9J0Sqz7wTHQaLBJccNCHq8/Ww5LlOIZbB0w==",
|
||||
"version": "1.0.30001597",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz",
|
||||
"integrity": "sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@ -8159,6 +8159,10 @@
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -4,10 +4,15 @@ import { backendImg } from "@utils/helper";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import close from "assets/icons/closeProjectPersons.svg";
|
||||
|
||||
const FileTracker = ({ file, setDeletedTask, taskId }) => {
|
||||
const [openImg, setOpenImg] = useState(false);
|
||||
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
function deleteFile(file) {
|
||||
apiRequest("/file/detach", {
|
||||
method: "DELETE",
|
||||
@ -17,8 +22,21 @@ const FileTracker = ({ file, setDeletedTask, taskId }) => {
|
||||
entity_id: taskId,
|
||||
status: 0
|
||||
}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
setDeletedTask(file);
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Файл успешно удален",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка при удалении файла",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,8 @@ import withReactContent from "sweetalert2-react-content";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import { Loader } from "@components/Common/Loader/Loader";
|
||||
|
||||
import "./form.scss";
|
||||
@ -18,6 +20,8 @@ const Form = () => {
|
||||
|
||||
const urlParams = useParams();
|
||||
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
const [status, setStatus] = useState(null);
|
||||
const [data, setData] = useState({
|
||||
email: "",
|
||||
@ -75,9 +79,22 @@ const Form = () => {
|
||||
profile_id: urlParams.id,
|
||||
...data
|
||||
}
|
||||
}).then((res) => {
|
||||
})
|
||||
.then((res) => {
|
||||
setStatus(res);
|
||||
setIsFetching(false);
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Отправка успешно завершена",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка отправки",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -10,6 +10,8 @@ import { caseOfNum, removeLast, urlForLocal } from "@utils/helper";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
|
||||
|
||||
import close from "assets/icons/close.png";
|
||||
@ -24,6 +26,7 @@ const ListEmployees = ({
|
||||
setModalAdd
|
||||
}) => {
|
||||
const dispatch = useDispatch();
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
function deletePerson(userId) {
|
||||
apiRequest("/project/del-user", {
|
||||
@ -32,8 +35,21 @@ const ListEmployees = ({
|
||||
project_id: projectBoard.id,
|
||||
user_id: userId
|
||||
}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
dispatch(deletePersonOnProject(userId));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Участник успешно удален",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка удаления участника",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -118,13 +118,21 @@ export const ModalTiсket = ({
|
||||
task_id: task.id,
|
||||
status: 0
|
||||
}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
closeModal();
|
||||
dispatch(setProjectBoardFetch(projectId));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Задача успешно была перемещена в архив",
|
||||
type: "archive"
|
||||
text: "Задача успешно удалена",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка удаления",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -169,7 +177,8 @@ export const ModalTiсket = ({
|
||||
title: inputsValue.title,
|
||||
description: inputsValue.description
|
||||
}
|
||||
}).then((res) => {
|
||||
})
|
||||
.then((res) => {
|
||||
setEditOpen(!editOpen);
|
||||
dispatch(setProjectBoardFetch(projectId));
|
||||
showNotification({
|
||||
@ -177,6 +186,13 @@ export const ModalTiсket = ({
|
||||
text: "Изменения сохранены",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка при сохранении изменений",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -137,13 +137,21 @@ export const TrackerModal = ({
|
||||
: 1,
|
||||
title: valueColumn
|
||||
}
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
dispatch(setProjectBoardFetch(projectBoard.id));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Колонка создана",
|
||||
text: "Колонка успешно создана",
|
||||
type: "success"
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Ошибка при создании колонки",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
setValueColumn("");
|
||||
setActive(false);
|
||||
@ -221,7 +229,7 @@ export const TrackerModal = ({
|
||||
setDeadLineDate("");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Задача создана",
|
||||
text: "Задача успешно создана",
|
||||
type: "success"
|
||||
});
|
||||
}
|
||||
@ -295,7 +303,7 @@ export const TrackerModal = ({
|
||||
dispatch(editColumnName({ id: columnId, title: columnName }));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Колонка создана",
|
||||
text: "Колонка успешно изменена",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
@ -316,6 +324,11 @@ export const TrackerModal = ({
|
||||
dispatch(setProject(result));
|
||||
setActive(false);
|
||||
setNameProject("");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Проект успешно создан",
|
||||
type: "success"
|
||||
});
|
||||
} else {
|
||||
showNotification({
|
||||
show: true,
|
||||
|
@ -34,6 +34,11 @@ export const QuizPassingInformation = ({ setStartTest, uuid, timer }) => {
|
||||
}
|
||||
dispatch(setQuestions(res));
|
||||
setStartTest(true);
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Тест успешно запущен",
|
||||
type: "success"
|
||||
});
|
||||
restart(
|
||||
moment()
|
||||
.add(res[0]?.time_limit.split(":")[0], "hours")
|
||||
|
@ -6,6 +6,8 @@ import { getPartnerRequestInfo } from "@redux/outstaffingSlice";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import { Footer } from "@components/Common/Footer/Footer";
|
||||
import { Navigation } from "@components/Navigation/Navigation";
|
||||
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
||||
@ -47,6 +49,7 @@ export const PartnerAddRequest = () => {
|
||||
"Выберите кол-во сотрудников"
|
||||
);
|
||||
const [inputs, setInputs] = useState({ title: "", description: "" });
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
if (
|
||||
currentUrl[0] === "/profile/requests-edit" &&
|
||||
@ -120,6 +123,11 @@ export const PartnerAddRequest = () => {
|
||||
}
|
||||
}).then(() => {
|
||||
navigate("/profile/requests");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Вакансия успешно изменена",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
} else {
|
||||
apiRequest("/request/create-request", {
|
||||
@ -138,6 +146,11 @@ export const PartnerAddRequest = () => {
|
||||
}
|
||||
}).then(() => {
|
||||
navigate("/profile/requests");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Вакансия успешно создана",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -14,6 +14,8 @@ import { urlForLocal } from "@utils/helper";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import { Footer } from "@components/Common/Footer/Footer";
|
||||
import { Loader } from "@components/Common/Loader/Loader";
|
||||
import ModalLayout from "@components/Common/ModalLayout/ModalLayout";
|
||||
@ -37,6 +39,7 @@ export const PartnerBid = () => {
|
||||
const requestId = useSelector(getPartnerRequestId);
|
||||
const partnerRequests = useSelector(getPartnerRequests);
|
||||
const navigate = useNavigate();
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
if (!requestId) {
|
||||
return <Navigate to="/profile/requests" replace />;
|
||||
@ -61,6 +64,11 @@ export const PartnerBid = () => {
|
||||
}
|
||||
}).then(() => {
|
||||
navigate("/profile/requests");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Вакансия удалена",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -256,7 +256,11 @@ export const ProjectTracker = () => {
|
||||
} else {
|
||||
dispatch(setProjectBoardFetch(projectBoard.id));
|
||||
}
|
||||
showNotification({ show: true, text: "Колонка удалена", type: "error" });
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Колонка удалена",
|
||||
type: "error"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -319,6 +323,11 @@ export const ProjectTracker = () => {
|
||||
...prevState,
|
||||
add: false
|
||||
}));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Тег успешно создан",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -340,6 +349,11 @@ export const ProjectTracker = () => {
|
||||
}));
|
||||
setTagInfo({ description: "", name: "" });
|
||||
setColor("#aabbcc");
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Тег успешно изменён",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -353,6 +367,11 @@ export const ProjectTracker = () => {
|
||||
}
|
||||
}).then(() => {
|
||||
dispatch(deleteTagProject(tagId));
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Тег удален",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,8 @@ import { urlForLocal } from "@utils/helper";
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import { Footer } from "@components/Common/Footer/Footer";
|
||||
import { Navigation } from "@components/Navigation/Navigation";
|
||||
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
|
||||
@ -37,6 +39,7 @@ export const Summary = () => {
|
||||
const [selectedSkills, setSelectedSkills] = useState([]);
|
||||
const [selectSkillsOpen, setSelectSkillsOpen] = useState(false);
|
||||
const [skillsList, seSkillsList] = useState([]);
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
useEffect(() => {
|
||||
apiRequest(
|
||||
@ -72,7 +75,13 @@ export const Summary = () => {
|
||||
data: {
|
||||
resume: summery
|
||||
}
|
||||
}).then(() => {});
|
||||
}).then(() => {
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Изменения успешно сохранены",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
}
|
||||
return (
|
||||
<div className="summary">
|
||||
|
@ -12,6 +12,8 @@ import {
|
||||
|
||||
import { apiRequest } from "@api/request";
|
||||
|
||||
import { useNotification } from "@hooks/useNotification";
|
||||
|
||||
import { Footer } from "@components/Common/Footer/Footer";
|
||||
import { Loader } from "@components/Common/Loader/Loader";
|
||||
import { Navigation } from "@components/Navigation/Navigation";
|
||||
@ -38,6 +40,7 @@ export const ViewReport = () => {
|
||||
const [loader, setLoader] = useState(false);
|
||||
const [deleteLoader, setDeleteLoader] = useState(false);
|
||||
const [reportInfo, setReportInfo] = useState({});
|
||||
const { showNotification } = useNotification();
|
||||
|
||||
function getReportFromDate(day) {
|
||||
setLoader(true);
|
||||
@ -84,6 +87,11 @@ export const ViewReport = () => {
|
||||
if (res) {
|
||||
window.location.replace("/profile/calendar");
|
||||
}
|
||||
showNotification({
|
||||
show: true,
|
||||
text: "Отчет удален",
|
||||
type: "success"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user