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

View File

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

View File

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

View File

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