Compare commits

..

No commits in common. "234006e25b9a9b6aff3aa952e13906b08edf4cf2" and "376b5174868595c89648e33b9a4fccf1690444ae" have entirely different histories.

9 changed files with 74 additions and 73 deletions

View File

@ -100,6 +100,7 @@ const HorizontalBarChart = ({
},
legend: {
show: true,
fontSize: '8px', // Reduce text size
},
tooltip: {
theme: "dark",

View File

@ -36,30 +36,29 @@ const AboutProject = ({ data }) => {
<span className="fw-medium mx-2">Status:</span>{" "}
<span>{ProjectStatus(data.projectStatusId)}</span>
</li>
</ul>
<small className="card-text text-uppercase text-muted small">
Contacts
</small>
<ul className="list-unstyled my-3 py-1">
<li className="d-flex align-items-center mb-4">
<i className="bx bx-user"></i>
<span className="fw-medium mx-2">Contact:</span>{" "}
<span>{data.contactPerson}</span>
</li>
<li className="d-flex align-items-center mb-4">
<i className="bx bx-flag"></i>
<span className="fw-medium mx-2">Address:</span>{" "}
</li>
</ul>
{/* <small className="card-text text-uppercase text-muted small">
Contacts
</small> */}
<ul className="list-unstyled my-3 py-1">
{/* <li className="d-flex align-items-center mb-4">
<i className="bx bx-phone"></i>
<span className="fw-medium mx-2">Contact Number:</span>{" "}
<span>NA</span>
</li> */}
{/* <li className="d-flex align-items-center mb-4">
</li>
<li className="d-flex align-items-center mb-4">
<i className="bx bx-envelope"></i>
<span className="fw-medium mx-2">Email:</span> <span>NA</span>
</li> */}
</li>
<li className="d-flex align-items-center mb-4">
<i className="bx bx-flag"></i>
<span className="fw-medium mx-2">Address:</span>{" "}
</li>
<li className="d-flex align-items-start test-start mb-4">
<span>{data.projectAddress}</span>
</li>

View File

@ -92,7 +92,7 @@ const onSubmit = async(data) => {
let response = await TasksRepository.assignTask( formattedData );
showToast( "Task Successfully Assigend", "success" )
reset()
onClose()
closeModal()
} catch ( error )
{
showToast("something wrong","error")

View File

@ -41,14 +41,7 @@ const ManageProjectInfo = ( {project,handleSubmitForm, onClose} ) =>
return num;
}),
} ) .refine((data) => {
const start = new Date(data.startDate);
const end = new Date(data.endDate);
return end > start;
}, {
path: ['endDate'], // attaches the error to the endDate field
message: 'End Date must be greater than Start Date',
});
} )
const {register, control, handleSubmit, formState: {errors}, reset, getValues} = useForm( {

View File

@ -76,33 +76,59 @@ const ProjectBanner = ( {project_data} ) =>
onClose={handleClose}
></ManageProjectInfo>
</div>
{/* Project Banner */}
{/* -------------------- */}
<div className="col-12">
<div className="card mb-6 pb-0">
<div className="d-flex align-items-center justify-content-between p-4 flex-wrap">
{/* Left: Icon + Name */}
<div className="d-flex align-items-center gap-3">
<div className="user-profile-header d-flex flex-column flex-lg-row text-sm-start text-center mb-2 ">
<div className="flex-shrink-0 mt-1 mx-sm-0 px-2 mx-auto">
<img
src="../../assets/icons/civil-engineering.svg"
alt="user image"
className="rounded-3"
style={{ width: "60px", height: "60px" }}
/>
<h4 className="mb-0">
{CurrentProject.name ? CurrentProject.name : "N/A"}
</h4>
className="d-block h-auto ms-0 ms-sm-6 rounded-3 user-profile-img project-banner-icon"
></img>
</div>
{manageProject && (
<button
<div className="flex-grow-1 mt-1 mt-lg-1">
<div className="d-flex align-items-md-end align-items-sm-start align-items-center justify-content-md-between justify-content-start mx-5 flex-md-row flex-column gap-4">
<div className="user-profile-info">
<h4 className="mb-2 mt-lg-1">
{CurrentProject.name ? CurrentProject.name : "N/A"}
</h4>
<h6 className="mb-1 mt-lg-1">
Address:{" "}
{CurrentProject.projectAddress ? CurrentProject.projectAddress : "N/A"}
</h6>
<h6 className="mb-1 mt-lg-1">
Contact:{" "}
{CurrentProject.contactPerson ? CurrentProject.contactPerson : "N/A"}
</h6>
<h6 className="mb-1 mt-lg-1">
<span>
{" "}
Start Date:{" "}
{CurrentProject.startDate
? moment(CurrentProject.startDate).format("DD-MMM-YYYY")
: "N/A"}
</span>
<span className="ms-5">
End Date:{" "}
{CurrentProject.endDate
? moment(CurrentProject.endDate).format("DD-MMM-YYYY")
: "N/A"}
</span>
</h6>
</div>
<button
type="button"
className={`btn btn-sm btn-primary ${!manageProject && 'd-none'}`}
data-bs-toggle="modal"
data-bs-target="#edit-project-modal"
onClick={handleShow}
>
Modify
</button>
)}
Modify
</button>
</div>
</div>
</div>
</div>
</div>

View File

@ -47,7 +47,7 @@ const ProjectNav = ( {onPillClick, activePill} ) =>
<i className="bx bx-grid-alt bx-sm me-1_5"></i> Infrastructure
</a>
</li>
{/* <li className="nav-item">
<li className="nav-item">
<a
className={`nav-link ${
activePill === "workplan" ? "active" : ""
@ -60,7 +60,7 @@ const ProjectNav = ( {onPillClick, activePill} ) =>
>
<i className="bx bx-link bx-sm me-1_5"></i> Work Plan
</a>
</li> */}
</li>
<li className="nav-item">
<a
className={`nav-link ${
@ -78,15 +78,15 @@ const ProjectNav = ( {onPillClick, activePill} ) =>
<li className="nav-item">
<a
className={`nav-link ${
activePill === "directory" ? "active" : ""
activePill === "activities" ? "active" : ""
}`}
href="#"
onClick={(e) => {
e.preventDefault(); // Prevent page reload
onPillClick("directory");
onPillClick("activities");
}}
>
<i className="bx bx-link bx-sm me-1_5"></i> Directory
<i className="bx bx-link bx-sm me-1_5"></i> Activities
</a>
</li>
</ul>

View File

@ -28,13 +28,17 @@
"text": "Project Status",
"available": true,
"link": "#"
},
{
"text": "Inventory",
"available": true,
"link": "/inventory"
}
]
},
{
"text": "Activities",
"icon": "bx bx-list-ul",
"icon": "bx bx-store",
"available": true,
"link": "",
"submenu": [
@ -71,7 +75,7 @@
]
},
{
"text": "Administration",
"text": "User Management",
"icon": "bx bx-box",
"available": true,
"link": "",
@ -87,12 +91,6 @@
"link": "/masters"
}
]
},
{
"text": "Inventory",
"icon": "bx bx-store",
"available": true,
"link": "/inventory"
}
]
},

View File

@ -35,9 +35,8 @@ const resetPasswordSchema = z
const ResetPasswordPage = () => {
const [searchParams] = useSearchParams();
const [ loading, setLoading ] = useState( false );
const [loading, setLoading] = useState(false);
const [hidepass, setHidepass] = useState(true);
const [hidepass1, setHidepass1] = useState(true);
const token = searchParams.get("token");
const navigate = useNavigate();
@ -145,7 +144,7 @@ const ResetPasswordPage = () => {
</div>
<div className=" input-group input-group-merge">
<input
type={hidepass1 ? "password" : "text"}
type={hidepass ? "password" : "text"}
autoComplete="true"
id="password"
className="form-control"
@ -156,9 +155,9 @@ const ResetPasswordPage = () => {
/>
<span
className="input-group-text cursor-pointer"
onClick={() => setHidepass1(!hidepass1)}
onClick={() => setHidepass(!hidepass)}
>
{hidepass1 ? (
{hidepass ? (
<i className="bx bx-hide"></i>
) : (
<i className="bx bx-show"></i>

View File

@ -85,19 +85,6 @@ const ProjectList = () =>
? Math.ceil(projectList.length / itemsPerPage)
: 0;
const statusMap = {
1: { label: 'active', priority: 1 },
2: { label: 'hold', priority: 2 },
3: { label: 'inactive', priority: 3 },
4: { label: 'complete', priority: 4 }
};
const sortedProjects = [...currentItems].sort((a, b) => {
const aPriority = statusMap[+a.projectStatusId]?.priority ?? 99;
const bPriority = statusMap[+b.projectStatusId]?.priority ?? 99;
return aPriority - bPriority;
});
return (
<>
@ -132,7 +119,7 @@ const ProjectList = () =>
{" "}
<button
type="button"
className={`btn btn-xs btn-primary ${!HasManageProject && 'd-none' }`}
className={`btn btn-sm btn-primary ${!HasManageProject && 'd-none' }`}
data-bs-toggle="modal"
data-bs-target="#create-project-model"
onClick={handleShow}
@ -164,10 +151,8 @@ const ProjectList = () =>
<div className="row">
{loading && <p className="text-center">Loading...</p>}
{currentItems &&
sortedProjects.map((item) => (
currentItems.sort((a, b) => b.id - a.id).map((item) => (
<ProjectCard projectData={item} key={item.id}></ProjectCard>
))}
</div>