diff --git a/src/components/Activities/Attendance.jsx b/src/components/Activities/Attendance.jsx index c46feac3..b7ddfaff 100644 --- a/src/components/Activities/Attendance.jsx +++ b/src/components/Activities/Attendance.jsx @@ -223,50 +223,6 @@ const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizat )} - - - {!loading && finalFilteredData.length > ITEMS_PER_PAGE && ( - - )} ) : (
)}
+ {!loading && finalFilteredData.length > ITEMS_PER_PAGE && ( + + )} ); }; diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx index 7a346f67..949ad7bd 100644 --- a/src/components/Activities/AttendcesLogs.jsx +++ b/src/components/Activities/AttendcesLogs.jsx @@ -15,6 +15,7 @@ import AttendanceRepository from "../../repositories/AttendanceRepository"; import { useAttendancesLogs } from "../../hooks/useAttendance"; import { queryClient } from "../../layouts/AuthLayout"; import { ITEMS_PER_PAGE } from "../../utils/constants"; +import { useNavigate } from "react-router-dom"; const usePagination = (data, itemsPerPage) => { const [currentPage, setCurrentPage] = useState(1); @@ -44,6 +45,7 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => { const [loading, setLoading] = useState(false); const [showPending, setShowPending] = useState(false); const [isRefreshing, setIsRefreshing] = useState(false); + const navigate = useNavigate(); const today = new Date(); today.setHours(0, 0, 0, 0); @@ -172,15 +174,15 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => { return ( <>
-
+
-
+
{ checked={showPending} onChange={(e) => setShowPending(e.target.checked)} /> - +
+
{ lastName={attendance.lastName} />
- + + navigate(`/employee/${attendance.employeeId}?for=attendance`) + } + className="text-heading text-truncate cursor-pointer" + > {attendance.firstName} {attendance.lastName} diff --git a/src/components/Activities/Regularization.jsx b/src/components/Activities/Regularization.jsx index 0aab7474..954820c2 100644 --- a/src/components/Activities/Regularization.jsx +++ b/src/components/Activities/Regularization.jsx @@ -14,6 +14,7 @@ import { } from "../../slices/apiDataManager"; import { useQueryClient } from "@tanstack/react-query"; import Pagination from "../../components/common/Pagination"; +import { useNavigate } from "react-router-dom"; const Regularization = ({ handleRequest, @@ -26,6 +27,7 @@ const Regularization = ({ // var selectedProject = useSelector((store) => store.localVariables.projectId); const selectedProject = useSelectedProject(); const [regularizesList, setregularizedList] = useState([]); + const navigate = useNavigate(); const { regularizes, loading, error, refetch } = useRegularizationRequests( selectedProject, organizationId, @@ -33,9 +35,9 @@ const Regularization = ({ ); useEffect(() => { - if(!regularizes) return - if(regularizes?.length) { - setregularizedList(regularizes); + if (!regularizes) return + if (regularizes?.length) { + setregularizedList(regularizes); } }, [regularizes]); @@ -102,141 +104,106 @@ const Regularization = ({ }, [employeeHandler]); return ( -
- {loading ? ( -
-

Loading...

-
- ) : currentItems?.length > 0 ? ( - - - - - - - - - - - - - - - {currentItems?.map((att, index) => ( - - + + + + + ))} + +
NameDateOrganization - Check-In - - Check-Out - - Requested By - - Requested At - Action
-
- -
- +
+
+ {loading ? ( +
+

Loading...

+
+ ) : currentItems?.length > 0 ? ( + + + + + + + + + + + + + + + {currentItems?.map((att, index) => ( + + - + + - + - - - - + - - - ))} - -
NameDateOrganization + Check-In + + Check-Out + + Requested By + + Requested At + Action
+ - - {moment(att.checkOutTime).format("DD-MMM-YYYY")}{moment(att.checkOutTime).format("DD-MMM-YYYY")}{att.organizationName || "--"}{att.organizationName || "--"}{convertShortTime(att.checkInTime)} - {att.requestedAt ? convertShortTime(att.checkOutTime) : "--"} - - {att.requestedBy ? ( ):(--)} - {convertShortTime(att.checkInTime)} - {att?.requestedAt ? formatUTCToLocalTime(att.requestedAt,true) : "--"} - - -
- ) : ( -
- - {searchTerm - ? "No results found for your search." - : "No Requests Found !"} - -
- )} - {/* {!loading && totalPages > 1 && ( - - )} */} + {att.requestedAt ? convertShortTime(att.checkOutTime) : "--"} +
+ {att.requestedBy ? () : (--)} + + {att?.requestedAt ? formatUTCToLocalTime(att.requestedAt, true) : "--"} + + +
+ ) : ( +
+ + {searchTerm + ? "No results found for your search." + : "No Requests Found !"} + +
+ )} +
{totalPages > 0 && ( )} +
); }; diff --git a/src/components/DailyProgressRport/TaskReportList.jsx b/src/components/DailyProgressRport/TaskReportList.jsx index 78af8df3..c47f46c4 100644 --- a/src/components/DailyProgressRport/TaskReportList.jsx +++ b/src/components/DailyProgressRport/TaskReportList.jsx @@ -29,7 +29,7 @@ const TaskReportList = () => { const ApprovedTaskRights = useHasUserPermission(APPROVE_TASK); const ReportTaskRights = useHasUserPermission(ASSIGN_REPORT_TASK); - const { service, openModal, closeModal,filter } = useDailyProgrssContext(); + const { service, openModal, closeModal, filter } = useDailyProgrssContext(); const selectedProject = useSelectedProject(); const { projectNames } = useProjectName(); @@ -37,7 +37,7 @@ const TaskReportList = () => { selectedProject, ITEMS_PER_PAGE, currentPage, - service,filter + service, filter ); const ProgrssReportColumn = [ @@ -192,109 +192,114 @@ const TaskReportList = () => { if (isLoading) return ; if (isError) return
Loading....
; return ( -
- - - - - - - - - - - - - {groupedTasks.length === 0 && ( +
+
+
Activity - - Total Pending{" "} - This shows the total pending tasks for each activity on that date.

} - > - -
-
-
- - Reported/Planned{" "} - This shows the reported versus planned tasks for each activity on that date.

} - > - -
-
-
Assign DateTeamActions
+ - + + + + + + - )} - - {groupedTasks.map(({ date, tasks }) => ( - - - + + {groupedTasks.length === 0 && ( + + - {tasks.map((task, idx) => ( - - - - - - - + - ))} - - ))} - -
- No reports available - Activity + + Total Pending{" "} + This shows the total pending tasks for each activity on that date.

} + > + +
+
+
+ + Reported/Planned{" "} + This shows the reported versus planned tasks for each activity on that date.

} + > + +
+
+
Assign DateTeamActions
- {formatUTCToLocalTime(date)} +
+ No reports available
-
- {task.workItem.activityMaster?.activityName || "No Activity Name"} -
-
- {task.workItem.workArea?.floor?.building?.name} ›{" "} - {task.workItem.workArea?.floor?.floorName} ›{" "} - {task.workItem.workArea?.areaName} -
-
- {formatNumber(task.workItem.plannedWork)} - {`${formatNumber(task.completedTask)} / ${formatNumber(task.plannedTask)}`}{formatUTCToLocalTime(task.assignmentDate)}{renderTeamMembers(task, idx)} -
- {ReportTaskRights && !task.reportedDate && ( - - )} - {ApprovedTaskRights && task.reportedDate && !task.approvedBy && ( - - )} - -
+ )} + + {groupedTasks.map(({ date, tasks }) => ( + +
+ {formatUTCToLocalTime(date)}
- {data?.data?.length > 0 && ( - - )} -
+ {tasks.map((task, idx) => ( + + +
+ {task.workItem.activityMaster?.activityName || "No Activity Name"} +
+
+ {task.workItem.workArea?.floor?.building?.name} ›{" "} + {task.workItem.workArea?.floor?.floorName} ›{" "} + {task.workItem.workArea?.areaName} +
+ + + {formatNumber(task.workItem.plannedWork)} + + {`${formatNumber(task.completedTask)} / ${formatNumber(task.plannedTask)}`} + {formatUTCToLocalTime(task.assignmentDate)} + {renderTeamMembers(task, idx)} + +
+ {ReportTaskRights && !task.reportedDate && ( + + )} + {ApprovedTaskRights && task.reportedDate && !task.approvedBy && ( + + )} + +
+ + + ))} + + ))} + + + +
+ { + data?.data?.length > 0 && ( + + ) + } +
); }; diff --git a/src/components/Directory/ListViewContact.jsx b/src/components/Directory/ListViewContact.jsx index 16fd9a14..f4f15531 100644 --- a/src/components/Directory/ListViewContact.jsx +++ b/src/components/Directory/ListViewContact.jsx @@ -160,8 +160,7 @@ const ListViewContact = ({ data, Pagination }) => {
) : ( { )} - {Pagination && ( -
- {Pagination} -
- )} + {Pagination && ( +
+ {Pagination} +
+ )} ); diff --git a/src/components/Expenses/ExpenseList.jsx b/src/components/Expenses/ExpenseList.jsx index c18d2650..29844402 100644 --- a/src/components/Expenses/ExpenseList.jsx +++ b/src/components/Expenses/ExpenseList.jsx @@ -15,6 +15,7 @@ import { ExpenseTableSkeleton } from "./ExpenseSkeleton"; import ConfirmModal from "../common/ConfirmModal"; import { useHasUserPermission } from "../../hooks/useHasUserPermission"; import { useSelector } from "react-redux"; +import { useNavigate } from "react-router-dom"; const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { const [deletingId, setDeletingId] = useState(null); @@ -24,6 +25,7 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { const IsExpesneApprpve = useHasUserPermission(APPROVE_EXPENSE); const [currentPage, setCurrentPage] = useState(1); const debouncedSearch = useDebounce(searchText, 500); + const navigate = useNavigate(); const { mutate: DeleteExpense, isPending } = useDeleteExpense(); const { data, isLoading, isError, isInitialLoading, error } = useExpenseList( @@ -67,9 +69,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { key = item.status?.displayName || "Unknown"; break; case "submittedBy": - key = `${item.createdBy?.firstName ?? ""} ${ - item.createdBy?.lastName ?? "" - }`.trim(); + key = `${item.createdBy?.firstName ?? ""} ${item.createdBy?.lastName ?? "" + }`.trim(); break; case "project": key = item.project?.name || "Unknown Project"; @@ -110,11 +111,11 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { label: "Submitted By", align: "text-start", getValue: (e) => - `${e.createdBy?.firstName ?? ""} ${ - e.createdBy?.lastName ?? "" - }`.trim() || "N/A", + `${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? "" + }`.trim() || "N/A", customRender: (e) => ( -
+
navigate(`/employee/${e.createdBy?.id}`)}> { lastName={e.createdBy?.lastName} /> - {`${e.createdBy?.firstName ?? ""} ${ - e.createdBy?.lastName ?? "" - }`.trim() || "N/A"} + {`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? "" + }`.trim() || "N/A"}
), @@ -152,9 +152,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { align: "text-center", getValue: (e) => ( {e.status?.name || "Unknown"} @@ -299,15 +298,15 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => { )} - {data?.data?.length > 0 && ( - - )}
+ {data?.data?.length > 0 && ( + + )} ); diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index 6ea212b7..b2a0c39b 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -179,44 +179,40 @@ const AttendancePage = () => { {/* Search + Organization filter */} -
- {/* Organization Dropdown */} -
-
- +
+
+
+
- {/* Search Input */} - setSearchTerm(e.target.value)} - /> + setSearchTerm(e.target.value)} + />
- - -
+
@@ -224,7 +220,7 @@ const AttendancePage = () => { {selectedProject ? ( <> {activeTab === "all" && ( -
+
{
)} {activeTab === "logs" && ( -
+
{
)} {activeTab === "regularization" && DoRegularized && ( -
+
{ ))} - - - {displayData?.length > 0 && ( + +
+
+ {displayData?.length > 0 && ( )} -
-
) : (