From fe2a4c344dc52d49aff241a5ae4093345abe0193 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Tue, 4 Jul 2023 16:44:44 +0700 Subject: [PATCH] Fix s curve --- src/views/Dashboard/DashboardProject.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js index 3d1807c..726f68d 100644 --- a/src/views/Dashboard/DashboardProject.js +++ b/src/views/Dashboard/DashboardProject.js @@ -88,6 +88,7 @@ const DashboardProject = () => { const [dataGantt, setDataGantt] = useState({}); const [dataGanttParents, setDataGanttParents] = useState({}); const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); + const [calculationStatus, setCalculationStatus] = useState(false); let history = useHistory(); @@ -239,6 +240,7 @@ const DashboardProject = () => { setEstimatedFinish(result.data.data.header?.end_date ? result.data.data.header.end_date : null) setPlannedCost(result.data.data.rencana_biaya ? result.data.data.rencana_biaya : null) setIsReadyProjectDetail(true); + setCalculationStatus(result.data.data.calculation_status ? result.data.data.calculation_status : false) if (result.data.data.kode_sortname && result.data.data.kode_sortname !== '') { getIntegrationInvoice(result.data.data.kode_sortname) @@ -250,7 +252,7 @@ const DashboardProject = () => { setIsReadySCurve(false); let URL = `${BASE_OSPRO}/api/project/get-s-curve`; if(SCURVE && SCURVE == "1"){ - URL = `${BASE_OSPRO}/api/project/get-linear-s-curve`; + URL = `${BASE_OSPRO}/api/project/calculate-s-curve`; } const payload = { @@ -608,7 +610,12 @@ const DashboardProject = () => { parentNames += " - "; parentNames += dataGanttParents.data.data[i].name; } - return SCURVE && SCURVE == "1" ? projectName + return SCURVE && SCURVE == "1" + ? projectName + ? calculationStatus + ? projectName + " - S-Curve Ready" + : projectName + " - S-Curve Loading" + : null : projectName + parentNames + " - " + dataGantt.data.data.name_version; })() : } @@ -802,13 +809,13 @@ const DashboardProject = () => {
Progress
{isReadySCurve ? - + 100 ? 100 : planningProgress} /> : }
{isReadySCurve ? - + 100 ? parseFloat(actualProgress / planningProgress * 100).toFixed(2) : actualProgress} /> : }