Navigate to "Projects" Page Should Display Only Message When No Projects Are Assigned.

This commit is contained in:
Kartik sharma 2025-07-08 12:45:48 +05:30 committed by pramod mahajan
parent e26fafeba3
commit 25ff406b87

View File

@ -264,13 +264,18 @@ const ProjectList = () => {
)} )}
{listView ? ( {listView ? (
currentItems.length === 0 ? (
<div className="text-center text-muted mt-4">
No projects found.
</div>
) : (
<div className="card cursor-pointer"> <div className="card cursor-pointer">
<div className="card-body p-2"> <div className="card-body p-2">
<div className="table-responsive text-nowrap py-2 " style={{minHeight:"400px"}}> <div className="table-responsive text-nowrap py-2 ">
<table className="table m-3"> <table className="table m-3">
<thead> <thead>
<tr> <tr>
<th className="text-start" colSpan={5} > <th className="text-start" colSpan={5}>
Project Name Project Name
</th> </th>
<th className="mx-2 text-start">Contact Person</th> <th className="mx-2 text-start">Contact Person</th>
@ -293,10 +298,6 @@ const ProjectList = () => {
id: "b74da4c2-d07e-46f2-9919-e75e49b12731", id: "b74da4c2-d07e-46f2-9919-e75e49b12731",
label: "Active", label: "Active",
}, },
{
id: "cdad86aa-8a56-4ff4-b633-9c629057dfef",
label:"In Progress"
},
{ {
id: "603e994b-a27f-4e5d-a251-f3d69b0498ba", id: "603e994b-a27f-4e5d-a251-f3d69b0498ba",
label: "On Hold", label: "On Hold",
@ -313,14 +314,12 @@ const ProjectList = () => {
<li key={id}> <li key={id}>
<div className="form-check"> <div className="form-check">
<input <input
className="form-check-input " className="form-check-input"
type="checkbox" type="checkbox"
checked={selectedStatuses.includes(id)} checked={selectedStatuses.includes(id)}
onChange={() => handleStatusChange(id)} onChange={() => handleStatusChange(id)}
/> />
<label className="form-check-label"> <label className="form-check-label">{label}</label>
{label}
</label>
</div> </div>
</li> </li>
))} ))}
@ -328,35 +327,27 @@ const ProjectList = () => {
</div> </div>
</th> </th>
<th <th
className={`mx-2 ${ className={`mx-2 ${HasManageProject ? "d-sm-table-cell" : "d-none"
HasManageProject ? "d-sm-table-cell" : "d-none"
}`} }`}
> >
Action Action
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody className="table-border-bottom-0 overflow-auto "> <tbody className="table-border-bottom-0 overflow-auto">
{currentItems.length === 0 ? ( {currentItems.map((project) => (
<tr className="text-center">
<td colSpan="12" rowSpan='12'style={{height:"200px"}} >
No projects found
</td>
</tr>
) : (
currentItems.map((project) => (
<ProjectListView <ProjectListView
key={project.id} key={project.id}
projectData={project} projectData={project}
recall={sortingProject} recall={sortingProject}
/> />
)) ))}
)}
</tbody> </tbody>
</table> </table>
</div>{" "}
</div>{" "}
</div> </div>
</div>
</div>
)
) : ( ) : (
<div className="row"> <div className="row">
{currentItems.map((project) => ( {currentItems.map((project) => (
@ -369,6 +360,7 @@ const ProjectList = () => {
</div> </div>
)} )}
{!loading && totalPages > 1 && ( {!loading && totalPages > 1 && (
<nav> <nav>
<ul className="pagination pagination-sm justify-content-end py-2"> <ul className="pagination pagination-sm justify-content-end py-2">