Correction in Date format in Attendance logs, and adding spinnerloade at attendance tab.
This commit is contained in:
parent
166c0794ed
commit
8522f0ca82
@ -11,6 +11,7 @@ import { useSelector } from "react-redux";
|
|||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import eventBus from "../../services/eventBus";
|
import eventBus from "../../services/eventBus";
|
||||||
import { useSelectedProject } from "../../slices/apiDataManager";
|
import { useSelectedProject } from "../../slices/apiDataManager";
|
||||||
|
import { SpinnerLoader } from "../common/Loader";
|
||||||
|
|
||||||
const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizationId, }) => {
|
const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizationId, }) => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@ -133,12 +134,18 @@ const Attendance = ({ getRole, handleModalData, searchTerm, projectId, organizat
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="table-responsive text-nowrap h-100"
|
className="table-responsive modal-min-h text-nowrap h-100"
|
||||||
style={{ minHeight: "200px" }} // Ensures fixed height
|
style={{ minHeight: "200px" }} // Ensures fixed height
|
||||||
>
|
>
|
||||||
{attLoading ? (
|
{attLoading ? (
|
||||||
<div>Loading...</div>
|
<div
|
||||||
|
className="d-flex justify-content-center align-items-center"
|
||||||
|
style={{ minHeight: "50vh" }}
|
||||||
|
>
|
||||||
|
<SpinnerLoader />
|
||||||
|
</div>
|
||||||
) : currentItems?.length > 0 ? (
|
) : currentItems?.length > 0 ? (
|
||||||
|
|
||||||
<>
|
<>
|
||||||
<table className="table ">
|
<table className="table ">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState, useMemo, useCallback } from "react";
|
import React, { useEffect, useState, useMemo, useCallback } from "react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import Avatar from "../common/Avatar";
|
import Avatar from "../common/Avatar";
|
||||||
import { convertShortTime } from "../../utils/dateUtils";
|
import { convertShortTime, formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||||
import RenderAttendanceStatus from "./RenderAttendanceStatus";
|
import RenderAttendanceStatus from "./RenderAttendanceStatus";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import DateRangePicker from "../common/DateRangePicker";
|
import DateRangePicker from "../common/DateRangePicker";
|
||||||
@ -16,6 +16,7 @@ import { useAttendancesLogs } from "../../hooks/useAttendance";
|
|||||||
import { queryClient } from "../../layouts/AuthLayout";
|
import { queryClient } from "../../layouts/AuthLayout";
|
||||||
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { SpinnerLoader } from "../common/Loader";
|
||||||
|
|
||||||
const usePagination = (data, itemsPerPage) => {
|
const usePagination = (data, itemsPerPage) => {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
@ -207,17 +208,18 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => {
|
|||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="table-responsive text-nowrap"
|
className="table-responsive modal-min-h text-nowrap"
|
||||||
style={{ minHeight: "200px" }}
|
style={{ minHeight: "200px" }}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div
|
<div
|
||||||
className="d-flex justify-content-center align-items-center"
|
className="d-flex justify-content-center align-items-center"
|
||||||
style={{ height: "200px" }}
|
style={{ minHeight: "50vh" }}
|
||||||
>
|
>
|
||||||
<p className="text-secondary">Loading...</p>
|
<SpinnerLoader />
|
||||||
</div>
|
</div>
|
||||||
) : filteredSearchData?.length > 0 ? (
|
) : filteredSearchData?.length > 0 ? (
|
||||||
|
|
||||||
<table className="table mb-0">
|
<table className="table mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -257,7 +259,7 @@ const AttendanceLog = ({ handleModalData, searchTerm, organizationId }) => {
|
|||||||
>
|
>
|
||||||
<td colSpan={8} className="text-start">
|
<td colSpan={8} className="text-start">
|
||||||
<strong className="d-inline-block my-1 ms-2">
|
<strong className="d-inline-block my-1 ms-2">
|
||||||
{moment(currentDate).format("DD-MM-YYYY")}
|
{formatUTCToLocalTime(currentDate)}
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import {
|
|||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import Pagination from "../../components/common/Pagination";
|
import Pagination from "../../components/common/Pagination";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { SpinnerLoader } from "../common/Loader";
|
||||||
|
|
||||||
const Regularization = ({
|
const Regularization = ({
|
||||||
handleRequest,
|
handleRequest,
|
||||||
@ -106,15 +107,15 @@ const Regularization = ({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
className="table-responsive pt-3 text-nowrap pb-4"
|
className="table-responsive modal-min-h pt-3 text-nowrap pb-4"
|
||||||
style={{ minHeight: "200px" }}
|
style={{ minHeight: "200px" }}
|
||||||
>
|
>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div
|
<div
|
||||||
className="d-flex justify-content-center align-items-center"
|
className="d-flex justify-content-center align-items-center"
|
||||||
style={{ height: "200px" }}
|
style={{ minHeight: "50vh" }}
|
||||||
>
|
>
|
||||||
<p className="text-secondary">Loading...</p>
|
<SpinnerLoader />
|
||||||
</div>
|
</div>
|
||||||
) : currentItems?.length > 0 ? (
|
) : currentItems?.length > 0 ? (
|
||||||
<table className="table mb-0">
|
<table className="table mb-0">
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import ReactApexChart from "react-apexcharts";
|
|||||||
import { useAttendanceOverviewData } from "../../hooks/useDashboard_Data";
|
import { useAttendanceOverviewData } from "../../hooks/useDashboard_Data";
|
||||||
import flatColors from "../Charts/flatColor";
|
import flatColors from "../Charts/flatColor";
|
||||||
import ChartSkeleton from "../Charts/Skelton";
|
import ChartSkeleton from "../Charts/Skelton";
|
||||||
|
import { SpinnerLoader } from "../common/Loader";
|
||||||
|
|
||||||
const formatDate = (dateStr) => {
|
const formatDate = (dateStr) => {
|
||||||
const date = new Date(dateStr);
|
const date = new Date(dateStr);
|
||||||
@ -138,9 +139,9 @@ const AttendanceOverview = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
<div className="flex-grow-1 d-flex align-items-center justify-content-center">
|
<div className="flex-grow-1 d-flex align-items-center modal-min-h justify-content-center">
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<ChartSkeleton />
|
<SpinnerLoader />
|
||||||
) : error ? (
|
) : error ? (
|
||||||
<p className="text-danger">{error}</p>
|
<p className="text-danger">{error}</p>
|
||||||
) : view === "chart" ? (
|
) : view === "chart" ? (
|
||||||
|
|||||||
@ -44,9 +44,9 @@ const TasksCard = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="d-flex justify-content-around align-items-start flex-wrap mt-n2">
|
<div className="d-flex justify-content-around align-items-start mt-n2">
|
||||||
{/* Total Tasks */}
|
{/* Total Tasks */}
|
||||||
<div className="text-center flex-fill p-2">
|
<div>
|
||||||
<h4 className="mb-0 fw-bold text-truncate">
|
<h4 className="mb-0 fw-bold text-truncate">
|
||||||
{formatFigure(tasksCardData?.totalTasks ?? 0, {
|
{formatFigure(tasksCardData?.totalTasks ?? 0, {
|
||||||
notation: "compact",
|
notation: "compact",
|
||||||
@ -56,7 +56,7 @@ const TasksCard = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Completed Tasks */}
|
{/* Completed Tasks */}
|
||||||
<div className="text-center flex-fill p-2">
|
<div>
|
||||||
<h4 className="mb-0 fw-bold text-truncate">
|
<h4 className="mb-0 fw-bold text-truncate">
|
||||||
{formatFigure(tasksCardData?.completedTasks ?? 0, {
|
{formatFigure(tasksCardData?.completedTasks ?? 0, {
|
||||||
notation: "compact",
|
notation: "compact",
|
||||||
|
|||||||
@ -44,7 +44,7 @@ export default function DirectoryPage({ IsPage = true, projectId = null }) {
|
|||||||
const [searchNote, setSearchNote] = useState("");
|
const [searchNote, setSearchNote] = useState("");
|
||||||
const [activeTab, setActiveTab] = useState("notes");
|
const [activeTab, setActiveTab] = useState("notes");
|
||||||
const { setActions } = useFab();
|
const { setActions } = useFab();
|
||||||
const [gridView, setGridView] = useState(false);
|
const [gridView, setGridView] = useState(true);
|
||||||
const [isOpenBucket, setOpenBucket] = useState(false);
|
const [isOpenBucket, setOpenBucket] = useState(false);
|
||||||
const [isManageContact, setManageContact] = useState({
|
const [isManageContact, setManageContact] = useState({
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user