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

This commit is contained in:
ashutosh.nehete 2025-04-09 14:33:39 +05:30
commit 19abc42fc6
5 changed files with 62 additions and 17 deletions

View File

@ -29,6 +29,13 @@ const ProjectCard = ({ projectData }) => {
} }
}; };
const getProgress = (planned, completed) => {
return (completed * 100) / planned + "%";
};
const getProgressInNumber = (planned, completed) => {
return (completed * 100) / planned ;
};
const handleClose = () => setShowModal( false ); const handleClose = () => setShowModal( false );
const getProjectStatusName = (statusId) => { const getProjectStatusName = (statusId) => {
@ -229,29 +236,38 @@ const ProjectCard = ({ projectData }) => {
</span> </span>
</div> </div>
<div className="d-flex justify-content-between align-items-center mb-2"> <div className="d-flex justify-content-between align-items-center mb-2">
<small className="text-body">Task: 290/344</small> <small className="text-body">Task: {projectInfo.completedWork} / { projectInfo.plannedWork}</small>
<small className="text-body">95% Completed</small> <small className="text-body">{Math.floor(getProgressInNumber(projectInfo.plannedWork,projectInfo.completedWork)) || 0} % Completed</small>
</div> </div>
<div className="progress mb-4 rounded" style={{ height: "8px" }}> <div className="progress mb-4 rounded" style={{ height: "8px" }}>
<div <div
className="progress-bar rounded" className="progress-bar rounded"
role="progressbar" role="progressbar"
style={{ width: "95%" }} style={{ width: getProgress(projectInfo.plannedWork,projectInfo.completedWork) }}
aria-valuenow="95" aria-valuenow={projectInfo.completedWork}
aria-valuemin="0" aria-valuemin="0"
aria-valuemax="100" aria-valuemax={projectInfo.plannedWork}
></div> ></div>
</div> </div>
<div className="d-flex align-items-center"> <div className="d-flex align-items-center justify-content-between">
<div className="d-flex align-items-center"> {/* <div className="d-flex align-items-center ">
</div> </div> */}
<div className="ms-auto"> <div >
<a <a
className="text-muted d-flex "
>
<i className="bx bx-group bx-sm me-1_5"></i>{projectInfo?.teamSize}
</a>
</div>
<div >
<a
className="text-muted d-flex align-items-center" className="text-muted d-flex align-items-center"
> >
<i className="bx bx-chat me-1"></i> 15 <i className="bx bx-chat me-1"></i> 15
</a> </a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,11 +1,10 @@
import React from "react"; import React from "react";
import {useEmployeesByProjectAllocated} from "../../hooks/useProjects"; import {useEmployeesByProjectAllocated, useProjects} from "../../hooks/useProjects";
const ProjectOverview = ({project}) => const ProjectOverview = ({project}) =>
{ {
const {projectEmployees} = useEmployeesByProjectAllocated( project?.id ); const {projects} = useProjects()
let teamSize = projectEmployees.filter( ( emp ) => emp.isActive ) const teamSize = projects.find((pro)=>pro.id == project)
return ( return (
<div className="card mb-6"> <div className="card mb-6">
<div className="card-body"> <div className="card-body">
@ -26,7 +25,7 @@ const ProjectOverview = ({project}) =>
<li className="d-flex align-items-center"> <li className="d-flex align-items-center">
<i className="bx bx-user"></i> <i className="bx bx-user"></i>
<span className="fw-medium mx-2">Current team Size:</span>{" "} <span className="fw-medium mx-2">Current team Size:</span>{" "}
<span>{ teamSize?.length}</span> <span>{teamSize?.teamSize}</span>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -0,0 +1,30 @@
import React from "react";
const ProgressBar = ( {completeValue, totalValue} ) =>
{
const getProgress = (complete, total) => {
return (total * 100) / complete + "%";
};
return (
<div className="progress mb-4 rounded" style={{height: "8px"}}>
<div className="progress p-0">
<div
className="progress-bar"
role="progressbar"
style={{
width: `${getProgress( totalValue,completeValue)}`,
height: "10px",
}}
aria-valuenow={completeValue}
aria-valuemin="0"
aria-valuemax={totalValue}
></div>
</div>
</div>
);
};
export default ProgressBar;

View File

@ -102,7 +102,7 @@ const ProjectDetails = () => {
</div> </div>
<div className="col-xl-4 col-lg-5 col-md-5"> <div className="col-xl-4 col-lg-5 col-md-5">
{/* Profile Overview */} {/* Profile Overview */}
<ProjectOverview project={ project} /> <ProjectOverview project={projectId} />
{/* Profile Overview */} {/* Profile Overview */}
</div> </div>
</div> </div>

View File

@ -23,7 +23,7 @@ const ProjectList = () =>
const[HasManageProject,setHasManageProject] = useState(HasManageProjectPermission) const[HasManageProject,setHasManageProject] = useState(HasManageProjectPermission)
const dispatch = useDispatch(); const dispatch = useDispatch();
const [currentPage, setCurrentPage] = useState(1); const [currentPage, setCurrentPage] = useState(1);
const [itemsPerPage] = useState(5); const [itemsPerPage] = useState(6);
const handleShow = () => setShowModal(true); const handleShow = () => setShowModal(true);