diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index 7fb98d7..3fc9550 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -13,7 +13,7 @@ import DialogUserGantt from './DialogUserGantt'; import { Link } from 'react-router-dom'; -const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName }) => { +const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName, openDialogHierarchy }) => { const token = localStorage.getItem("token") const HEADER = { headers: { @@ -31,10 +31,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName const [humanResource, setHumanResource] = useState([]) useEffect(() => { - if (idTask > 0) { - getdataGantt(); - } - if (hierarchyId > 0) { + if (hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) { getdataGantt(); } }, [hierarchyId, idTask, openDialog]) diff --git a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js index d62ce53..7c1f99a 100644 --- a/src/views/SimproV2/CreatedProyek/DialogHierarchy.js +++ b/src/views/SimproV2/CreatedProyek/DialogHierarchy.js @@ -311,6 +311,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek hierarchyId={parentId} hierarchyName={parentName} idTask={idTask} + openDialogHierarchy={openDialog} /> { + const { versionGanttId, idProject, token, ro, timestamp } = props; + const iframeSrc = `https://adw-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}×tamp=${timestamp}`; + + return ( + + ); +}); + +export default GanttFrame; diff --git a/src/views/SimproV2/Gantt/index.js b/src/views/SimproV2/Gantt/index.js index 466bb6d..c491af4 100644 --- a/src/views/SimproV2/Gantt/index.js +++ b/src/views/SimproV2/Gantt/index.js @@ -6,7 +6,7 @@ import axios from "../../../const/interceptorApi" import { Fab, Action } from 'react-tiny-fab'; import 'react-tiny-fab/dist/styles.css'; import { useHistory } from "react-router-dom"; - +import GanttFrame from './GanttFrame'; const token = localStorage.getItem("token") const userId = parseInt(localStorage.getItem("user_id")); const HEADER = { @@ -82,24 +82,19 @@ const Gantt = (props) => { } roCount = roCount + 1; } - const RenderGantt = () => ( - - ) return ( <>
- {ready && } + {ready && ( + + )}
);