Compare commits

...

15 Commits

Author SHA1 Message Date
Pramod Mahajan
13fb930a77 Merge branch 'Issue_May_2W' of https://git.marcoaiot.com/admin/marco.pms.web into pramod_Bug#141 2025-05-08 15:56:30 +05:30
284d36e5ac Merge pull request 'Added logic to the employee list to hide the 'Manage Role' and 'Suspend' buttons for system-defined employees' (#85) from Ashutosh_Enhancement#198_Added_IsSystem into Issue_May_2W
Reviewed-on: #85
2025-05-08 10:15:33 +00:00
ba763f986d Added logic to the employee list to hide the 'Manage Role' and 'Suspend' buttons for system-defined employees 2025-05-08 10:15:33 +00:00
e856220173 Merge pull request 'restrict employee search to first and last name fields only' (#81) from pramod_Bug#150 into Issue_May_2W
Reviewed-on: #81
2025-05-08 10:15:07 +00:00
Pramod Mahajan
9ac15d3cf7 restrict employee search to first and last name fields only 2025-05-08 10:15:07 +00:00
9a885c2b72 Merge pull request 'handled server negative response, in user readable format' (#84) from pramod_Bug-#163 into Issue_May_2W
Reviewed-on: #84
2025-05-08 10:14:54 +00:00
Pramod Mahajan
3161288871 handled server negative response, in user readable format 2025-05-08 10:14:54 +00:00
2242569e48 Merge pull request 'project list or card will display 10 per page.' (#83) from pramod_Feature-#51 into Issue_May_2W
Reviewed-on: #83
2025-05-08 10:14:02 +00:00
Pramod Mahajan
7fa502f44c project list or card will display 10 per page. 2025-05-08 10:14:02 +00:00
1ae1a45cb1 Merge pull request 'showing custom delete confirmation modal in master module until API is ready' (#82) from pramod_Bug#141 into Issue_May_2W
Reviewed-on: #82
2025-05-08 10:13:49 +00:00
Pramod Mahajan
4175fb67c6 showing custom delete confirmation modal in master module until API is ready 2025-05-08 10:13:49 +00:00
670efbe1bf Merge pull request 'Reset Select Activity field and remove used activity after task submission' (#80) from pramod_Bug#171 into Issue_May_2W
Reviewed-on: #80
2025-05-08 10:13:19 +00:00
Pramod Mahajan
865cc7a366 Reset Select Activity field and remove used activity after task submission 2025-05-08 10:13:19 +00:00
4fe09330c1 Merge pull request 'added va;idation for contact person. it will accept only alphabetical character' (#79) from pramod_Bug#197 into Issue_May_2W
Reviewed-on: #79
2025-05-08 10:12:23 +00:00
Pramod Mahajan
b004fe8c15 added va;idation for contact person. it will accept only alphabetical character 2025-05-08 10:12:23 +00:00
7 changed files with 24 additions and 19 deletions

View File

@ -194,7 +194,8 @@ const ManageEmployee = () => {
navigation("/employees");
})
.catch((error) => {
showToast(error.message, "error");
const message = error?.response?.data?.message || error?.message || "Error occured during api calling"
showToast(message, "error");
setLoading(false);
});
};

View File

@ -157,9 +157,9 @@ const ManageRole = ( {employeeId, onClosed} ) =>
reset();
onClosed();
})
.catch((err) => {
console.error(err);
showToast(err.message, "error");
.catch((error) => {
const message = error?.response?.data?.message || error?.message || "Error occured during api calling"
showToast(message, "error");
setIsLoading(false);
});
};

View File

@ -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 && (
<div className="col-12 col-md-12">
<label className="form-label" htmlFor="activityID">
<label className="form-label" >
Select Activity
</label>
<select

View File

@ -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 && (

View File

@ -46,17 +46,16 @@ const EmployeeList = () => {
const handleSearch = (e) => {
const value = e.target.value.toLowerCase();
setSearchText(value);
if (!employeeList.length) return;
const results = employeeList.filter((item) =>
Object.values(item).some(
(field) => field && field.toString().toLowerCase().includes(value)
)
);
const results = employeeList.filter((item) => {
const fullName = `${item.firstName} ${item.lastName}`.toLowerCase();
return fullName.includes(value);
});
setFilteredData(results);
};
};
useEffect(() => {
setCurrentPage(1);
@ -557,7 +556,7 @@ const EmployeeList = () => {
>
<i className="bx bx-edit bx-sm"></i> Edit
</Link>
<button
{!item.isSystem && (<><button
className="dropdown-item py-1"
onClick={() => suspendEmployee(item.id)}
>
@ -573,7 +572,7 @@ const EmployeeList = () => {
>
<i className="bx bx-cog bx-sm"></i> Manage
Role
</button>
</button></>)}
</div>
</div>
</td>

View File

@ -25,7 +25,7 @@ const ProjectList = () => {
const dispatch = useDispatch();
const [currentPage, setCurrentPage] = useState(1);
const [itemsPerPage] = useState(6);
const [itemsPerPage] = useState(10);
const [searchTerm, setSearchTerm] = useState("");
const [selectedStatuses, setSelectedStatuses] = useState([
"b74da4c2-d07e-46f2-9919-e75e49b12731",

View File

@ -15,7 +15,7 @@ export const RolesRepository = {
getEmployeeRoles:(id)=>api.get(`/api/employee/roles/${id}`),
createEmployeeRoles:(data)=>api.post("/api/employee/roles",data)
createEmployeeRoles:(data)=>api.post("/api/roles/assign-roles",data)
};