"In the Manage Building popup (accessed from Project > Project List, by selecting a project and navigating to Infrastructure), the error message is now correctly displayed as 'Building name is required'. A previous issue caused the message 'Expected s… #115

Merged
admin merged 2 commits from Kartik_bug#278 into Issue_May_3W 2025-05-17 10:58:14 +00:00
5 changed files with 33 additions and 34 deletions

View File

@ -9,6 +9,7 @@ import { useNavigate } from "react-router-dom";
const Attendance = ({ attendance, getRole, handleModalData }) => { const Attendance = ({ attendance, getRole, handleModalData }) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const navigate = useNavigate(); const navigate = useNavigate();
const [todayDate, setTodayDate] = useState(new Date());
// Ensure attendance is an array // Ensure attendance is an array
const attendanceList = Array.isArray(attendance) ? attendance : []; const attendanceList = Array.isArray(attendance) ? attendance : [];
@ -41,6 +42,13 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<> <>
<table className="table "> <table className="table ">
<thead> <thead>
<tr className="border-top-0" style={{ textAlign: 'left' }}>
<td >
<strong>Date : {todayDate.toLocaleDateString('en-GB')}</strong>
</td>
<td style={{ paddingLeft: '20px' }}>
</td>
</tr>
<tr> <tr>
<th className="border-top-0" colSpan={2}> <th className="border-top-0" colSpan={2}>
Name Name
@ -126,9 +134,8 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<nav aria-label="Page "> <nav aria-label="Page ">
<ul className="pagination pagination-sm justify-content-end py-1"> <ul className="pagination pagination-sm justify-content-end py-1">
<li <li
className={`page-item ${ className={`page-item ${currentPage === 1 ? "disabled" : ""
currentPage === 1 ? "disabled" : "" }`}
}`}
> >
<button <button
className="page-link btn-xs" className="page-link btn-xs"
@ -140,9 +147,8 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
{[...Array(totalPages)].map((_, index) => ( {[...Array(totalPages)].map((_, index) => (
<li <li
key={index} key={index}
className={`page-item ${ className={`page-item ${currentPage === index + 1 ? "active" : ""
currentPage === index + 1 ? "active" : "" }`}
}`}
> >
<button <button
className="page-link " className="page-link "
@ -153,9 +159,8 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
</li> </li>
))} ))}
<li <li
className={`page-item ${ className={`page-item ${currentPage === totalPages ? "disabled" : ""
currentPage === totalPages ? "disabled" : "" }`}
}`}
> >
<button <button
className="page-link " className="page-link "

View File

@ -12,7 +12,7 @@ const AboutProject = ({ data }) => {
<small className="card-text text-uppercase text-muted small"> <small className="card-text text-uppercase text-muted small">
Profile Profile
</small> </small>
<ul className="list-unstyled my-3 py-1"> <ul className="list-unstyled my-3">
<li className="d-flex align-items-center mb-4"> <li className="d-flex align-items-center mb-4">
<i className="bx bx-check"></i> <i className="bx bx-check"></i>
<span className="fw-medium mx-2">Start Date:</span>{" "} <span className="fw-medium mx-2">Start Date:</span>{" "}
@ -41,27 +41,17 @@ const AboutProject = ({ data }) => {
<span className="fw-medium mx-2">Contact:</span>{" "} <span className="fw-medium mx-2">Contact:</span>{" "}
<span>{data.contactPerson}</span> <span>{data.contactPerson}</span>
</li> </li>
<li className="d-flex align-items-center mb-4"> <li className="d-flex flex-column align-items-start mb-4">
<i className="bx bx-flag"></i> <div className="d-flex align-items-center">
<span className="fw-medium mx-2">Address:</span>{" "} <i className="bx bx-flag"></i>
</li> <span className="fw-medium mx-2">Address:</span>
</ul> {data.projectAddress?.length <= 20 && (
{/* <small className="card-text text-uppercase text-muted small"> <span>{data.projectAddress}</span>
Contacts )}
</small> */} </div>
<ul className="list-unstyled my-3 py-1"> {data.projectAddress?.length > 20 && (
<div className="ms-4 text-start">{data.projectAddress}</div>
{/* <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> </li>
</ul> </ul>
</div> </div>

View File

@ -47,7 +47,7 @@ const BuildingModel = ({
} }
return () => { return () => {
setValue("name", null); setValue("name", "");
}; };
}, [clearTrigger, onClearComplete, editingBuilding, project?.id]); }, [clearTrigger, onClearComplete, editingBuilding, project?.id]);
@ -199,3 +199,5 @@ const BuildingModel = ({
}; };
export default BuildingModel; export default BuildingModel;

View File

@ -31,7 +31,7 @@ const InfraTable = ({ buildings }) => {
{ {
building: null, building: null,
floor: { floor: {
id: data.id || "0", id: data.id || null,
floorName: data.floorName, floorName: data.floorName,
buildingId: data.buildingId, buildingId: data.buildingId,
}, },

View File

@ -161,6 +161,7 @@ const AttendancePage = () => {
)} )}
</div> </div>
</ul> </ul>
<ul className="nav nav-tabs" role="tablist"> <ul className="nav nav-tabs" role="tablist">
<li className="nav-item"> <li className="nav-item">
<button <button
@ -170,7 +171,7 @@ const AttendancePage = () => {
data-bs-toggle="tab" data-bs-toggle="tab"
data-bs-target="#navs-top-home" data-bs-target="#navs-top-home"
> >
All Today's
</button> </button>
</li> </li>
<li className="nav-item"> <li className="nav-item">
@ -216,6 +217,7 @@ const AttendancePage = () => {
</div> </div>
</> </>
)} )}
{activeTab === "logs" && ( {activeTab === "logs" && (
<div className="tab-pane fade show active py-0"> <div className="tab-pane fade show active py-0">