From d8f5804e0b9f5c0ef9a41f8f4d3fd2e4a734598e Mon Sep 17 00:00:00 2001 From: wahyu Date: Wed, 1 Nov 2023 07:53:16 +0700 Subject: [PATCH 1/2] update scurve --- src/views/Dashboard/DashboardProject.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js index dbce179..2ceba33 100644 --- a/src/views/Dashboard/DashboardProject.js +++ b/src/views/Dashboard/DashboardProject.js @@ -125,12 +125,11 @@ const DashboardProject = () => { const [dataGanttParents, setDataGanttParents] = useState({}); const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); const [calculationStatus, setCalculationStatus] = useState(false); - const [isHierarchy, setIsHierarchy] = useState(false); + const [isHierarchy, setIsHierarchy] = useState(null); let history = useHistory(); useEffect(() => { getProjectDetail(); - getSCurve(); getOverdueActivities(); getReportDistribution(); getComments(); @@ -141,6 +140,17 @@ const DashboardProject = () => { }; }, []); + useEffect(() => { + if (isHierarchy != null) { + getSCurve(); + } + window.addEventListener("message", handleIframeMessage); + + return () => { + window.removeEventListener("message", handleIframeMessage); + }; + }, [isHierarchy]); + useEffect(() => { if (activeTabIdx === 1) { initMap(); @@ -188,6 +198,8 @@ const DashboardProject = () => { setDataGantt(response); if (response.data.data.hierarchy_ftth_id) { setIsHierarchy(true); + } else { + setIsHierarchy(false); } setIsReadyGantt(true); } catch (error) { From 28bd0c38e026edc8e8245de3406c13d24ca83647 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 1 Nov 2023 08:49:13 +0700 Subject: [PATCH 2/2] add filter asc by name_version --- src/views/SimproV2/CreatedProyek/DialogGantt.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index 439f084..76bcb1d 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -92,7 +92,10 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName .catch((error) => error.response); if (result && result.status == 200) { - setDataGantt(result.data.data); + const sortedData = result.data.data.sort((a, b) => { + return a.name_version.toLowerCase().localeCompare(b.name_version.toLowerCase()); + }); + setDataGantt(sortedData); } else { NotificationManager.error(`Data gantt project gagal terload silahkan coba lagi!`, 'Failed!!'); }