From b004fe8c156a790fa1cdac1405cd68ab0c80a8aa Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Thu, 8 May 2025 11:05:33 +0530 Subject: [PATCH 1/7] added va;idation for contact person. it will accept only alphabetical character --- src/components/Project/ManageProjectInfo.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Project/ManageProjectInfo.jsx b/src/components/Project/ManageProjectInfo.jsx index 8b1550fc..a2bfc3a2 100644 --- a/src/components/Project/ManageProjectInfo.jsx +++ b/src/components/Project/ManageProjectInfo.jsx @@ -28,7 +28,10 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => { name: z.string().min(1, { message: "Project Name is required" }), contactPerson: z .string() - .min(1, { message: "Contact Person Name is required" }), + .min( 1, {message: "Contact Person Name is required"} ) + .regex(/^[A-Za-z\s]+$/, { + message: "Contact Person must contain only letters", + }), projectAddress: z .string() .min(1, { message: "Address is required" }) @@ -156,6 +159,7 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => { name="contactPerson" className="form-control" placeholder="Contact Person" + maxLength={50} {...register("contactPerson")} /> {errors.contactPerson && ( From 865cc7a3665fcd0a7a4bd0b570fccd71af89bd86 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Thu, 8 May 2025 11:43:48 +0530 Subject: [PATCH 2/7] Reset Select Activity field and remove used activity after task submission --- src/components/Project/Infrastructure/TaskModel.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Project/Infrastructure/TaskModel.jsx b/src/components/Project/Infrastructure/TaskModel.jsx index 810b38ea..43cb1c5b 100644 --- a/src/components/Project/Infrastructure/TaskModel.jsx +++ b/src/components/Project/Infrastructure/TaskModel.jsx @@ -110,6 +110,7 @@ const TaskModel = ({ await onSubmit(data); setValue("plannedWork", 0); setValue( "completedWork", 0 ); + setValue("activityID",0) setIsSubmitting(false); }; @@ -246,7 +247,7 @@ const TaskModel = ({ {selectedWorkArea && (
-