diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css index 3b5619a2..b05f71c1 100644 --- a/public/assets/css/core-extend.css +++ b/public/assets/css/core-extend.css @@ -456,8 +456,3 @@ font-weight: normal; .fs-md-xlarge { font-size: 170% !important; } .fs-md-xxlarge { font-size: calc(1.725rem + 5.7vw) !important; } } - -.me-16 { - /* margin-inline-end: -7.0625rem !important; */ - margin-left: -7.0625rem !important; -} diff --git a/src/components/Dashboard/ProjectCompletionChart.jsx b/src/components/Dashboard/ProjectCompletionChart.jsx index 7cc4a092..5bc9dde0 100644 --- a/src/components/Dashboard/ProjectCompletionChart.jsx +++ b/src/components/Dashboard/ProjectCompletionChart.jsx @@ -6,11 +6,9 @@ import { ITEMS_PER_PAGE } from "../../utils/constants"; const ProjectCompletionChart = () => { const [currentPage, setCurrentPage] = useState(1); - const { data: projects, isLoading: loading, isError, error } = useProjects(currentPage, ITEMS_PER_PAGE); - - console.log("Kartik", projects) + const { data: projects, isLoading: loading, isError, error } = useProjects(ITEMS_PER_PAGE,currentPage); // Bar chart logic - const projectNames = projects?.map((p) => p.name) || []; + const projectNames = projects?.data.map((p) => p.name) || []; const projectProgress = projects?.map((p) => { const completed = p.completedWork || 0; diff --git a/src/components/ServiceProject/ManageJobTicket.jsx b/src/components/ServiceProject/ManageJobTicket.jsx index 823fe583..6d1aa861 100644 --- a/src/components/ServiceProject/ManageJobTicket.jsx +++ b/src/components/ServiceProject/ManageJobTicket.jsx @@ -45,57 +45,56 @@ const ManageJobTicket = ({ Job }) => { return (
-
- {/* Job Id on left */} +
{data?.title}
+

Job Id : {data?.jobTicketUId || "N/A"}

- - {/* Edit icon on right */} - -
- -
-
- {data?.status?.name} - - } - > - - -
- {data?.dueDate && - (() => { - const { days, color } = daysLeft(data?.startDate, data?.dueDate); - return ( - - Days Left : - - {days !== null ? `${days} days` : "N/A"} +
+ {data?.dueDate && + (() => { + const { days, color } = daysLeft( + data?.startDate, + data?.dueDate + ); + return ( + + Days Left: + + {days !== null ? `${days} days` : "N/A"} + - - ); - })()} + ); + })()} +
+ + {data?.status?.name} + + + } + > + + +
+
-
{data?.title}
+ +
-

- Description : - {data?.description || "N/A"} -

+

{data?.description || "N/A"}

@@ -135,21 +134,26 @@ const ManageJobTicket = ({ Job }) => {
-
+
Assigned By -
+
{data?.assignees?.map((emp) => ( -
- -
-

{`${emp.firstName} ${emp.lastName}`}

- - ({emp.jobRoleName}) - +
+
+ + +
+ + {emp.firstName} {emp.lastName} + + + {emp.jobRoleName} + +
))} diff --git a/src/components/common/HoverPopup.jsx b/src/components/common/HoverPopup.jsx index 5fd15703..e1c2dd4d 100644 --- a/src/components/common/HoverPopup.jsx +++ b/src/components/common/HoverPopup.jsx @@ -11,7 +11,7 @@ const HoverPopup = ({ title, content, children, - className, + className = "", Mode = "hover", }) => { const dispatch = useDispatch(); @@ -46,11 +46,33 @@ const HoverPopup = ({ dispatch(closePopup(id)); } }; - document.addEventListener("click", handleOutside); return () => document.removeEventListener("click", handleOutside); }, [visible, Mode, id]); + useEffect(() => { + if (!visible || !popupRef.current) return; + + const popup = popupRef.current; + const rect = popup.getBoundingClientRect(); + + popup.style.left = "50%"; + popup.style.right = "auto"; + popup.style.transform = "translateX(-50%)"; + + if (rect.right > window.innerWidth) { + popup.style.left = "auto"; + popup.style.right = "0"; + popup.style.transform = "none"; + } + + if (rect.left < 0) { + popup.style.left = "0"; + popup.style.right = "auto"; + popup.style.transform = "none"; + } + }, [visible]); + return (
e.stopPropagation()} > {title &&
{title}
}