diff --git a/FRONTEND/src/pages/Allocation/Allocation.tsx b/FRONTEND/src/pages/Allocation/Allocation.tsx index 2e2cf0e..ff83224 100644 --- a/FRONTEND/src/pages/Allocation/Allocation.tsx +++ b/FRONTEND/src/pages/Allocation/Allocation.tsx @@ -80,6 +80,31 @@ const Allocation = () => { const [opened, setOpened] = useState(false) const [issDetail, setIssDetail] = useState('') const [data, setData] = useState({}) + + useEffect(() => { + // Check if iframe already exists + const existingIframe = document.querySelector('#drawio iframe') + if (existingIframe) return + + // Add iframe only if it doesn't exist + const iframe = document.createElement('iframe') + iframe.src = import.meta.env.VITE_URL_DRAWIO + iframe.style.width = '100%' + iframe.style.height = '500px' + const drawioDiv = document.getElementById('drawio') + if (drawioDiv) { + drawioDiv.appendChild(iframe) + } + + // Cleanup function to remove iframe when component unmounts + return () => { + const iframe = document.querySelector('#drawio iframe') + if (iframe) { + iframe.remove() + } + } + }, []) + const getAll = async () => { try { const res = await get(getAllUserDoing) @@ -117,6 +142,7 @@ const Allocation = () => { }, []) return (
+
{ }} > - + {/* Admin/ Personnel Allocation - + */} "P:" is the timspent/timeestimate number within the project itself @@ -224,27 +250,38 @@ const Allocation = () => { alignItems: 'center', }} > - - - iss.fields.status.name === 'In Progress' && - ((Date.now() - (new Date(iss.changelog?.histories[0]?.created)).getTime()) > 172800000) - ).length > 0 ? 'block' :'none'} - /> + + + iss.fields.status.name === + 'In Progress' && + Date.now() - + new Date( + iss.changelog?.histories[0]?.created, + ).getTime() > + 172800000, + ).length > 0 + ? 'block' + : 'none' + } + /> - - - {user} - + + + {user} + { }} ml={'md'} p="0 20px" - > - {`P: `} + {`P: `} {`${ userData.p_total_spent / 60 / 60 }h/`}