From 4b6d1d46588ea4c2550cdd1cf340cafd8ea60135 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Sat, 10 May 2025 12:54:10 +0530 Subject: [PATCH] can't update completed is greather than zero --- .../Project/Infrastructure/WorkItem.jsx | 112 ++++++++++-------- 1 file changed, 62 insertions(+), 50 deletions(-) diff --git a/src/components/Project/Infrastructure/WorkItem.jsx b/src/components/Project/Infrastructure/WorkItem.jsx index 7a7dfb38..0b050068 100644 --- a/src/components/Project/Infrastructure/WorkItem.jsx +++ b/src/components/Project/Infrastructure/WorkItem.jsx @@ -119,6 +119,9 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => { showToast(message, "error"); } }; + + const PlannedWork = NewWorkItem?.workItem?.plannedWork || workItem?.plannedWork; + const CompletedWork = NewWorkItem?.workItem?.completedWork ?? workItem?.completedWork; return ( <> {isModalOpen && ( @@ -233,56 +236,65 @@ const WorkItem = ({ workItem, forBuilding, forFloor, forWorkArea }) => { > - -
- {!projectId && ManageTasks && ( - - )} - {ManageInfra && ( - <> - - - - )} -
- + +
+ {/* Reserve space for Assign button */} +
+ {(!projectId && ManageTasks) && (PlannedWork !== CompletedWork) ? ( + + ) : ( + // Hidden placeholder to preserve layout + + Assign + + )} +
+ + {/* Edit and Delete buttons */} + {ManageInfra && ( + <> + + + + )} +
+ + + + );