Compare commits
14 Commits
376b517486
...
234006e25b
| Author | SHA1 | Date | |
|---|---|---|---|
| 234006e25b | |||
| 3e2d3049d9 | |||
| 2f5e91aa11 | |||
|
|
f4baa83b6d | ||
|
|
bcb273d663 | ||
|
|
b73a7fc5ab | ||
| 85cae0a786 | |||
| 8b8a518b12 | |||
| 47bbb38683 | |||
| 82e52e1937 | |||
|
|
7ebd8dcc00 | ||
|
|
ab1754aa49 | ||
| b526e64a65 | |||
| 89df1fd9c0 |
@ -100,7 +100,6 @@ const HorizontalBarChart = ({
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
fontSize: '8px', // Reduce text size
|
||||
},
|
||||
tooltip: {
|
||||
theme: "dark",
|
||||
|
||||
@ -36,29 +36,30 @@ 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-phone"></i>
|
||||
<span className="fw-medium mx-2">Contact Number:</span>{" "}
|
||||
<span>NA</span>
|
||||
</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 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">
|
||||
<i className="bx bx-envelope"></i>
|
||||
<span className="fw-medium mx-2">Email:</span> <span>NA</span>
|
||||
</li> */}
|
||||
<li className="d-flex align-items-start test-start mb-4">
|
||||
<span>{data.projectAddress}</span>
|
||||
</li>
|
||||
|
||||
@ -92,7 +92,7 @@ const onSubmit = async(data) => {
|
||||
let response = await TasksRepository.assignTask( formattedData );
|
||||
showToast( "Task Successfully Assigend", "success" )
|
||||
reset()
|
||||
closeModal()
|
||||
onClose()
|
||||
} catch ( error )
|
||||
{
|
||||
showToast("something wrong","error")
|
||||
|
||||
@ -41,7 +41,14 @@ 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( {
|
||||
|
||||
@ -76,59 +76,33 @@ const ProjectBanner = ( {project_data} ) =>
|
||||
onClose={handleClose}
|
||||
></ManageProjectInfo>
|
||||
</div>
|
||||
{/* -------------------- */}
|
||||
{/* Project Banner */}
|
||||
<div className="col-12">
|
||||
<div className="card mb-6 pb-0">
|
||||
<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">
|
||||
|
||||
<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">
|
||||
<img
|
||||
src="../../assets/icons/civil-engineering.svg"
|
||||
alt="user image"
|
||||
className="d-block h-auto ms-0 ms-sm-6 rounded-3 user-profile-img project-banner-icon"
|
||||
></img>
|
||||
className="rounded-3"
|
||||
style={{ width: "60px", height: "60px" }}
|
||||
/>
|
||||
<h4 className="mb-0">
|
||||
{CurrentProject.name ? CurrentProject.name : "N/A"}
|
||||
</h4>
|
||||
</div>
|
||||
<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
|
||||
{manageProject && (
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
Modify
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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 === "activities" ? "active" : ""
|
||||
activePill === "directory" ? "active" : ""
|
||||
}`}
|
||||
href="#"
|
||||
onClick={(e) => {
|
||||
e.preventDefault(); // Prevent page reload
|
||||
onPillClick("activities");
|
||||
onPillClick("directory");
|
||||
}}
|
||||
>
|
||||
<i className="bx bx-link bx-sm me-1_5"></i> Activities
|
||||
<i className="bx bx-link bx-sm me-1_5"></i> Directory
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -28,17 +28,13 @@
|
||||
"text": "Project Status",
|
||||
"available": true,
|
||||
"link": "#"
|
||||
},
|
||||
{
|
||||
"text": "Inventory",
|
||||
"available": true,
|
||||
"link": "/inventory"
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "Activities",
|
||||
"icon": "bx bx-store",
|
||||
"icon": "bx bx-list-ul",
|
||||
"available": true,
|
||||
"link": "",
|
||||
"submenu": [
|
||||
@ -75,7 +71,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "User Management",
|
||||
"text": "Administration",
|
||||
"icon": "bx bx-box",
|
||||
"available": true,
|
||||
"link": "",
|
||||
@ -91,6 +87,12 @@
|
||||
"link": "/masters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "Inventory",
|
||||
"icon": "bx bx-store",
|
||||
"available": true,
|
||||
"link": "/inventory"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -35,8 +35,9 @@ 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();
|
||||
@ -144,7 +145,7 @@ const ResetPasswordPage = () => {
|
||||
</div>
|
||||
<div className=" input-group input-group-merge">
|
||||
<input
|
||||
type={hidepass ? "password" : "text"}
|
||||
type={hidepass1 ? "password" : "text"}
|
||||
autoComplete="true"
|
||||
id="password"
|
||||
className="form-control"
|
||||
@ -155,9 +156,9 @@ const ResetPasswordPage = () => {
|
||||
/>
|
||||
<span
|
||||
className="input-group-text cursor-pointer"
|
||||
onClick={() => setHidepass(!hidepass)}
|
||||
onClick={() => setHidepass1(!hidepass1)}
|
||||
>
|
||||
{hidepass ? (
|
||||
{hidepass1 ? (
|
||||
<i className="bx bx-hide"></i>
|
||||
) : (
|
||||
<i className="bx bx-show"></i>
|
||||
|
||||
@ -85,7 +85,20 @@ 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 (
|
||||
<>
|
||||
<div
|
||||
@ -119,7 +132,7 @@ const ProjectList = () =>
|
||||
{" "}
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-sm btn-primary ${!HasManageProject && 'd-none' }`}
|
||||
className={`btn btn-xs btn-primary ${!HasManageProject && 'd-none' }`}
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#create-project-model"
|
||||
onClick={handleShow}
|
||||
@ -151,8 +164,10 @@ const ProjectList = () =>
|
||||
|
||||
<div className="row">
|
||||
{loading && <p className="text-center">Loading...</p>}
|
||||
|
||||
|
||||
{currentItems &&
|
||||
currentItems.sort((a, b) => b.id - a.id).map((item) => (
|
||||
sortedProjects.map((item) => (
|
||||
<ProjectCard projectData={item} key={item.id}></ProjectCard>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user