From 1e8c6e8007e0bd3f91f7772d9a2121ad9b393a61 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 7 Nov 2023 17:55:41 +0700 Subject: [PATCH 1/2] fix bug overdue & Summary --- src/views/Dashboard/DashboardCustomer.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/Dashboard/DashboardCustomer.js b/src/views/Dashboard/DashboardCustomer.js index eef2fd6..63ee536 100644 --- a/src/views/Dashboard/DashboardCustomer.js +++ b/src/views/Dashboard/DashboardCustomer.js @@ -101,8 +101,11 @@ const DashboardCustomer = () => { const getProjectDetail = async () => { setIsReadyProjectDetail(false); - const URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`; - const result = await axios.get(URL, HEADER).then(res => res).catch(err => err.response) + let URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`; + URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}/${GANTT_ID}/1` + const result = await axios.get(URL, HEADER) + .then(res => res) + .catch(err => err.response) console.log('getProjectDetail', result); if (!result) { NotificationManager.error(`Could not connect to internet.`, "Failed"); @@ -195,7 +198,9 @@ const DashboardCustomer = () => { const URL = `${BASE_OSPRO}/api/project/get-overdue-activities`; const payload = { "id": PROJECT_ID.toString(), - "till_date": moment(new Date()).format('YYYY-MM-DD') + "till_date": moment(new Date()).format('YYYY-MM-DD'), + 'gantt': GANTT_ID.toString(), + 'scurve': SCURVE ? SCURVE.toString() : null } const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response) console.log('getOverdueActivities', result); @@ -431,7 +436,7 @@ const DashboardCustomer = () => {
Project
-
{isReadyProjectDetail +
{isReadyProjectDetail ? projectName ? calculationStatus ? projectName + " - S-Curve Ready" From dbe80c5523e77e56035157a4face6855a79a1972 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Tue, 7 Nov 2023 17:57:04 +0700 Subject: [PATCH 2/2] update dashboard customer --- src/views/SimproV2/CreatedProyek/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index 9a08500..4245557 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -266,8 +266,8 @@ const CreatedProyek = ({ params, ...props }) => { } }; - const handleDashboard = async (text) => { - const URL = `${BASE_OSPRO}/api/project/detail/${text.id}`; + const handleDashboard = async (id) => { + const URL = `${BASE_OSPRO}/api/project/detail/${id}`; const result = await axios .get(URL, HEADER) .then((res) => res) @@ -285,7 +285,7 @@ const CreatedProyek = ({ params, ...props }) => { return; } else if (result.status == 200 && result.data.data) { history.push( - `dashboard-customer/${text.id}/${result.data.gantt}/1` + `/dashboard-customer/${id}/${result.data.gantt}/1` ); } }; @@ -596,6 +596,10 @@ const CreatedProyek = ({ params, ...props }) => { getProjectDetail(data.id); }; + const handleDashboardCustomer = async (data) => { + handleDashboard(data.id); + }; + const handleOpenReport = async (data) => { setOpenDialogRA(true); setProjectId(data.id); @@ -1615,7 +1619,7 @@ const CreatedProyek = ({ params, ...props }) => {