From 7f33d5e6bd26aa0731950ab5be6ef211779cb15a Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Wed, 8 Oct 2025 18:25:01 +0530 Subject: [PATCH] Attendance Tab Should Display All Records for Each Employee --- src/components/Activities/AttendcesLogs.jsx | 4 +++ src/components/Activities/Regularization.jsx | 5 +++ src/components/Employee/EmpAttendance.jsx | 32 +++++++---------- src/hooks/useAttendance.js | 5 +-- src/repositories/AttendanceRepository.jsx | 38 +++++++++++--------- 5 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx index 3f520604..e2c3a9f8 100644 --- a/src/components/Activities/AttendcesLogs.jsx +++ b/src/components/Activities/AttendcesLogs.jsx @@ -243,6 +243,7 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => { return () => eventBus.off("employee", employeeHandler); }, [employeeHandler]); + return ( <>
{ Name + Project Name Date {/* Organization */} + Check-In @@ -341,6 +344,7 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => {
+ {attendance.projectName || "--"} {moment( attendance.checkInTime || attendance.checkOutTime diff --git a/src/components/Activities/Regularization.jsx b/src/components/Activities/Regularization.jsx index 24aa831e..fb7bfe2f 100644 --- a/src/components/Activities/Regularization.jsx +++ b/src/components/Activities/Regularization.jsx @@ -11,6 +11,7 @@ import { cacheData, clearCacheKey, useSelectedProject } from "../../slices/apiDa import { useQueryClient } from "@tanstack/react-query"; import Pagination from "../common/Pagination"; import { useNavigate } from "react-router-dom"; +import { employee } from "../../data/masters"; const Regularization = ({ handleRequest, searchTerm, projectId, organizationId, IncludeInActive }) => { const queryClient = useQueryClient(); @@ -119,6 +120,8 @@ const Regularization = ({ handleRequest, searchTerm, projectId, organizationId, return () => eventBus.off("employee", employeeHandler); }, [employeeHandler]); + console.log("Kartik",currentItems) + return (
{loading ? ( @@ -130,6 +133,7 @@ const Regularization = ({ handleRequest, searchTerm, projectId, organizationId, Name + Project Name Date {/* Organization */} @@ -169,6 +173,7 @@ const Regularization = ({ handleRequest, searchTerm, projectId, organizationId,
+ {att.projectName || "--"} {moment(att.checkOutTime).format("DD-MMM-YYYY")} {/* {att.organizationName || "--"} */} diff --git a/src/components/Employee/EmpAttendance.jsx b/src/components/Employee/EmpAttendance.jsx index db58261d..75dd5b6d 100644 --- a/src/components/Employee/EmpAttendance.jsx +++ b/src/components/Employee/EmpAttendance.jsx @@ -99,7 +99,7 @@ const EmpAttendance = ({ employee }) => { if ( !existing || new Date(rec.checkInTime || rec.checkOutTime) > - new Date(existing.checkInTime || existing.checkOutTime) + new Date(existing.checkInTime || existing.checkOutTime) ) { uniqueMap.set(key, rec); } @@ -123,7 +123,7 @@ const EmpAttendance = ({ employee }) => { }; const closeModal = () => setIsModalOpen(false); - const onSubmit = (formData) => {}; + const onSubmit = (formData) => { }; return ( <> {isModalOpen && ( @@ -152,20 +152,14 @@ const EmpAttendance = ({ employee }) => { - -
- refetch()} - /> -
+
- {!loading && data.length === 0 && No employee logs} + {!loading && data.length === 0 && ( + + No attendance record found in selected date range + + )} {isError &&
{error.message}
} {loading && !data &&
Loading...
} {data && data.length > 0 && ( @@ -250,9 +244,8 @@ const EmpAttendance = ({ employee }) => { {[...Array(totalPages)].map((_, index) => (
  • ))}