From f6cbc3acc93bf6783f9e6db578445a20182215e6 Mon Sep 17 00:00:00 2001 From: "kartik.sharma" Date: Sat, 17 May 2025 16:10:11 +0530 Subject: [PATCH] Info-icon add --- src/components/Project/AssignRole.jsx | 169 ++++++++++++-------------- 1 file changed, 78 insertions(+), 91 deletions(-) diff --git a/src/components/Project/AssignRole.jsx b/src/components/Project/AssignRole.jsx index b502829f..da970231 100644 --- a/src/components/Project/AssignRole.jsx +++ b/src/components/Project/AssignRole.jsx @@ -41,40 +41,29 @@ const AssignRoleModel = ({ assignData, onClose }) => { const [isHelpVisible, setIsHelpVisible] = useState(false); - const handleHelpClickTarget = () => { - setIsHelpVisibleTarget(!isHelpVisibleTarget); - }; - - const [isHelpVisiblePending, setIsHelpVisiblePending] = useState(false); - const helpPopupRefPending = useRef(null); - - const handleHelpClickPending = () => { - setIsHelpVisiblePending(!isHelpVisiblePending); - }; - - const handleClickOutside = (event) => { - if ( - helpPopupRefTarget.current && - !helpPopupRefTarget.current.contains(event.target) && - isHelpVisibleTarget - ) { - setIsHelpVisibleTarget(false); - } - if ( - helpPopupRefPending.current && - !helpPopupRefPending.current.contains(event.target) && - isHelpVisiblePending - ) { - setIsHelpVisiblePending(false); - } - }; + const infoRef = useRef(null); + const infoRef1 = useRef(null); useEffect(() => { - document.addEventListener("mousedown", handleClickOutside); - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, [isHelpVisibleTarget, isHelpVisiblePending]); + + if (infoRef.current) { + new bootstrap.Popover(infoRef.current, { + trigger: 'focus', + placement: 'right', + html: true, + content: `
Pending Task assign for today
`, + }); + } + + if (infoRef1.current) { + new bootstrap.Popover(infoRef1.current, { + trigger: 'focus', + placement: 'right', + html: true, + content: `
Target task for today
`, + }); + } + }, []); const [plannedTask, setPlannedTask] = useState(); @@ -387,57 +376,45 @@ const AssignRoleModel = ({ assignData, onClose }) => {
-
- {isHelpVisiblePending && ( -
-

- Pending Task -

-
- )} - - + +
@@ -464,25 +440,36 @@ const AssignRoleModel = ({ assignData, onClose }) => { {assignData?.workItem?.workItem?.activityMaster?.unitOfMeasurement} - - +
- - - - +   + + + + +
+
)} /> + {errors.plannedTask && (