"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 [loading, setLoading] = useState(false);
const navigate = useNavigate();
const [todayDate, setTodayDate] = useState(new Date());
// Ensure attendance is an array
const attendanceList = Array.isArray(attendance) ? attendance : [];
@ -41,6 +42,13 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<>
<table className="table ">
<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>
<th className="border-top-0" colSpan={2}>
Name
@ -126,8 +134,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
<nav aria-label="Page ">
<ul className="pagination pagination-sm justify-content-end py-1">
<li
className={`page-item ${
currentPage === 1 ? "disabled" : ""
className={`page-item ${currentPage === 1 ? "disabled" : ""
}`}
>
<button
@ -140,8 +147,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
{[...Array(totalPages)].map((_, index) => (
<li
key={index}
className={`page-item ${
currentPage === index + 1 ? "active" : ""
className={`page-item ${currentPage === index + 1 ? "active" : ""
}`}
>
<button
@ -153,8 +159,7 @@ const Attendance = ({ attendance, getRole, handleModalData }) => {
</li>
))}
<li
className={`page-item ${
currentPage === totalPages ? "disabled" : ""
className={`page-item ${currentPage === totalPages ? "disabled" : ""
}`}
>
<button

View File

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

View File

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

View File

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

View File

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