diff --git a/src/components/Activities/AttendLogs.jsx b/src/components/Activities/AttendLogs.jsx index b94c80c6..7c1e686d 100644 --- a/src/components/Activities/AttendLogs.jsx +++ b/src/components/Activities/AttendLogs.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; import { useEmployeeAttendacesLog } from "../../hooks/useAttendance"; -import { convertShortTime } from "../../utils/dateUtils"; +import { convertShortTime, formatUTCToLocalTime } from "../../utils/dateUtils"; import { useNavigate } from "react-router-dom"; import { THRESH_HOLD } from "../../utils/constants"; @@ -128,7 +128,7 @@ const AttendLogs = ({ Id }) => {

Attendance logs for{" "} {logs[0]?.employee?.firstName + " " + logs[0]?.employee?.lastName}{" "} - on {logs[0]?.activityTime.slice(0, 10)}{" "} + on {formatUTCToLocalTime(logs[0]?.activityTime)}

)} @@ -156,7 +156,7 @@ const AttendLogs = ({ Id }) => { .sort((a, b) => b.id - a.id) .map((log, index) => ( - {log.activityTime.slice(0, 10)} + {formatUTCToLocalTime(log.activityTime)} {convertShortTime(log.activityTime)} {whichActivityPerform(log.activity, log.activityTime)} diff --git a/src/components/Activities/Attendance.jsx b/src/components/Activities/Attendance.jsx index f7432f4d..eb7dc500 100644 --- a/src/components/Activities/Attendance.jsx +++ b/src/components/Activities/Attendance.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useCallback, useMemo } from "react"; import moment from "moment"; import Avatar from "../common/Avatar"; -import { convertShortTime } from "../../utils/dateUtils"; +import { convertShortTime, formatUTCToLocalTime } from "../../utils/dateUtils"; import RenderAttendanceStatus from "./RenderAttendanceStatus"; import usePagination from "../../hooks/usePagination"; import { useNavigate } from "react-router-dom"; @@ -116,7 +116,7 @@ const Attendance = ({ getRole, handleModalData, searchTerm }) => { <>
- Date : {todayDate.toLocaleDateString("en-GB")} + Date : {formatUTCToLocalTime(todayDate)}
{ const [currentPage, setCurrentPage] = useState(1); @@ -353,7 +354,7 @@ const AttendanceLog = ({ handleModalData, searchTerm }) => { No Pending Record Available !
)} - {filteredSearchData.length > 10 && ( + {filteredSearchData.length > ITEMS_PER_PAGE && (
diff --git a/src/components/Employee/EmpAttendance.jsx b/src/components/Employee/EmpAttendance.jsx index b8ff8b83..26ae9531 100644 --- a/src/components/Employee/EmpAttendance.jsx +++ b/src/components/Employee/EmpAttendance.jsx @@ -126,7 +126,7 @@ const EmpAttendance = ({ employee }) => { className="dataTables_length text-start py-2 d-flex justify-content-between " id="DataTables_Table_0_length" > -
+
{
  • - + {profile?.jobRole || NA}
  • - + {" "} {profile?.phoneNumber || NA}
  • - + {" "} Joined on{" "} @@ -85,18 +85,21 @@ const EmpBanner = ({ profile, loggedInUser }) => {
    -
  • - -
  • -
  • - {profile?.id == loggedInUser?.employeeInfo?.id && ( + {profile?.isActive && ( // ✅ show only if active +
  • +
  • + )} + +
  • + {profile?.id === loggedInUser?.employeeInfo?.id && ( +
diff --git a/src/components/Tenant/EditProfile.jsx b/src/components/Tenant/EditProfile.jsx index d6e23c88..8e355737 100644 --- a/src/components/Tenant/EditProfile.jsx +++ b/src/components/Tenant/EditProfile.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import Label from '../common/Label'; -import { useFormContext,useForm,FormProvider } from 'react-hook-form'; +import { useFormContext, useForm, FormProvider } from 'react-hook-form'; import { useIndustries, useTenantDetails, useUpdateTenantDetails } from '../../hooks/useTenant'; import { orgSize, reference } from '../../utils/constants'; import { LogoUpload } from './LogoUpload'; @@ -8,18 +8,18 @@ import showToast from '../../services/toastService'; import { zodResolver } from '@hookform/resolvers/zod'; import { EditTenant } from './TenantSchema'; -const EditProfile = ({ TenantId,onClose }) => { +const EditProfile = ({ TenantId, onClose }) => { const { data, isLoading, isError, error } = useTenantDetails(TenantId); const [logoPreview, setLogoPreview] = useState(null); const [logoName, setLogoName] = useState(""); const { data: Industries, isLoading: industryLoading, isError: industryError } = useIndustries(); - const {mutate:UpdateTenant,isPending,} = useUpdateTenantDetails(()=>{ - showToast("Tenant Details Updated Successfully","success") + const { mutate: UpdateTenant, isPending, } = useUpdateTenantDetails(() => { + showToast("Tenant Details Updated Successfully", "success") onClose() - + }) const methods = useForm({ - resolver:zodResolver(EditTenant), + resolver: zodResolver(EditTenant), defaultValues: { firstName: "", lastName: "", @@ -40,8 +40,8 @@ const EditProfile = ({ TenantId,onClose }) => { const { register, reset, handleSubmit, formState: { errors } } = methods; const onSubmit = (formData) => { - const tenantPayload = {...formData,contactName:`${formData.firstName} ${formData.lastName}`,id:data.id,} - UpdateTenant({id:data.id,tenantPayload}) + const tenantPayload = { ...formData, contactName: `${formData.firstName} ${formData.lastName}`, id: data.id, } + UpdateTenant({ id: data.id, tenantPayload }) }; useEffect(() => { @@ -70,117 +70,117 @@ const EditProfile = ({ TenantId,onClose }) => { return ( - -
-
Edit Tenant
+ + +
Edit Tenant
-
- - - {errors.firstName &&
{errors.firstName.message}
} -
+
+ + + {errors.firstName &&
{errors.firstName.message}
} +
-
- - - {errors.lastName &&
{errors.lastName.message}
} -
+
+ + + {errors.lastName &&
{errors.lastName.message}
} +
-
- - - {errors.contactNumber &&
{errors.contactNumber.message}
} -
+
+ + + {errors.contactNumber &&
{errors.contactNumber.message}
} +
-
- - - {errors.domainName &&
{errors.domainName.message}
} -
+
+ + + {errors.domainName &&
{errors.domainName.message}
} +
-
- - - {errors.taxId &&
{errors.taxId.message}
} -
+
+ + + {errors.taxId &&
{errors.taxId.message}
} +
-
- - - {errors.officeNumber &&
{errors.officeNumber.message}
} -
+
+ + + {errors.officeNumber &&
{errors.officeNumber.message}
} +
-
- - - {errors.industryId &&
{errors.industryId.message}
} -
+
+ + + {errors.industryId &&
{errors.industryId.message}
} +
-
- - - {errors.reference &&
{errors.reference.message}
} -
+
+ + + {errors.reference &&
{errors.reference.message}
} +
- + - - {errors.organizationSize && ( -
{errors.organizationSize.message}
- )} -
+ + {errors.organizationSize && ( +
{errors.organizationSize.message}
+ )} +
-
- -