Merge branch 'Feature_Task_Management' of https://git.marcoaiot.com/admin/marco.pms.web into Feature_Task_Management

This commit is contained in:
Pramod Mahajan 2025-04-08 18:22:14 +05:30
commit 57cf750d62
5 changed files with 45 additions and 22 deletions

View File

@ -36,7 +36,30 @@ const ManageEmployee = () => {
FirstName: z.string().min(1, { message: "First Name is required" }),
MiddleName: z.string().optional(),
LastName: z.string().min(1, { message: "Last Name is required" }),
Email: z.string().optional(),
Email: z
.string()
.optional()
.refine(
(val) =>
!val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val),
{
message: "Invalid email format",
}
)
.refine(
(val) => {
if (!val) return true;
const [local, domain] = val.split("@");
return (
val.length <= 320 &&
local?.length <= 64 &&
domain?.length <= 255
);
},
{
message: "Email local or domain part is too long",
}
),
CurrentAddress: z
.string()
.min(1, { message: "Current Address is required" })
@ -86,7 +109,7 @@ const ManageEmployee = () => {
.refine((val) => !val || /^[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(val), {
message: "Invalid PAN number",
}),
PeramnentAddress: z
PermanentAddress: z
.string()
.min(1, { message: "Permanent Address is required" })
.max(150, { message: "Address cannot exceed 150 characters" }),
@ -120,7 +143,7 @@ const ManageEmployee = () => {
AadharNumber: currentEmployee?.aadharNumber || "",
Gender: currentEmployee?.gender || "",
PanNumber: currentEmployee?.panNumber || "",
PeramnentAddress: currentEmployee?.peramnentAddress || "",
PermanentAddress: currentEmployee?.permanentAddress || "",
PhoneNumber: currentEmployee?.phoneNumber || "",
JobRoleId: currentEmployee?.jobRoleId || "",
},
@ -191,7 +214,7 @@ const ManageEmployee = () => {
AadharNumber: currentEmployee.aadharNumber || "",
Gender: currentEmployee.gender || "",
PanNumber: currentEmployee.panNumber || "",
PeramnentAddress: currentEmployee.peramnentAddress || "",
PermanentAddress: currentEmployee.permanentAddress || "",
PhoneNumber: currentEmployee.phoneNumber || "",
JobRoleId: currentEmployee.jobRoleId?.toString() || "",
}
@ -421,22 +444,22 @@ const ManageEmployee = () => {
)}
</div>
<div className="col-sm-6">
<div className="form-text text-start">Permnant Address</div>
<div className="form-text text-start">Permanent Address</div>
<textarea
id="PeramnentAddress"
id="PermanentAddress"
className="form-control form-control-sm"
placeholder="Permnant Address"
aria-label="Permnant Address"
placeholder="Permanent Address"
aria-label="Permanent Address"
aria-describedby="basic-icon-default-message2"
{...register("PeramnentAddress")}
{...register("PermanentAddress")}
></textarea>
{errors.PeramnentAddress && (
{errors.PermanentAddress && (
<div
className="danger-text text-start"
style={{ fontSize: "12px" }}
>
{errors.PeramnentAddress.message}
{errors.PermanentAddress.message}
</div>
)}
</div>

View File

@ -181,10 +181,10 @@ const ManageProjectInfo = ( {project,handleSubmitForm, onClose} ) =>
<option value="1">Active</option>
<option value="2">On Hold</option>
<option value="3">Suspended</option>
<option value="4">Inactive</option>
{/* <option value="3">Suspended</option> */}
<option value="3">Inactive</option>
<option value="5">Completed</option>
<option value="4">Completed</option>
</select>
{errors.projectStatusId && <div className="danger-text text-start" style={{fontSize:"12px"}}>{errors.projectStatusId.message}</div>}

View File

@ -30,11 +30,11 @@ const ProjectCard = ( {projectData} ) =>
return "Active";
case 2:
return "On Hold";
// case 3:
// return "Suspended";
case 3:
return "Suspended";
case 4:
return "Inactive";
case 5:
case 4:
return "Completed";
}
};

View File

@ -174,7 +174,7 @@ const EmployeeProfile = () => {
</li>
<li className="d-flex align-items-start test-start mb-2">
<span className={`${currentEmployee?.permanentAddress ? "" : "ms-4"}`}>
{currentEmployee?.peramnentAddress}
{currentEmployee?.permanentAddress}
</span>
</li>

View File

@ -6,13 +6,13 @@ export const ProjectStatus =(statusId)=>{
case 2:
return "On Hold"
break;
// case 3:
// return "Suspended"
// break;
case 3:
return "Suspended"
break;
case 4:
return "Inactive"
break;
case 5:
case 4:
return "Completed"
break;
default: