removed unused code
This commit is contained in:
parent
6b6ec37da4
commit
9e311ef73c
@ -8,24 +8,19 @@ import {
|
||||
import Breadcrumb from "../../components/common/Breadcrumb";
|
||||
import AttendanceLog from "../../components/Activities/AttendcesLogs";
|
||||
import Attendance from "../../components/Activities/Attendance";
|
||||
// import AttendanceModel from "../../components/Activities/AttendanceModel";
|
||||
import showToast from "../../services/toastService";
|
||||
// import { useProjects } from "../../hooks/useProjects";
|
||||
import Regularization from "../../components/Activities/Regularization";
|
||||
import { useAttendance } from "../../hooks/useAttendance";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { setProjectId } from "../../slices/localVariablesSlice";
|
||||
// import { markCurrentAttendance } from "../../slices/apiSlice/attendanceAllSlice";
|
||||
import { hasUserPermission } from "../../utils/authUtils";
|
||||
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||
import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
|
||||
import eventBus from "../../services/eventBus";
|
||||
// import AttendanceRepository from "../../repositories/AttendanceRepository";
|
||||
import { useProjectName } from "../../hooks/useProjects";
|
||||
import GlobalModel from "../../components/common/GlobalModel";
|
||||
import CheckCheckOutmodel from "../../components/Activities/CheckCheckOutForm";
|
||||
import AttendLogs from "../../components/Activities/AttendLogs";
|
||||
// import Confirmation from "../../components/Activities/Confirmation";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
const AttendancePage = () => {
|
||||
@ -35,11 +30,7 @@ const AttendancePage = () => {
|
||||
const loginUser = getCachedProfileData();
|
||||
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||
const dispatch = useDispatch();
|
||||
// const {
|
||||
// attendance,
|
||||
// loading: attLoading,
|
||||
// recall: attrecall,
|
||||
// } = useAttendance(selectedProject);
|
||||
|
||||
const [attendances, setAttendances] = useState();
|
||||
const [empRoles, setEmpRoles] = useState(null);
|
||||
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
|
||||
@ -53,33 +44,6 @@ const AttendancePage = () => {
|
||||
date: new Date().toLocaleDateString(),
|
||||
});
|
||||
|
||||
// const handler = useCallback(
|
||||
// (msg) => {
|
||||
// if (selectedProject == msg.projectId) {
|
||||
// const updatedAttendance = attendances.map((item) =>
|
||||
// item.employeeId === msg.response.employeeId
|
||||
// ? { ...item, ...msg.response }
|
||||
// : item
|
||||
// );
|
||||
// queryClient.setQueryData(["attendance", selectedProject], (oldData) => {
|
||||
// if (!oldData) return oldData;
|
||||
// return oldData.map((emp) =>
|
||||
// emp.employeeId === data.employeeId ? { ...emp, ...data } : emp
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// [selectedProject, attrecall]
|
||||
// );
|
||||
|
||||
// const employeeHandler = useCallback(
|
||||
// (msg) => {
|
||||
// if (attendances.some((item) => item.employeeId == msg.employeeId)) {
|
||||
// attrecall();
|
||||
// }
|
||||
// },
|
||||
// [selectedProject, attendances]
|
||||
// );
|
||||
useEffect(() => {
|
||||
if (selectedProject == null) {
|
||||
dispatch(setProjectId(projectNames[0]?.id));
|
||||
@ -117,32 +81,9 @@ const AttendancePage = () => {
|
||||
}
|
||||
}, [modelConfig, isCreateModalOpen]);
|
||||
|
||||
// useEffect(() => {
|
||||
// eventBus.on("attendance", handler);
|
||||
// return () => eventBus.off("attendance", handler);
|
||||
// }, [handler]);
|
||||
|
||||
// useEffect(() => {
|
||||
// eventBus.on("employee", employeeHandler);
|
||||
// return () => eventBus.off("employee", employeeHandler);
|
||||
// }, [employeeHandler]);
|
||||
return (
|
||||
<>
|
||||
{/* {isCreateModalOpen && modelConfig && (
|
||||
<div
|
||||
className="modal fade show"
|
||||
style={{ display: "block" }}
|
||||
id="check-Out-modalg"
|
||||
tabIndex="-1"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<AttendanceModel
|
||||
modelConfig={modelConfig}
|
||||
closeModal={closeModal}
|
||||
handleSubmitForm={handleSubmit}
|
||||
/>
|
||||
</div>
|
||||
)} */}
|
||||
|
||||
{isCreateModalOpen && modelConfig && (
|
||||
<GlobalModel
|
||||
isOpen={isCreateModalOpen}
|
||||
|
Loading…
x
Reference in New Issue
Block a user