Compare commits
No commits in common. "254aaf197773041c271e54e9e5b4643d0dd897fa" and "eec208db89472ba31c74e54abe93e9c9837147be" have entirely different histories.
254aaf1977
...
eec208db89
@ -6,11 +6,7 @@ import RenderAttendanceStatus from "./RenderAttendanceStatus";
|
|||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { fetchAttendanceData, setAttendanceData } from "../../slices/apiSlice/attedanceLogsSlice"; // Make sure setAttendanceData is correctly imported
|
import { fetchAttendanceData, setAttendanceData } from "../../slices/apiSlice/attedanceLogsSlice"; // Make sure setAttendanceData is correctly imported
|
||||||
import DateRangePicker from "../common/DateRangePicker";
|
import DateRangePicker from "../common/DateRangePicker";
|
||||||
import { clearCacheKey, getCachedData } from "../../slices/apiDataManager";
|
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import AttendanceRepository from "../../repositories/AttendanceRepository";
|
|
||||||
import { useAttendancesLogs } from "../../hooks/useAttendance";
|
|
||||||
import { queryClient } from "../../layouts/AuthLayout";
|
|
||||||
|
|
||||||
// Custom hook for pagination
|
// Custom hook for pagination
|
||||||
const usePagination = (data, itemsPerPage) => {
|
const usePagination = (data, itemsPerPage) => {
|
||||||
@ -20,6 +16,9 @@ const usePagination = (data, itemsPerPage) => {
|
|||||||
const maxPage = Math.ceil(totalItems / itemsPerPage);
|
const maxPage = Math.ceil(totalItems / itemsPerPage);
|
||||||
|
|
||||||
const currentItems = useMemo(() => {
|
const currentItems = useMemo(() => {
|
||||||
|
if (!Array.isArray(data) || data.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const startIndex = (currentPage - 1) * itemsPerPage;
|
const startIndex = (currentPage - 1) * itemsPerPage;
|
||||||
const endIndex = startIndex + itemsPerPage;
|
const endIndex = startIndex + itemsPerPage;
|
||||||
return data.slice(startIndex, endIndex);
|
return data.slice(startIndex, endIndex);
|
||||||
@ -61,8 +60,6 @@ const AttendanceLog = ({
|
|||||||
endDate: defaultEndDate
|
endDate: defaultEndDate
|
||||||
});
|
});
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [showPending,setShowPending] = useState(false)
|
|
||||||
|
|
||||||
const { data: attendanceLogsData, loading: logsLoading, isFetching: logsFetching } = useSelector(
|
const { data: attendanceLogsData, loading: logsLoading, isFetching: logsFetching } = useSelector(
|
||||||
(state) => state.attendanceLogs
|
(state) => state.attendanceLogs
|
||||||
@ -70,6 +67,7 @@ const AttendanceLog = ({
|
|||||||
|
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false); // Local state for refresh spinner
|
const [isRefreshing, setIsRefreshing] = useState(false); // Local state for refresh spinner
|
||||||
|
|
||||||
|
// Memoize today and yesterday dates to prevent re-creation on every render
|
||||||
const today = useMemo(() => {
|
const today = useMemo(() => {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setHours(0, 0, 0, 0);
|
d.setHours(0, 0, 0, 0);
|
||||||
@ -82,22 +80,20 @@ const AttendanceLog = ({
|
|||||||
d.setHours(0, 0, 0, 0); // Set to start of day for accurate comparison
|
d.setHours(0, 0, 0, 0); // Set to start of day for accurate comparison
|
||||||
return d;
|
return d;
|
||||||
}, []);
|
}, []);
|
||||||
const yesterday = new Date();
|
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
|
||||||
|
|
||||||
const isSameDay = (dateStr) => {
|
const isSameDay = useCallback((dateStr) => {
|
||||||
if (!dateStr) return false;
|
if (!dateStr) return false;
|
||||||
const d = new Date(dateStr);
|
const d = new Date(dateStr);
|
||||||
d.setHours(0, 0, 0, 0);
|
d.setHours(0, 0, 0, 0);
|
||||||
return d.getTime() === today.getTime();
|
return d.getTime() === today.getTime();
|
||||||
};
|
}, [today]);
|
||||||
|
|
||||||
const isBeforeToday = (dateStr) => {
|
const isBeforeToday = useCallback((dateStr) => {
|
||||||
if (!dateStr) return false;
|
if (!dateStr) return false;
|
||||||
const d = new Date(dateStr);
|
const d = new Date(dateStr);
|
||||||
d.setHours(0, 0, 0, 0);
|
d.setHours(0, 0, 0, 0);
|
||||||
return d.getTime() < today.getTime();
|
return d.getTime() < today.getTime();
|
||||||
};
|
}, [today]);
|
||||||
|
|
||||||
const sortByName = useCallback((a, b) => {
|
const sortByName = useCallback((a, b) => {
|
||||||
const nameA = `${a.firstName || ""} ${a.lastName || ""}`.toLowerCase();
|
const nameA = `${a.firstName || ""} ${a.lastName || ""}`.toLowerCase();
|
||||||
@ -105,7 +101,7 @@ const AttendanceLog = ({
|
|||||||
return nameA.localeCompare(nameB);
|
return nameA.localeCompare(nameB);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Effect to fetch attendance data when dateRange or projectId changes
|
// Effect to fetch attendance data when dateRange or projectId changes, or when refreshed
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { startDate, endDate } = dateRange;
|
const { startDate, endDate } = dateRange;
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -115,21 +111,26 @@ const AttendanceLog = ({
|
|||||||
toDate: endDate,
|
toDate: endDate,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
setIsRefreshing(false); // Reset refreshing state after fetch attempt
|
// Reset refreshing state only after the dispatch, assuming fetchAttendanceData
|
||||||
}, [dateRange, projectId, dispatch, isRefreshing]); // isRefreshing is a dependency because it triggers a re-fetch
|
// will eventually update logsLoading/logsFetching
|
||||||
|
const timer = setTimeout(() => { // Give Redux time to update
|
||||||
|
setIsRefreshing(false);
|
||||||
|
}, 500); // Small delay to show spinner for a bit longer
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [dateRange, projectId, dispatch, isRefreshing]);
|
||||||
|
|
||||||
const processedData = useMemo(() => {
|
const processedData = useMemo(() => {
|
||||||
let filteredData = showOnlyCheckout // Use the prop directly
|
let filteredData = showOnlyCheckout
|
||||||
? attendanceLogsData.filter((item) => item.checkOutTime === null) // Use attendanceLogsData
|
? (attendanceLogsData || []).filter((item) => item.checkOutTime === null) // Ensure attendanceLogsData is an array
|
||||||
: attendanceLogsData; // Use attendanceLogsData
|
: (attendanceLogsData || []); // Ensure attendanceLogsData is an array
|
||||||
|
|
||||||
// Apply search query filter
|
// Apply search query filter
|
||||||
if (searchQuery) {
|
if (searchQuery) {
|
||||||
const lowerCaseSearchQuery = searchQuery.toLowerCase();
|
const lowerCaseSearchQuery = searchQuery.toLowerCase();
|
||||||
filteredData = filteredData.filter((att) => {
|
filteredData = filteredData.filter((att) => {
|
||||||
// Construct a full name from available parts, filtering out null/undefined
|
|
||||||
const fullName = [att.firstName, att.middleName, att.lastName]
|
const fullName = [att.firstName, att.middleName, att.lastName]
|
||||||
.filter(Boolean) // This removes null, undefined, or empty string parts
|
.filter(Boolean)
|
||||||
.join(" ")
|
.join(" ")
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
||||||
@ -242,19 +243,15 @@ const AttendanceLog = ({
|
|||||||
const employeeHandler = useCallback(
|
const employeeHandler = useCallback(
|
||||||
(msg) => {
|
(msg) => {
|
||||||
const { startDate, endDate } = dateRange;
|
const { startDate, endDate } = dateRange;
|
||||||
if (data.some((item) => item.employeeId == msg.employeeId)) {
|
dispatch(
|
||||||
// dispatch(
|
fetchAttendanceData({
|
||||||
// fetchAttendanceData({
|
projectId,
|
||||||
// ,
|
fromDate: startDate,
|
||||||
// fromDate: startDate,
|
toDate: endDate,
|
||||||
// toDate: endDate,
|
})
|
||||||
// })
|
);
|
||||||
// );
|
|
||||||
|
|
||||||
refetch()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[selectedProject, dateRange, data]
|
[projectId, dateRange, dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -420,9 +417,8 @@ const AttendanceLog = ({
|
|||||||
(pageNumber) => (
|
(pageNumber) => (
|
||||||
<li
|
<li
|
||||||
key={pageNumber}
|
key={pageNumber}
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === pageNumber ? "active" : ""
|
||||||
currentPage === pageNumber ? "active" : ""
|
}`}
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className="page-link"
|
className="page-link"
|
||||||
@ -434,9 +430,8 @@ const AttendanceLog = ({
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
<li
|
<li
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === totalPages ? "disabled" : ""
|
||||||
currentPage === totalPages ? "disabled" : ""
|
}`}
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className="page-link"
|
className="page-link"
|
||||||
@ -452,4 +447,4 @@ const AttendanceLog = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AttendanceLog;
|
export default AttendanceLog;
|
||||||
@ -7,19 +7,16 @@ import { useRegularizationRequests } from "../../hooks/useAttendance";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import usePagination from "../../hooks/usePagination";
|
import usePagination from "../../hooks/usePagination";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import { cacheData, clearCacheKey } from "../../slices/apiDataManager";
|
import { cacheData } from "../../slices/apiDataManager";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
|
||||||
|
|
||||||
const Regularization = ({ handleRequest }) => {
|
const Regularization = ({ handleRequest, searchQuery }) => {
|
||||||
const queryClient = useQueryClient();
|
const selectedProject = useSelector((store) => store.localVariables.projectId);
|
||||||
var selectedProject = useSelector((store) => store.localVariables.projectId);
|
const [regularizesList, setRegularizedList] = useState([]);
|
||||||
const [regularizesList, setregularizedList] = useState([]);
|
const { regularizes, loading, refetch } = useRegularizationRequests(selectedProject);
|
||||||
const { regularizes, loading, error, refetch } =
|
|
||||||
useRegularizationRequests(selectedProject);
|
|
||||||
|
|
||||||
// Update regularizesList when regularizes data changes
|
// Update regularizesList when regularizes data changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setregularizedList(regularizes);
|
setRegularizedList(regularizes);
|
||||||
}, [regularizes]);
|
}, [regularizes]);
|
||||||
|
|
||||||
const sortByName = useCallback((a, b) => {
|
const sortByName = useCallback((a, b) => {
|
||||||
@ -86,34 +83,27 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="table-responsive text-nowrap pb-4">
|
<div className="table-responsive text-nowrap pb-4">
|
||||||
{loading ? (
|
<table className="table mb-0">
|
||||||
<div className="my-2">
|
<thead>
|
||||||
<p className="text-secondary">Loading...</p>
|
<tr>
|
||||||
</div>
|
<th colSpan={2}>Name</th>
|
||||||
) : currentItems?.length > 0 ? (
|
<th>Date</th>
|
||||||
<table className="table mb-0">
|
<th>
|
||||||
<thead>
|
<i className="bx bxs-down-arrow-alt text-success"></i>Check-In
|
||||||
<tr>
|
</th>
|
||||||
<th colSpan={2}>Name</th>
|
<th>
|
||||||
<th>Date</th>
|
<i className="bx bxs-up-arrow-alt text-danger"></i>Check-Out
|
||||||
<th>
|
</th>
|
||||||
<i className="bx bxs-down-arrow-alt text-success"></i>Check-In
|
<th>Action</th>
|
||||||
</th>
|
</tr>
|
||||||
<th>
|
</thead>
|
||||||
<i className="bx bxs-up-arrow-alt text-danger"></i>Check-Out
|
<tbody>
|
||||||
</th>
|
{!loading && currentItems?.length > 0 ? (
|
||||||
<th>Action</th>
|
currentItems.map((att, index) => (
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{currentItems?.map((att, index) => (
|
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td colSpan={2}>
|
<td colSpan={2}>
|
||||||
<div className="d-flex justify-content-start align-items-center">
|
<div className="d-flex justify-content-start align-items-center">
|
||||||
<Avatar
|
<Avatar firstName={att.firstName} lastName={att.lastName} />
|
||||||
firstName={att.firstName}
|
|
||||||
lastName={att.lastName}
|
|
||||||
></Avatar>
|
|
||||||
<div className="d-flex flex-column">
|
<div className="d-flex flex-column">
|
||||||
<a href="#" className="text-heading text-truncate">
|
<a href="#" className="text-heading text-truncate">
|
||||||
<span className="fw-normal">
|
<span className="fw-normal">
|
||||||
@ -128,24 +118,33 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
<td>
|
<td>
|
||||||
{att.checkOutTime ? convertShortTime(att.checkOutTime) : "--"}
|
{att.checkOutTime ? convertShortTime(att.checkOutTime) : "--"}
|
||||||
</td>
|
</td>
|
||||||
<td className="text-center ">
|
<td className="text-center">
|
||||||
<RegularizationActions
|
<RegularizationActions
|
||||||
attendanceData={att}
|
attendanceData={att}
|
||||||
handleRequest={handleRequest}
|
handleRequest={handleRequest}
|
||||||
refresh={refetch}
|
refresh={refetch}
|
||||||
/>
|
/>
|
||||||
{/* </div> */}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))
|
||||||
</tbody>
|
) : (
|
||||||
</table>
|
<tr>
|
||||||
) : (
|
<td
|
||||||
<div className="my-4">
|
colSpan={6}
|
||||||
{" "}
|
className="text-center"
|
||||||
<span className="text-secondary">No Requests Found !</span>
|
style={{
|
||||||
</div>
|
height: "200px",
|
||||||
)}
|
verticalAlign: "middle",
|
||||||
|
borderBottom: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{loading ? "Loading..." : "No Record Found"}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
{!loading && totalPages > 1 && (
|
{!loading && totalPages > 1 && (
|
||||||
<nav aria-label="Page ">
|
<nav aria-label="Page ">
|
||||||
<ul className="pagination pagination-sm justify-content-end py-1 mt-3">
|
<ul className="pagination pagination-sm justify-content-end py-1 mt-3">
|
||||||
@ -160,25 +159,18 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
{[...Array(totalPages)].map((_, index) => (
|
{[...Array(totalPages)].map((_, index) => (
|
||||||
<li
|
<li
|
||||||
key={index}
|
key={index}
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === index + 1 ? "active" : ""}`}
|
||||||
currentPage === index + 1 ? "active" : ""
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<button
|
<button className="page-link" onClick={() => paginate(index + 1)}>
|
||||||
className="page-link "
|
|
||||||
onClick={() => paginate(index + 1)}
|
|
||||||
>
|
|
||||||
{index + 1}
|
{index + 1}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
<li
|
<li
|
||||||
className={`page-item ${
|
className={`page-item ${currentPage === totalPages ? "disabled" : ""}`}
|
||||||
currentPage === totalPages ? "disabled" : ""
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className="page-link "
|
className="page-link"
|
||||||
onClick={() => paginate(currentPage + 1)}
|
onClick={() => paginate(currentPage + 1)}
|
||||||
>
|
>
|
||||||
»
|
»
|
||||||
@ -191,4 +183,4 @@ const Regularization = ({ handleRequest }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Regularization;
|
export default Regularization;
|
||||||
@ -129,6 +129,8 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
dispatch(changeMaster("Job Role"));
|
dispatch(changeMaster("Job Role"));
|
||||||
// Initial state should reflect "All Roles" selected
|
// Initial state should reflect "All Roles" selected
|
||||||
setSelectedRoles(["all"]);
|
setSelectedRoles(["all"]);
|
||||||
|
// Initial state should reflect "All Roles" selected
|
||||||
|
setSelectedRoles(["all"]);
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
// Modified handleRoleChange to handle multiple selections
|
// Modified handleRoleChange to handle multiple selections
|
||||||
@ -649,5 +651,4 @@ const AssignTask = ({ assignData, onClose, setAssigned }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div> );
|
</div> );
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AssignTask;
|
export default AssignTask;
|
||||||
@ -6,25 +6,18 @@ import {
|
|||||||
import Breadcrumb from "../../components/common/Breadcrumb";
|
import Breadcrumb from "../../components/common/Breadcrumb";
|
||||||
import AttendanceLog from "../../components/Activities/AttendcesLogs";
|
import AttendanceLog from "../../components/Activities/AttendcesLogs";
|
||||||
import Attendance from "../../components/Activities/Attendance";
|
import Attendance from "../../components/Activities/Attendance";
|
||||||
// import AttendanceModel from "../../components/Activities/AttendanceModel";
|
import AttendanceModel from "../../components/Activities/AttendanceModel";
|
||||||
import showToast from "../../services/toastService";
|
import showToast from "../../services/toastService";
|
||||||
// import { useProjects } from "../../hooks/useProjects";
|
|
||||||
import Regularization from "../../components/Activities/Regularization";
|
import Regularization from "../../components/Activities/Regularization";
|
||||||
import { useAttendance } from "../../hooks/useAttendance";
|
import { useAttendance } from "../../hooks/useAttendance";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { setProjectId } from "../../slices/localVariablesSlice";
|
import { setProjectId } from "../../slices/localVariablesSlice";
|
||||||
// import { markCurrentAttendance } from "../../slices/apiSlice/attendanceAllSlice";
|
import { markCurrentAttendance } from "../../slices/apiSlice/attendanceAllSlice";
|
||||||
import { hasUserPermission } from "../../utils/authUtils";
|
|
||||||
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
|
||||||
import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
|
import { REGULARIZE_ATTENDANCE } from "../../utils/constants";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
// import AttendanceRepository from "../../repositories/AttendanceRepository";
|
import AttendanceRepository from "../../repositories/AttendanceRepository";
|
||||||
import { useProjectName } from "../../hooks/useProjects";
|
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 = () => {
|
const AttendancePage = () => {
|
||||||
const [activeTab, setActiveTab] = useState("all");
|
const [activeTab, setActiveTab] = useState("all");
|
||||||
@ -218,11 +211,11 @@ const AttendancePage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* {isCreateModalOpen && modelConfig && (
|
{isCreateModalOpen && modelConfig && (
|
||||||
<div
|
<div
|
||||||
className="modal fade show"
|
className="modal fade show"
|
||||||
style={{ display: "block" }}
|
style={{ display: "block" }}
|
||||||
id="check-Out-modalg"
|
id="check-Out-modal"
|
||||||
tabIndex="-1"
|
tabIndex="-1"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
>
|
>
|
||||||
@ -232,29 +225,6 @@ const AttendancePage = () => {
|
|||||||
handleSubmitForm={handleSubmit}
|
handleSubmitForm={handleSubmit}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)} */}
|
|
||||||
{isCreateModalOpen && modelConfig && (
|
|
||||||
<GlobalModel
|
|
||||||
isOpen={isCreateModalOpen}
|
|
||||||
size={modelConfig?.action === 6 && "lg"}
|
|
||||||
closeModal={closeModal}
|
|
||||||
>
|
|
||||||
{(modelConfig?.action === 0 ||
|
|
||||||
modelConfig?.action === 1 ||
|
|
||||||
modelConfig?.action === 2) && (
|
|
||||||
<CheckCheckOutmodel
|
|
||||||
modeldata={modelConfig}
|
|
||||||
closeModal={closeModal}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{/* For view logs */}
|
|
||||||
{modelConfig?.action === 6 && (
|
|
||||||
<AttendLogs Id={modelConfig?.id} closeModal={closeModal} />
|
|
||||||
)}
|
|
||||||
{modelConfig?.action === 7 && (
|
|
||||||
<Confirmation closeModal={closeModal} />
|
|
||||||
)}
|
|
||||||
</GlobalModel>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="container-fluid">
|
<div className="container-fluid">
|
||||||
@ -316,8 +286,11 @@ const AttendancePage = () => {
|
|||||||
</ul>
|
</ul>
|
||||||
<div className="tab-content attedanceTabs py-0 px-1 px-sm-3" >
|
<div className="tab-content attedanceTabs py-0 px-1 px-sm-3" >
|
||||||
{activeTab === "all" && (
|
{activeTab === "all" && (
|
||||||
|
<>
|
||||||
|
{!attLoading && (
|
||||||
<div className="tab-pane fade show active py-0">
|
<div className="tab-pane fade show active py-0">
|
||||||
<Attendance
|
<Attendance
|
||||||
|
attendance={filteredAndSearchedTodayAttendance()}
|
||||||
handleModalData={handleModalData}
|
handleModalData={handleModalData}
|
||||||
getRole={getRole}
|
getRole={getRole}
|
||||||
setshowOnlyCheckout={setShowPending}
|
setshowOnlyCheckout={setShowPending}
|
||||||
@ -328,13 +301,12 @@ const AttendancePage = () => {
|
|||||||
{!attLoading && filteredAndSearchedTodayAttendance()?.length === 0 && (
|
{!attLoading && filteredAndSearchedTodayAttendance()?.length === 0 && (
|
||||||
<p>
|
<p>
|
||||||
{" "}
|
{" "}
|
||||||
{showPending
|
|
||||||
{showPending
|
{showPending
|
||||||
? "No Pending Available"
|
? "No Pending Available"
|
||||||
: "No Employee assigned yet."}{" "}
|
: "No Employee assigned yet."}{" "}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</>
|
||||||
)}
|
)}
|
||||||
{activeTab === "logs" && (
|
{activeTab === "logs" && (
|
||||||
<div className="tab-pane fade show active py-0">
|
<div className="tab-pane fade show active py-0">
|
||||||
@ -355,6 +327,8 @@ const AttendancePage = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{!attLoading && !attendances && <span>Not Found</span>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -362,4 +336,4 @@ const AttendancePage = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AttendancePage;
|
export default AttendancePage;
|
||||||
Loading…
x
Reference in New Issue
Block a user