From 946e0b2883b67de1c1953dd968f6827f65e18f4b Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 5 Dec 2025 13:07:27 +0530 Subject: [PATCH 1/5] Showing details view in Branches. --- .../ServiceProjectBranch/ServiceBranch.jsx | 117 +++++++++------ .../ViewBranchDetails.jsx | 142 ++++++++++++++++++ 2 files changed, 216 insertions(+), 43 deletions(-) create mode 100644 src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx diff --git a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx index 63bdb09c..61a4c011 100644 --- a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx +++ b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx @@ -8,6 +8,7 @@ import { useParams } from "react-router-dom"; import Pagination from "../../common/Pagination"; import ConfirmModal from "../../common/ConfirmModal"; import { SpinnerLoader } from "../../common/Loader"; +import ViewBranchDetails from "./ViewBranchDetails"; const ServiceBranch = () => { const { projectId } = useParams(); @@ -19,6 +20,7 @@ const ServiceBranch = () => { }); const { mutate: DeleteBranch, isPending } = useDeleteBranch(); const [deletingId, setDeletingId] = useState(null); + const [ViewRequest, setViewRequest] = useState({ requestId: null, view: false }); const [search, setSearch] = useState(""); const [currentPage, setCurrentPage] = useState(1); @@ -84,7 +86,7 @@ const ServiceBranch = () => {
- Branchs + Branches
@@ -171,37 +173,67 @@ const ServiceBranch = () => { !isError && data?.data?.length > 0 && data.data.map((branch) => ( - + { + if (!e.target.closest(".dropdown") && !e.target.closest(".bx-show")) { + setViewRequest({ branchId: branch.id, view: true }); + } + }} + > {columns.map((col) => ( {col.getValue(branch)} ))} -
- - +
@@ -277,6 +297,17 @@ const ServiceBranch = () => { /> )} + {ViewRequest.view && ( + setViewRequest({ branchId: null, view: false })} + > + + + + )} diff --git a/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx b/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx new file mode 100644 index 00000000..db67ea8b --- /dev/null +++ b/src/components/ServiceProject/ServiceProjectBranch/ViewBranchDetails.jsx @@ -0,0 +1,142 @@ +import React from "react"; +import { useBranchDetails } from "../../../hooks/useServiceProject"; +import Avatar from "../../common/Avatar"; +import { formatUTCToLocalTime } from "../../../utils/dateUtils"; + +const ViewBranchDetails = ({ BranchToEdit }) => { + const { data, isLoading, isError, error: requestError } = useBranchDetails(BranchToEdit); + + console.log("branch details:", data); + + if (isLoading) return

Loading...

; + if (isError) return

Error: {requestError?.message}

; + + return ( +
+
+
Branch Details
+
+
+
+
+ +
{data?.branchName || "N/A"}
+
+
+
+
+ +
{data?.branchName || "N/A"}
+
+
+
+
+ +
{data?.project?.name || "N/A"}
+
+
+ +
+
+ + <> + + + {`${data.updatedBy.firstName ?? ""} ${data.updatedBy.lastName ?? "" + }`.trim() || "N/A"} + + +
+
+
+
+ + + + {`${data?.createdBy?.firstName ?? ""} ${data?.createdBy?.lastName ?? "" + }`.trim() || "N/A"} + +
+
+
+
+ +
+ {data?.createdAt + ? formatUTCToLocalTime(data.createdAt, true) + : "N/A"} +
+
+
+
+ +
+ {data?.contactInformation ? ( + JSON.parse(data.contactInformation).map((contact, index) => ( +
+
Person {index + 1}:-
+
+ {contact.contactPerson || "N/A"} +
+
+ {contact.designation || "N/A"} +
+
+ {contact.contactEmails?.join(", ") || "N/A"} +
+
+ {contact.contactNumbers?.join(", ") || "N/A"} +
+
+ )) + ) : ( + "N/A" + )} +
+
+
+
+ ); +}; + +export default ViewBranchDetails; From 1e151a8b10487d69d63faccb4ac06eb581de32e6 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 5 Dec 2025 14:37:17 +0530 Subject: [PATCH 2/5] Adding Cursor pointer for view branch in jobs. --- .../ServiceProjectBranch/ServiceBranch.jsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx index 61a4c011..4e9c6d6c 100644 --- a/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx +++ b/src/components/ServiceProject/ServiceProjectBranch/ServiceBranch.jsx @@ -175,13 +175,14 @@ const ServiceBranch = () => { data.data.map((branch) => ( { - if (!e.target.closest(".dropdown") && !e.target.closest(".bx-show")) { + if (!showInactive && !e.target.closest(".dropdown") && !e.target.closest(".bx-show")) { setViewRequest({ branchId: branch.id, view: true }); } }} > + {columns.map((col) => ( {col.getValue(branch)} @@ -190,12 +191,12 @@ const ServiceBranch = () => {
{/* View Icon */} - setViewRequest({ branchId: branch.id, view: true }) } - > + > */}
+ {attendance.projectName} {" "} {moment(attendance.checkInTime).format("DD-MMM-YYYY")} From 95813c58694200e852b451eb4714f3606820670d Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 5 Dec 2025 11:52:28 +0530 Subject: [PATCH 4/5] Planned Work now accepts values with up to 2 decimal places. --- src/components/Project/Infrastructure/EditActivityModal.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Project/Infrastructure/EditActivityModal.jsx b/src/components/Project/Infrastructure/EditActivityModal.jsx index 14e66020..088f0556 100644 --- a/src/components/Project/Infrastructure/EditActivityModal.jsx +++ b/src/components/Project/Infrastructure/EditActivityModal.jsx @@ -17,7 +17,7 @@ const taskSchema = z .object({ activityID: z.string().min(1, "Activity is required"), workCategoryId: z.string().min(1, "Work Category is required"), - plannedWork: z.number().min(1, "Planned Work must be greater than 0"), + plannedWork: z.number().min(0.01, "Planned Work must be greater than 0"), completedWork: z.number().min(0, "Completed Work must be ≥ 0"), comment: z.string(), }) @@ -107,6 +107,7 @@ const EditActivityModal = ({ const onSubmitForm = (data) => { const payload = { ...data, + plannedWork: Number(data.plannedWork.toFixed(2)), id: workItem?.workItem?.id ?? workItem?.id, buildingID: building?.id, floorId: floor?.id, @@ -220,8 +221,10 @@ const EditActivityModal = ({ + {errors.plannedWork && (

{errors.plannedWork.message}

)} From 50e33b7b39f7eef999a5b8dafa30e7aad215a731 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 5 Dec 2025 10:46:58 +0530 Subject: [PATCH 5/5] Add Pending Actions toggle near search box in Expense. --- src/pages/Expense/ExpensePage.jsx | 45 ++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/pages/Expense/ExpensePage.jsx b/src/pages/Expense/ExpensePage.jsx index 05354733..0a9b1661 100644 --- a/src/pages/Expense/ExpensePage.jsx +++ b/src/pages/Expense/ExpensePage.jsx @@ -21,6 +21,7 @@ import { useFab } from "../../Context/FabContext"; import { useHasUserPermission } from "../../hooks/useHasUserPermission"; import { CREATE_EXEPENSE, + EXPENSE_STATUS, VIEW_ALL_EXPNESE, VIEW_SELF_EXPENSE, } from "../../utils/constants"; @@ -74,6 +75,30 @@ const ExpensePage = () => { const [filterData, setFilterdata] = useState(defaultFilter); const tableRef = useRef(null); const [filteredData, setFilteredData] = useState([]); + const [showStatus, setShowStatus] = useState(false); + + + useEffect(() => { + if (showStatus) { + // ON → show only draft + payment_processed + setFilters((prev) => ({ + ...prev, + statusIds: [ + EXPENSE_STATUS.daft, + EXPENSE_STATUS.payment_processed, + ], + })); + } else { + // OFF → show ALL (remove statusIds filter) + setFilters((prev) => { + const updated = { ...prev }; + delete updated.statusIds; + return updated; + }); + } + }, [showStatus]); + + const removeFilterChip = (key, id) => { setFilters((prev) => { const updated = { ...prev }; @@ -136,7 +161,9 @@ const ExpensePage = () => {
-
+
+ + {/* Search Input */} { value={searchText} onChange={(e) => setSearchText(e.target.value)} /> + + {/* Status Switch */} +
+ setShowStatus(e.target.checked)} + /> + +
+
+
{IsCreatedAble && (