Merge branch 'Issue_May_2W' of https://git.marcoaiot.com/admin/marco.pms.web into pramod_Task#207

This commit is contained in:
Pramod Mahajan 2025-05-12 16:39:40 +05:30
commit d5d4cd0dc4
16 changed files with 422 additions and 175 deletions

View File

@ -189,3 +189,7 @@
text-align: left; text-align: left;
padding-left: 50px; padding-left: 50px;
} */ } */
.small-text{
font-size: 12px;
}

View File

@ -29002,7 +29002,6 @@ li:not(:first-child) .dropdown-item,
/* Only for menu example */ /* Only for menu example */
.menu-collapsed:not(:hover) { .menu-collapsed:not(:hover) {
inline-size: var(--bs-menu-collapsed-width); inline-size: var(--bs-menu-collapsed-width);
/* Custom for sneat only */
} }
.menu-collapsed:not(:hover) .menu-inner > .menu-item { .menu-collapsed:not(:hover) .menu-inner > .menu-item {
inline-size: var(--bs-menu-collapsed-width); inline-size: var(--bs-menu-collapsed-width);
@ -29682,7 +29681,6 @@ li:not(:first-child) .dropdown-item,
) )
.layout-menu.menu-vertical { .layout-menu.menu-vertical {
inline-size: var(--bs-menu-collapsed-width); inline-size: var(--bs-menu-collapsed-width);
/* Custom for sneat only */
} }
.layout-menu-collapsed:not( .layout-menu-collapsed:not(
.layout-menu-hover, .layout-menu-hover,

View File

@ -186,7 +186,6 @@
> .menu-item { > .menu-item {
margin: $menu-item-spacer 0; margin: $menu-item-spacer 0;
// Sneat menu-link spacing
.menu-link { .menu-link {
margin: $menu-vertical-link-margin-y $menu-vertical-link-margin-x; margin: $menu-vertical-link-margin-y $menu-vertical-link-margin-x;
} }
@ -197,7 +196,6 @@
.menu-block { .menu-block {
padding: $menu-vertical-link-padding-y $menu-vertical-link-padding-x; padding: $menu-vertical-link-padding-y $menu-vertical-link-padding-x;
} }
// Sneat menu-header spacing
.menu-header { .menu-header {
margin: $menu-vertical-header-margin-y 0 $menu-vertical-header-margin-y * 0.5 0; margin: $menu-vertical-header-margin-y 0 $menu-vertical-header-margin-y * 0.5 0;
padding: $menu-vertical-link-padding-y $menu-vertical-link-padding-x * 2 $menu-vertical-link-padding-y padding: $menu-vertical-link-padding-y $menu-vertical-link-padding-x * 2 $menu-vertical-link-padding-y
@ -276,7 +274,7 @@
// Vertical Menu Collapsed // Vertical Menu Collapsed
// ******************************************************************************* // *******************************************************************************
// ! Updated menu collapsed styles for sneat in this mixin // ! Updated menu collapsed styles for in this mixin
@mixin layout-menu-collapsed() { @mixin layout-menu-collapsed() {
width: $menu-collapsed-width; width: $menu-collapsed-width;
@ -312,7 +310,6 @@
top: 1.1875rem; top: 1.1875rem;
} }
} }
// Custom for sneat only
.menu-block { .menu-block {
&::before { &::before {
bottom: 0.75rem; bottom: 0.75rem;

View File

@ -27,15 +27,21 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
}); });
const containerRef = useRef(null); const containerRef = useRef(null);
const firstRender = useRef(true);
useEffect(() => { useEffect(() => {
setComment(commentsData?.comments); setComment(commentsData?.comments);
}, [commentsData]); }, [commentsData]);
// Scroll logic: scroll to bottom when new comments are added
useEffect(() => { useEffect(() => {
if (containerRef.current) { if (!firstRender.current && containerRef.current) {
containerRef.current.scrollTop = containerRef.current.scrollHeight; containerRef.current.scrollTop = containerRef.current.scrollHeight;
} else {
firstRender.current = false; // Mark the first render as complete
} }
}, [comments]); }, [comments]); // Run this when comments array is updated
const onSubmit = async (data) => { const onSubmit = async (data) => {
let sendComment = { let sendComment = {
@ -70,9 +76,10 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
// closeModal(); // closeModal();
} catch (error) { } catch (error) {
setloading(false); setloading(false);
showToast(error.response.data?.message || "Something wrong", "error"); showToast(error.response.data?.message || "Something went wrong", "error");
} }
}; };
return ( return (
<div <div
className="modal-dialog modal-lg modal-simple report-task-comments-modal mx-sm-auto mx-1" className="modal-dialog modal-lg modal-simple report-task-comments-modal mx-sm-auto mx-1"
@ -86,7 +93,22 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
onClick={closeModal} onClick={closeModal}
aria-label="Close" aria-label="Close"
></button> ></button>
<p className="fs-6 text-dark text-start"> <p className="fs-6 text-dark text-start m-0">Activity Summary</p>
<p className="small-text text-start my-2">
{comments && comments[0]?.comment}
</p>
<p className="fw-bold my-2 text-start">
Assigned By :
<span className=" ms-2">
{commentsData?.assignedBy.firstName +
" " +
commentsData?.assignedBy.lastName}
</span>{" "}
</p>
<p className="fw-bold my-2 text-start">
Loaction :
<span className="fw-normal ms-2 text-start">
{`${commentsData?.workItem?.workArea?.floor?.building?.name}`}{" "} {`${commentsData?.workItem?.workArea?.floor?.building?.name}`}{" "}
<i className="bx bx-chevron-right"></i>{" "} <i className="bx bx-chevron-right"></i>{" "}
{`${commentsData?.workItem?.workArea?.floor?.floorName} `}{" "} {`${commentsData?.workItem?.workArea?.floor?.floorName} `}{" "}
@ -94,53 +116,33 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
{`${commentsData?.workItem?.workArea?.areaName}`} {`${commentsData?.workItem?.workArea?.areaName}`}
<i className="bx bx-chevron-right"></i> <i className="bx bx-chevron-right"></i>
{` ${commentsData?.workItem?.activityMaster?.activityName}`} {` ${commentsData?.workItem?.activityMaster?.activityName}`}
</p>
<ul
className="list-grouph px-0 mx-0 overflow-auto"
ref={containerRef}
style={{ maxHeight: "400px" }}
>
{comments &&
comments?.map((data) => {
const fullName = `${data?.employee?.firstName} ${data?.employee?.lastName}`;
const bgClass = getBgClassFromHash(fullName);
return (
<li
className={`list-group-item list-group-item-action my-2 p-1`}
>
<div
className={`li-wrapper d-flex justify-content-start align-items-start my-0 `}
>
<div className="avatar avatar-xs me-1">
<span
className={`avatar-initial rounded-circle bg-label-primary}`}
>
{`${data?.employee?.firstName?.slice(
0,
1
)} ${data?.employee?.lastName?.slice(0, 1)}`}
</span> </span>
</p>
<p className="fw-bold my-2 text-start">
Planned Work: {commentsData?.plannedTask}
</p>
<p className="fw-bold my-2 text-start">
{" "}
Completed Work : {commentsData?.completedTask}
</p>
<div className="d-flex align-items-center flex-wrap">
<p className="fw-bold text-start m-0 me-1">Team:</p>
<div className="d-flex flex-wrap align-items-center gap-2">
{commentsData?.teamMembers?.map((member, idx) => (
<span key={idx} className="d-flex align-items-center">
<Avatar
firstName={member?.firstName}
lastName={member?.lastName}
size="xs"
/>
{member?.firstName + " " + member?.lastName}
</span>
))}
</div>
</div> </div>
<div className={` text-start py-0 `}> <form onSubmit={handleSubmit(onSubmit)} className="text-start">
<p className={`mb-0 text-${bgClass}`}>{fullName}</p> <label className="fw-bold text-start my-1">Add comment :</label>
<p
className=" text-muted m-0 "
style={{ fontSize: "10px" }}
>
{moment.utc(data?.commentDate).local().fromNow()}
</p>
</div>
</div>
<p className={`ms-6 text-start mb-0 text-body`}>
{data?.comment}
</p>
</li>
);
})}
</ul>
<form onSubmit={handleSubmit(onSubmit)}>
<textarea <textarea
{...register("comment")} {...register("comment")}
className="form-control" className="form-control"
@ -165,6 +167,47 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
</button> </button>
</div> </div>
</form> </form>
<ul
className="list-group px-0 mx-0 overflow-auto border-0"
// ref={containerRef} // auto scroll according data
style={{ maxHeight: "200px" }}
>
{comments &&
comments
?.slice()
.reverse()
.map((data, idx) => {
const fullName = `${data?.employee?.firstName} ${data?.employee?.lastName}`;
const bgClass = getBgClassFromHash(fullName);
return (
<li
className={`list-group-item list-group-item-action border-none my-1 p-1`}
key={idx}
>
<div
className={`li-wrapper d-flex justify-content-start align-items-start my-0`}
>
<div className="avatar avatar-xs me-1">
<span
className={`avatar-initial rounded-circle bg-label-primary`}
>
{`${data?.employee?.firstName?.slice(0, 1)} ${data?.employee?.lastName?.slice(0, 1)}`}
</span>
</div>
<div className={`text-start py-0`}>
<p className={`mb-0 text-${bgClass}`}>{fullName}</p>
<p className="text-muted m-0" style={{ fontSize: "10px" }}>
{moment.utc(data?.commentDate).local().fromNow()}
</p>
</div>
</div>
<p className={`ms-6 text-start mb-0 text-body`}>{data?.comment}</p>
</li>
);
})}
</ul>
</div> </div>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@ import { changeMaster } from "../../slices/localVariablesSlice";
import { Link, useNavigate, useParams } from "react-router-dom"; import { Link, useNavigate, useParams } from "react-router-dom";
import { formatDate } from "../../utils/dateUtils"; import { formatDate } from "../../utils/dateUtils";
import { useEmployeeProfile } from "../../hooks/useEmployees"; import { useEmployeeProfile } from "../../hooks/useEmployees";
import { clearCacheKey, getCachedData } from "../../slices/apiDataManager"; import { cacheData, clearCacheKey, getCachedData } from "../../slices/apiDataManager";
import { clearApiCacheKey } from "../../slices/apiCacheSlice"; import { clearApiCacheKey } from "../../slices/apiCacheSlice";
const mobileNumberRegex = /^[0-9]\d{9}$/; const mobileNumberRegex = /^[0-9]\d{9}$/;
@ -33,7 +33,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
const { data: job_role, loading } = useMaster(); const { data: job_role, loading } = useMaster();
const [isloading, setLoading] = useState(false); const [isloading, setLoading] = useState(false);
const navigation = useNavigate(); const navigation = useNavigate();
const [currentEmployee, setCurrentEmployee] = useState(); const [currentEmployee, setCurrentEmployee] = useState(null);
const [currentAddressLength, setCurrentAddressLength] = useState(0); const [currentAddressLength, setCurrentAddressLength] = useState(0);
const [permanentAddressLength, setPermanentAddressLength] = useState(0); const [permanentAddressLength, setPermanentAddressLength] = useState(0);
@ -157,22 +157,32 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
mode: "onChange", mode: "onChange",
}); });
const AadharNumberValue = watch("AadharNumber") || ""; const AadharNumberValue = watch("aadharNumber") || "";
const onSubmit = (data) => { const onSubmit = (data) => {
setLoading(true); setLoading(true);
if (data.email == "") {
console.log(data); data.email = null;
}
EmployeeRepository.manageEmployee(data) EmployeeRepository.manageEmployee(data)
.then((response) => { .then((response) => {
showToast("Employee details updated successfully.", "success"); cacheData("employeeProfileInfo", data);
showToast(
`Employee details ${
data.id == null ? "created" : "updated"
} successfully.`,
"success"
);
clearCacheKey("employeeListByProject"); clearCacheKey("employeeListByProject");
clearCacheKey("allEmployeeList"); clearCacheKey("allEmployeeList");
clearCacheKey("allInactiveEmployeeList");
clearCacheKey("employeeProfile"); clearCacheKey("employeeProfile");
setLoading(false); setLoading(false);
reset(); reset();
navigation("/employees"); // navigation("/employees");
onClosed();
}) })
.catch((error) => { .catch((error) => {
const message = const message =
@ -232,7 +242,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
className="cursor-pointer fs-6" className="cursor-pointer fs-6"
onClick={() => onClosed()} onClick={() => onClosed()}
> >
<i className='bx bx-x'></i> <i className="bx bx-x"></i>
</span> </span>
</div> </div>
<div className="card-body"> <div className="card-body">
@ -250,15 +260,15 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
name="FirstName" name="FirstName"
{...register("firstName")} {...register("firstName")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="FirstName" id="firstName"
placeholder="First Name" placeholder="First Name"
/> />
{errors.FirstName && ( {errors.firstName && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.FirstName.message} {errors.firstName.message}
</div> </div>
)} )}
</div>{" "} </div>{" "}
@ -269,15 +279,15 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("middleName")} {...register("middleName")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="MiddleName" id="middleName"
placeholder="Middle Name" placeholder="Middle Name"
/> />
{errors.MiddleName && ( {errors.middleName && (
<div <div
className="danger-text text-start " className="danger-text text-start "
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.MiddleName.message} {errors.middleName.message}
</div> </div>
)} )}
</div> </div>
@ -287,15 +297,15 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("lastName")} {...register("lastName")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="LastName" id="lastName"
placeholder="Last Name" placeholder="Last Name"
/> />
{errors.LastName && ( {errors.lastName && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.LastName.message} {errors.lastName.message}
</div> </div>
)} )}
</div> </div>
@ -305,7 +315,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<div className="form-text text-start">Email</div> <div className="form-text text-start">Email</div>
<input <input
type="email" type="email"
id="Email" id="email"
{...register("email")} {...register("email")}
className="form-control form-control-sm" className="form-control form-control-sm"
placeholder="example@domain.com" placeholder="example@domain.com"
@ -313,12 +323,12 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
aria-describedby="Email" aria-describedby="Email"
disabled={!!currentEmployee?.email} disabled={!!currentEmployee?.email}
/> />
{errors.Email && ( {errors.email && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.Email.message} {errors.email.message}
</div> </div>
)} )}
</div> </div>
@ -327,19 +337,19 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<input <input
type="text" type="text"
keyboardType="numeric" keyboardType="numeric"
id="PhoneNumber" id="phoneNumber"
{...register("phoneNumber")} {...register("phoneNumber")}
className="form-control form-control-sm" className="form-control form-control-sm"
placeholder="Phone Number" placeholder="Phone Number"
inputMode="numeric" inputMode="numeric"
maxLength={10} maxLength={10}
/> />
{errors.PhoneNumber && ( {errors.phoneNumber && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.PhoneNumber.message} {errors.phoneNumber.message}
</div> </div>
)} )}
</div> </div>
@ -353,7 +363,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<select <select
className="form-select form-select-sm " className="form-select form-select-sm "
{...register("gender")} {...register("gender")}
id="Gender" id="gender"
aria-label="" aria-label=""
> >
<option disabled value=""> <option disabled value="">
@ -364,12 +374,12 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<option value="Other">Other</option> <option value="Other">Other</option>
</select> </select>
</div> </div>
{errors.Gender && ( {errors.gender && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.Gender.message} {errors.gender.message}
</div> </div>
)} )}
</div> </div>
@ -381,15 +391,15 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
className="form-control form-control-sm" className="form-control form-control-sm"
type="date" type="date"
{...register("birthDate")} {...register("birthDate")}
id="BirthDate" id="birthDate"
/> />
</div> </div>
{errors.BirthDate && ( {errors.birthDate && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.BirthDate.message} {errors.birthDate.message}
</div> </div>
)} )}
</div> </div>
@ -401,15 +411,15 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
className="form-control form-control-sm" className="form-control form-control-sm"
type="date" type="date"
{...register("joiningDate")} {...register("joiningDate")}
id="JoiningDate" id="joiningDate"
/> />
</div> </div>
{errors.JoiningDate && ( {errors.joiningDate && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.JoiningDate.message} {errors.joiningDate.message}
</div> </div>
)} )}
</div> </div>
@ -419,7 +429,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<div className="form-text text-start">Current Address</div> <div className="form-text text-start">Current Address</div>
<textarea <textarea
id="CurrentAddress" id="currentAddress"
className="form-control form-control-sm" className="form-control form-control-sm"
placeholder="Current Address" placeholder="Current Address"
aria-label="Current Address" aria-label="Current Address"
@ -429,7 +439,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
onChange={(e) => { onChange={(e) => {
setCurrentAddressLength(e.target.value.length); setCurrentAddressLength(e.target.value.length);
// let react-hook-form still handle it // let react-hook-form still handle it
register("CurrentAddress").onChange(e); register("currentAddress").onChange(e);
}} }}
></textarea> ></textarea>
<div className="text-end muted"> <div className="text-end muted">
@ -438,12 +448,12 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
{500 - currentAddressLength} characters left {500 - currentAddressLength} characters left
</small> </small>
</div> </div>
{errors.CurrentAddress && ( {errors.currentAddress && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.CurrentAddress.message} {errors.currentAddress.message}
</div> </div>
)} )}
</div> </div>
@ -453,7 +463,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
</div> </div>
<textarea <textarea
id="PermanentAddress" id="permanentAddress"
className="form-control form-control-sm" className="form-control form-control-sm"
placeholder="Permanent Address" placeholder="Permanent Address"
aria-label="Permanent Address" aria-label="Permanent Address"
@ -462,7 +472,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
maxLength={500} maxLength={500}
onChange={(e) => { onChange={(e) => {
setPermanentAddressLength(e.target.value.length); setPermanentAddressLength(e.target.value.length);
register("PermanentAddress").onChange(e); register("permanentAddress").onChange(e);
}} }}
></textarea> ></textarea>
<div className="text-end muted"> <div className="text-end muted">
@ -470,12 +480,12 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
{500 - permanentAddressLength} characters left {500 - permanentAddressLength} characters left
</small> </small>
</div> </div>
{errors.PermanentAddress && ( {errors.permanentAddress && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.PermanentAddress.message} {errors.permanentAddress.message}
</div> </div>
)} )}
</div> </div>
@ -493,7 +503,7 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
<select <select
className="form-select form-select-sm" className="form-select form-select-sm"
{...register("jobRoleId")} {...register("jobRoleId")}
id="JobRoleId" id="jobRoleId"
aria-label="" aria-label=""
> >
<option disabled value=""> <option disabled value="">
@ -506,12 +516,12 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
))} ))}
</select> </select>
</div> </div>
{errors.JobRoleId && ( {errors.jobRoleId && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.JobRoleId.message} {errors.jobRoleId.message}
</div> </div>
)} )}
</div> </div>
@ -523,16 +533,16 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("emergencyContactPerson")} {...register("emergencyContactPerson")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="EmergencyContactPerson" id="emergencyContactPerson"
maxLength={50} maxLength={50}
placeholder="Contact Person" placeholder="Contact Person"
/> />
{errors.EmergencyContactPerson && ( {errors.emergencyContactPerson && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.EmergencyContactPerson.message} {errors.emergencyContactPerson.message}
</div> </div>
)} )}
</div> </div>
@ -544,17 +554,17 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("emergencyPhoneNumber")} {...register("emergencyPhoneNumber")}
className="form-control form-control-sm phone-mask" className="form-control form-control-sm phone-mask"
id="EmergencyPhoneNumber" id="emergencyPhoneNumber"
placeholder="Phone Number" placeholder="Phone Number"
inputMode="numeric" inputMode="numeric"
maxLength={10} maxLength={10}
/> />
{errors.EmergencyPhoneNumber && ( {errors.emergencyPhoneNumber && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.EmergencyPhoneNumber.message} {errors.emergencyPhoneNumber.message}
</div> </div>
)} )}
</div> </div>
@ -567,14 +577,14 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("aadharNumber")} {...register("aadharNumber")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="AadharNumber" id="aadharNumber"
placeholder="AADHAR Number" placeholder="AADHAR Number"
maxLength={12} maxLength={12}
inputMode="numeric" inputMode="numeric"
/> />
{errors.AadharNumber && ( {errors.aadharNumber && (
<div className="danger-text text-start"> <div className="danger-text text-start">
{errors.AadharNumber.message} {errors.aadharNumber.message}
</div> </div>
)} )}
</div> </div>
@ -585,16 +595,16 @@ const ManageEmployee = ({ employeeId, onClosed }) => {
type="text" type="text"
{...register("panNumber")} {...register("panNumber")}
className="form-control form-control-sm" className="form-control form-control-sm"
id="PanNumber" id="panNumber"
placeholder="PAN Number" placeholder="PAN Number"
maxLength={10} maxLength={10}
/> />
{errors.PanNumber && ( {errors.panNumber && (
<div <div
className="danger-text text-start" className="danger-text text-start"
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
{errors.PanNumber.message} {errors.panNumber.message}
</div> </div>
)} )}
</div> </div>

View File

@ -58,7 +58,7 @@ const LayoutMenu = () => {
</g> </g>
</svg> </svg>
</span> </span>
<span className="app-brand-text demo menu-text fw-bolder ms-2">Sneat</span> <span className="app-brand-text demo menu-text fw-bolder ms-2">Marco</span>
</a> </a>
<a href="javascript:void(0);" className="layout-menu-toggle menu-link text-large ms-auto d-block d-xl-none"> <a href="javascript:void(0);" className="layout-menu-toggle menu-link text-large ms-auto d-block d-xl-none">

View File

@ -3,7 +3,7 @@ import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod"; import { z } from "zod";
import { useActivitiesMaster } from "../../../hooks/masterHook/useMaster"; import { useActivitiesMaster, useWorkCategoriesMaster } from "../../../hooks/masterHook/useMaster";
import { useProjectDetails } from "../../../hooks/useProjects"; import { useProjectDetails } from "../../../hooks/useProjects";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import ProjectRepository from "../../../repositories/ProjectRepository"; import ProjectRepository from "../../../repositories/ProjectRepository";
@ -18,6 +18,7 @@ import showToast from "../../../services/toastService";
const taskSchema = z const taskSchema = z
.object({ .object({
activityID: z.string().min(1, "Activity is required"), activityID: z.string().min(1, "Activity is required"),
workCategoryId: z.string().min(1, "Work Category is required"),
plannedWork: z.number().min(1, "Planned Work must be greater than 0"), plannedWork: z.number().min(1, "Planned Work must be greater than 0"),
completedWork: z.number().min(0, "Completed Work must be greater than 0"), completedWork: z.number().min(0, "Completed Work must be greater than 0"),
}) })
@ -43,17 +44,21 @@ const EditActivityModal = ({
); );
const defaultModel = { const defaultModel = {
activityID: 0, activityID: 0,
workCategoryId: 0,
plannedWork: 0, plannedWork: 0,
completedWork: 0, completedWork: 0,
}; };
const { projects_Details, refetch } = useProjectDetails(selectedProject); const { projects_Details, refetch } = useProjectDetails(selectedProject);
const [ActivityUnit,setActivityUnit]= useState("") const [ActivityUnit, setActivityUnit] = useState("");
const { activities, loading, error } = useActivitiesMaster(); const { activities, loading, error } = useActivitiesMaster();
const { categories, categoryLoading, categoryError } =
useWorkCategoriesMaster();
const [formData, setFormData] = useState(defaultModel); const [formData, setFormData] = useState(defaultModel);
const [selectedActivity, setSelectedActivity] = useState(null); const [selectedActivity, setSelectedActivity] = useState(null);
const [isSubmitting, setIsSubmitting] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false);
const [activityData, setActivityData] = useState([]); const [activityData, setActivityData] = useState([]);
const [categoryData, setCategoryData] = useState([]);
const dispatch = useDispatch(); const dispatch = useDispatch();
const { const {
@ -70,12 +75,19 @@ const EditActivityModal = ({
}); });
const handleActivityChange = (e) => { const handleActivityChange = (e) => {
const selectedId = Number(e.target.value); const selectedId = String(e.target.value);
const selected = activityData.find((a) => a.id === selectedId); const selected = activityData.find((a) => a.id === selectedId);
setSelectedActivity(selected || null); setSelectedActivity(selected || null);
setValue("activityID", selectedId); setValue("activityID", selectedId);
}; };
const handleCategoryChange = (e) => {
const selectedId = String(e.target.value);
const category = categoryData.find((b) => b.id === selectedId);
setSelectedCategory(category || null);
setValue("workCategoryId", selectedId);
};
const onSubmitForm = async ( data ) => const onSubmitForm = async ( data ) =>
{ {
setIsSubmitting(true) setIsSubmitting(true)
@ -167,6 +179,8 @@ const EditActivityModal = ({
useEffect(() => { useEffect(() => {
reset({ reset({
activityID: workItem?.workItem?.activityId || workItem?.activityId || 0, activityID: workItem?.workItem?.activityId || workItem?.activityId || 0,
workCategoryId:
workItem?.workItem?.workCategoryId || workItem?.workCategoryId || 0,
plannedWork: plannedWork:
workItem?.workItem?.plannedWork || workItem?.plannedWork || 0, workItem?.workItem?.plannedWork || workItem?.plannedWork || 0,
completedWork: completedWork:
@ -180,11 +194,10 @@ const EditActivityModal = ({
if (ISselectedActivity) { if (ISselectedActivity) {
const selected = activities.find((a) => a.id === ISselectedActivity); const selected = activities.find((a) => a.id === ISselectedActivity);
setSelectedActivity(selected || null); setSelectedActivity(selected || null);
setActivityUnit(selected?.unitOfMeasurement) setActivityUnit(selected?.unitOfMeasurement);
} }
}, [ISselectedActivity, activities]); }, [ISselectedActivity, activities]);
return ( return (
<div className="modal-dialog modal-lg modal-simple modal-edit-user"> <div className="modal-dialog modal-lg modal-simple modal-edit-user">
<div className="modal-content"> <div className="modal-content">
@ -279,6 +292,45 @@ const EditActivityModal = ({
)} )}
</div> </div>
{/* Select Category */}
<div className="col-12 col-md-12">
<label className="form-label" htmlFor="activityID">
Select Work Category
</label>
<select
id="workCategoryId"
className="form-select form-select-sm"
{...register("workCategoryId")}
>
{loading ? (
<option value="">Loading...</option>
) : (
<option disabled>Select Category</option>
)}
{categories &&
categories.length > 0 &&
categories
.slice()
.sort((a, b) =>
(a.name || "").localeCompare(
b.name || ""
)
)
.map((category) => (
<option key={category.id} value={category.id}>
{category.name}
</option>
))}
{!loading && categories.length === 0 && (
<option disabled>No categories available</option>
)}
</select>
{errors.workCategoryId && (
<p className="danger-text">{errors.workCategoryId.message}</p>
)}
</div>
{/* Planned Work */} {/* Planned Work */}
{/* {ISselectedActivity && ( */} {/* {ISselectedActivity && ( */}
<div className="col-5 col-md-5"> <div className="col-5 col-md-5">

View File

@ -2,13 +2,17 @@ import React, { useState, useEffect } from "react";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod"; import { z } from "zod";
import {useActivitiesMaster} from "../../../hooks/masterHook/useMaster"; import {
useActivitiesMaster,
useWorkCategoriesMaster,
} from "../../../hooks/masterHook/useMaster";
const taskSchema = z.object({ const taskSchema = z.object({
buildingID: z.string().min(1, "Building is required"), buildingID: z.string().min(1, "Building is required"),
floorId: z.string().min(1, "Floor is required"), floorId: z.string().min(1, "Floor is required"),
workAreaId: z.string().min(1, "Work Area is required"), workAreaId: z.string().min(1, "Work Area is required"),
activityID: z.string().min(1, "Activity is required"), activityID: z.string().min(1, "Activity is required"),
workCategoryId: z.string().min(1, "Work Category is required"),
plannedWork: z.number().min(1, "Planned Work must be greater than 0"), plannedWork: z.number().min(1, "Planned Work must be greater than 0"),
completedWork: z.number().min(0, "Completed Work must be greater than 0"), completedWork: z.number().min(0, "Completed Work must be greater than 0"),
}); });
@ -19,6 +23,7 @@ const defaultModel = {
floorId: "0", floorId: "0",
workAreaId: "0", workAreaId: "0",
activityID: null, activityID: null,
workCategoryId: "",
plannedWork: 0, plannedWork: 0,
completedWork: 0, completedWork: 0,
}; };
@ -30,15 +35,18 @@ const TaskModel = ({
onClearComplete, onClearComplete,
onClose, onClose,
}) => { }) => {
const [formData, setFormData] = useState(defaultModel); const [formData, setFormData] = useState(defaultModel);
const [selectedBuilding, setSelectedBuilding] = useState(null); const [selectedBuilding, setSelectedBuilding] = useState(null);
const [selectedFloor, setSelectedFloor] = useState(null); const [selectedFloor, setSelectedFloor] = useState(null);
const [selectedWorkArea, setSelectedWorkArea] = useState(null); const [selectedWorkArea, setSelectedWorkArea] = useState(null);
const [selectedActivity, setSelectedActivity] = useState(null); const [selectedActivity, setSelectedActivity] = useState(null);
const [selectedCategory, setSelectedCategory] = useState(null);
const [isSubmitting, setIsSubmitting] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false);
const [activityData, setActivityData] = useState([]); const [activityData, setActivityData] = useState([]);
const [categoryData, setCategoryData] = useState([]);
const { activities, loading, error } = useActivitiesMaster(); const { activities, loading, error } = useActivitiesMaster();
const { categories, categoryLoading, categoryError } =
useWorkCategoriesMaster();
const { const {
register, register,
@ -79,6 +87,7 @@ const TaskModel = ({
floorId: value, floorId: value,
workAreaId: 0, workAreaId: 0,
activityID: 0, activityID: 0,
workCategoryId: categoryData?.[0]?.id?.toString() ?? "",
})); }));
}; };
@ -104,13 +113,24 @@ const TaskModel = ({
})); }));
}; };
const onSubmitForm = async ( data ) => const handleCategoryChange = (e) => {
{ const { value } = e.target;
const category = categoryData.find((b) => b.id === String(value));
setSelectedCategory(category);
reset((prev) => ({
...prev,
workCategoryId: String(value),
}));
};
const onSubmitForm = async (data) => {
console.log(data);
setIsSubmitting(true); setIsSubmitting(true);
await onSubmit(data); await onSubmit(data);
setValue("plannedWork", 0); setValue("plannedWork", 0);
setValue("completedWork", 0); setValue("completedWork", 0);
setValue("activityID",0) setValue("activityID", 0);
setValue("workCategoryId", categoryData?.[0]?.id?.toString() ?? "");
setIsSubmitting(false); setIsSubmitting(false);
}; };
@ -120,15 +140,32 @@ const TaskModel = ({
setSelectedFloor(null); setSelectedFloor(null);
setSelectedWorkArea(null); setSelectedWorkArea(null);
setSelectedActivity(null); setSelectedActivity(null);
setSelectedCategory(categoryData?.[0]?.id?.toString() ?? "");
reset(defaultModel); reset(defaultModel);
}; };
useEffect(() => { useEffect(() => {
if (!loading && Array.isArray(activities) && activities.length > 0) { if (!loading && Array.isArray(activities) && activities.length > 0) {
setActivityData(activities); setActivityData(activities);
} }
}, [activities, loading]); }, [activities, loading]);
useEffect(() => {
if (
!categoryLoading &&
Array.isArray(categories) &&
categories.length > 0
) {
const newCategories = categories?.slice()?.sort((a, b) => {
const nameA = a?.name || "";
const nameB = b?.name || "";
return nameA.localeCompare(nameB);
});
setCategoryData(newCategories);
setSelectedCategory(newCategories[0])
}
}, [categories, categoryLoading]);
return ( return (
<div className="modal-dialog modal-lg modal-simple modal-edit-user"> <div className="modal-dialog modal-lg modal-simple modal-edit-user">
<div className="modal-content"> <div className="modal-content">
@ -247,9 +284,7 @@ const TaskModel = ({
{selectedWorkArea && ( {selectedWorkArea && (
<div className="col-12 col-md-12"> <div className="col-12 col-md-12">
<label className="form-label" > <label className="form-label">Select Activity</label>
Select Activity
</label>
<select <select
id="activityID" id="activityID"
className="form-select form-select-sm" className="form-select form-select-sm"
@ -257,28 +292,25 @@ const TaskModel = ({
onChange={handleActivityChange} onChange={handleActivityChange}
> >
<option value="0">Select Activity</option> <option value="0">Select Activity</option>
{activityData && activityData.length > 0 && ( {activityData &&
activityData.length > 0 &&
activityData activityData
?.slice() ?.slice()
?.sort( ( a, b ) => ?.sort((a, b) => {
{
const nameA = a?.activityName || ""; const nameA = a?.activityName || "";
const nameB = b?.activityName || ""; const nameB = b?.activityName || "";
return nameA.localeCompare(nameB); return nameA.localeCompare(nameB);
}) })
?.map((activity) => ( ?.map((activity) => (
<option key={activity.id} value={activity.id}> <option key={activity.id} value={activity.id}>
{ {activity.activityName ||
activity.activityName ||
`Unnamed (id: ${activity.id})`} `Unnamed (id: ${activity.id})`}
</option> </option>
) ) ))}
) } {!loading && activities.length === 0 && (
{(!loading && activities.length === 0 )&& (
<option disabled>No activities available</option> <option disabled>No activities available</option>
)} )}
{loading && ( <option disabled>Loading...</option>)} {loading && <option disabled>Loading...</option>}
</select> </select>
{errors.activityID && ( {errors.activityID && (
@ -287,7 +319,38 @@ const TaskModel = ({
</div> </div>
)} )}
{selectedActivity && ( {selectedWorkArea && (
<div className="col-12 col-md-12">
<label className="form-label">Select Work Category</label>
<select
id="workCategoryId"
className="form-select form-select-sm"
{...register("workCategoryId")}
onChange={handleCategoryChange}
>
{categoryData &&
categoryData.length > 0 &&
categoryData
?.map((category) => (
<option key={category.id} value={category.id}>
{category.name || `Unnamed (id: ${category.id})`}
</option>
))}
{!categoryLoading && categories.length === 0 && (
<option disabled>No activities available</option>
)}
{categoryLoading && <option disabled>Loading...</option>}
</select>
{errors.workCategoryId && (
<p className="danger-text">
{errors.workCategoryId.message}
</p>
)}
</div>
)}
{selectedActivity && selectedCategory && (
<div className="col-5 col-md-5"> <div className="col-5 col-md-5">
<label className="form-label" htmlFor="plannedWork"> <label className="form-label" htmlFor="plannedWork">
{formData.id !== "0" ? "Modify " : "Enter "} Planned Work {formData.id !== "0" ? "Modify " : "Enter "} Planned Work
@ -304,7 +367,7 @@ const TaskModel = ({
</div> </div>
)} )}
{selectedActivity && ( {selectedActivity && selectedCategory && (
<div className="col-5 col-md-5"> <div className="col-5 col-md-5">
<label className="form-label" htmlFor="completedWork"> <label className="form-label" htmlFor="completedWork">
{formData.id !== "0" ? "Modify " : "Enter "} Completed Work {formData.id !== "0" ? "Modify " : "Enter "} Completed Work
@ -324,7 +387,7 @@ const TaskModel = ({
)} )}
{/* Unit */} {/* Unit */}
{selectedActivity && ( {selectedActivity && selectedCategory && (
<div className="col-2 col-md-2"> <div className="col-2 col-md-2">
<label className="form-label" htmlFor="unit"> <label className="form-label" htmlFor="unit">
Unit Unit
@ -340,9 +403,7 @@ const TaskModel = ({
<div className="col-12 text-center"> <div className="col-12 text-center">
<button type="submit" className="btn btn-sm btn-primary me-3"> <button type="submit" className="btn btn-sm btn-primary me-3">
{isSubmitting {isSubmitting ? "Please Wait.." : "Add Task"}
? "Please Wait.."
: "Add Task"}
</button> </button>
<button <button
type="button" type="button"

View File

@ -121,6 +121,9 @@ const WorkArea = ({ workArea, floor, forBuilding }) => {
<th className="infra-activity-table-header d-sm-none d-sm-table-cell"> <th className="infra-activity-table-header d-sm-none d-sm-table-cell">
Status Status
</th> </th>
<th className="infra-activity-table-header-first">
Category
</th>
{/* for greather than mobile view ************* */} {/* for greather than mobile view ************* */}
<th className="infra-activity-table-header d-none d-md-table-cell"> <th className="infra-activity-table-header d-none d-md-table-cell">
Planned Planned

View File

@ -160,6 +160,15 @@ const WorkItem = ( {
? NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork ? NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork
: "NA"} : "NA"}
</td> </td>
<td className="text-start table-cell-small">
<span className="fw-light">
{hasWorkItem
? NewWorkItem?.workItem?.workCategoryMaster?.name ||
workItem.workCategoryMaster?.name || "NA"
: "NA"}
</span>
</td>
{/* for greather than mobile view ************* */} {/* for greather than mobile view ************* */}
<td className="text-center d-none d-md-table-cell"> <td className="text-center d-none d-md-table-cell">
{hasWorkItem {hasWorkItem

View File

@ -117,3 +117,36 @@ export const useActivitiesMaster = () =>
return {activities,loading,error} return {activities,loading,error}
} }
export const useWorkCategoriesMaster = () =>
{
const [ categories, setCategories ] = useState( [] )
const [ categoryLoading, setloading ] = useState( false );
const [ categoryError, setError ] = useState( "" )
const fetchCategories =async () => {
const cacheddata = getCachedData("Work Category");
if (!cacheddata) {
setloading(true);
try {
const response = await MasterRespository.getWorkCategory();
setCategories(response.data);
cacheData("Work Category", response.data);
} catch (err) {
setError(err);
console.log(err);
} finally {
setloading(false);
}
} else {
setCategories(cacheddata);
}
}
useEffect( () =>
{
fetchCategories()
}, [] )
return {categories,categoryLoading,categoryError}
}

View File

@ -209,9 +209,15 @@ export const useEmployeesAllOrByProjectId = (projectId, showInactive) => {
export const useEmployeeProfile = (employeeId) => { export const useEmployeeProfile = (employeeId) => {
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [error, setError] = useState(); const [error, setError] = useState();
const [employee, setEmployees] = useState(); const [employee, setEmployees] = useState(null);
const fetchData = async () => { const fetchData = async () => {
if (!employeeId) {
// Reset the state if no employeeId (e.g., opening for 'add' mode)
setEmployees(null);
setLoading(false);
return;
}
const Employee_cache = getCachedData("employeeProfile"); const Employee_cache = getCachedData("employeeProfile");
if (!Employee_cache || Employee_cache.employeeId !== employeeId) { if (!Employee_cache || Employee_cache.employeeId !== employeeId) {
EmployeeRepository.getEmployeeProfile(employeeId) EmployeeRepository.getEmployeeProfile(employeeId)
@ -231,9 +237,7 @@ export const useEmployeeProfile = (employeeId) => {
}; };
useEffect(() => { useEffect(() => {
if (employeeId) { fetchData();
fetchData(employeeId);
}
}, [employeeId]); }, [employeeId]);
return { employee, loading, error }; return { employee, loading, error };

View File

@ -15,11 +15,8 @@ export const AuthWrapper = ({ children }) => {
className="app-brand-link gap-2" className="app-brand-link gap-2"
> >
<span className="app-brand-logo demo"> <span className="app-brand-logo demo">
<img src="/img/brand/marco.png" alt="sneat-logo" /> <img src="/img/brand/marco.png" alt="marco-logo" />
</span> </span>
{/* <span className="app-brand-text demo text-body fw-bold">
Sneat
</span> */}
</Link> </Link>
</div> </div>
{children} {children}

View File

@ -43,7 +43,7 @@ const EmployeeList = () => {
const [searchText, setSearchText] = useState(""); const [searchText, setSearchText] = useState("");
const [filteredData, setFilteredData] = useState([]); const [filteredData, setFilteredData] = useState([]);
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const [selectedEmployeeId, setSelecedEmployeeId] = useState(); const [selectedEmployeeId, setSelecedEmployeeId] = useState(null);
const [IsDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [IsDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
const [selectedEmpFordelete, setSelectedEmpFordelete] = useState(null); const [selectedEmpFordelete, setSelectedEmpFordelete] = useState(null);
const [employeeLodaing, setemployeeLodaing] = useState(false); const [employeeLodaing, setemployeeLodaing] = useState(false);
@ -111,6 +111,8 @@ const EmployeeList = () => {
document.querySelector(".modal-backdrop").remove(); document.querySelector(".modal-backdrop").remove();
} }
setShowModal(false); setShowModal(false);
clearCacheKey("employeeProfile");
recallEmployeeData(showInactive);
}; };
const handleShow = () => setShowModal(true); const handleShow = () => setShowModal(true);
const handleClose = () => setShowModal(false); const handleClose = () => setShowModal(false);
@ -193,7 +195,7 @@ const EmployeeList = () => {
{isCreateModalOpen && ( {isCreateModalOpen && (
<ManageEmp employeeId={modelConfig} onClosed={closeModal} /> <ManageEmp employeeId={modelConfig} onClosed={closeModal} />
)} )}
<div {showModal && (<div
className={`modal fade ${showModal ? "show" : ""} `} className={`modal fade ${showModal ? "show" : ""} `}
tabIndex="-1" tabIndex="-1"
role="dialog" role="dialog"
@ -211,7 +213,7 @@ const EmployeeList = () => {
/> />
</div> </div>
</div> </div>
</div> </div>)}
{IsDeleteModalOpen && ( {IsDeleteModalOpen && (
<div <div

View File

@ -16,6 +16,7 @@ import { ComingSoonPage } from "../Misc/ComingSoonPage";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import Avatar from "../../components/common/Avatar"; import Avatar from "../../components/common/Avatar";
import AttendancesEmployeeRecords from "./AttendancesEmployeeRecords"; import AttendancesEmployeeRecords from "./AttendancesEmployeeRecords";
import ManageEmployee from "../../components/Employee/ManageEmployee";
const EmployeeProfile = () => { const EmployeeProfile = () => {
const projectID = useSelector((store) => store.localVariables.projectId); const projectID = useSelector((store) => store.localVariables.projectId);
const { employeeId } = useParams(); const { employeeId } = useParams();
@ -26,11 +27,18 @@ const EmployeeProfile = () => {
const tab = SearchParams.get("for"); const tab = SearchParams.get("for");
const [activePill, setActivePill] = useState(tab); const [activePill, setActivePill] = useState(tab);
const [currentEmployee, setCurrentEmployee] = useState(); const [currentEmployee, setCurrentEmployee] = useState();
const [showModal, setShowModal] = useState(false);
const handlePillClick = (pillKey) => { const handlePillClick = (pillKey) => {
setActivePill(pillKey); setActivePill(pillKey);
}; };
const closeModal = () => {
setShowModal(false);
fetchEmployeeProfile(employeeId);
};
const handleShow = () => setShowModal(true);
const fetchEmployeeProfile = async (employeeID) => { const fetchEmployeeProfile = async (employeeID) => {
try { try {
const resp = await EmployeeRepository.getEmployeeProfile(employeeID); const resp = await EmployeeRepository.getEmployeeProfile(employeeID);
@ -89,6 +97,26 @@ const EmployeeProfile = () => {
} }
return ( return (
<> {showModal && (<div
className={`modal fade ${showModal ? "show" : ""} `}
tabIndex="-1"
role="dialog"
style={{ display: showModal ? "block" : "none" }}
aria-hidden={!showModal}
>
<div className="modal-dialog modal-xl modal-dialog-centered ">
<div
className="modal-content overflow-y-auto overflow-x-hidden"
style={{ maxHeight: "90vh" }}
>
<ManageEmployee
employeeId={employeeId}
onClosed={closeModal}
/>
</div>
</div>
</div>)}
<div className="container-xxl flex-grow-1 container-p-y"> <div className="container-xxl flex-grow-1 container-p-y">
<Breadcrumb <Breadcrumb
data={[ data={[
@ -212,7 +240,7 @@ const EmployeeProfile = () => {
<button <button
className="btn btn-primary btn-block" className="btn btn-primary btn-block"
onClick={() => onClick={() =>
navigate(`/employee/manage/${currentEmployee?.id}`) handleShow()
} }
> >
Edit Profile Edit Profile
@ -238,6 +266,8 @@ const EmployeeProfile = () => {
</div> </div>
</div> </div>
</div> </div>
</>
); );
}; };

View File

@ -90,6 +90,10 @@ const router = createBrowserRouter(
future: { future: {
v7_relativeSplatPath: true, v7_relativeSplatPath: true,
v7_startTransition: true, v7_startTransition: true,
v7_fetcherPersist: true,
v7_normalizeFormMethod: true,
v7_partialHydration: true,
v7_skipActionErrorRevalidation: true,
}, },
} }
); );