From 15e1f2bd0a6104e8d0611cf0c273c08d34e5dddc Mon Sep 17 00:00:00 2001 From: wahyun Date: Wed, 10 Jul 2024 16:28:52 +0700 Subject: [PATCH 1/4] feat: add gantt name in header gantt chart --- src/views/SimproV2/CreatedProyek/DialogGantt.js | 5 +++-- src/views/SimproV2/CreatedProyek/index.js | 3 ++- src/views/SimproV2/Gantt/GanttFrame.js | 8 ++++---- src/views/SimproV2/Gantt/index.js | 4 +++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/DialogGantt.js b/src/views/SimproV2/CreatedProyek/DialogGantt.js index 8060f93..d7ae691 100644 --- a/src/views/SimproV2/CreatedProyek/DialogGantt.js +++ b/src/views/SimproV2/CreatedProyek/DialogGantt.js @@ -135,7 +135,8 @@ const DialogGantt = ({ openDialog, closeDialog, role_name, toggleDialog, idTask, company_id: companyId, dataViewStartDate, companyName, - role_name + role_name, + ganttName : text.name_version } }}> @@ -149,7 +150,7 @@ const DialogGantt = ({ openDialog, closeDialog, role_name, toggleDialog, idTask, , }, - { title: 'Nama', dataIndex: 'name_version', key: 'name_version' }, + { title: 'Nama', dataIndex: 'name_version', key: 'name_version'}, { title: 'Tipe kalkulasi', dataIndex: 'calculation_type', key: 'calculation_type' }, { title: 'Deskripsi', dataIndex: 'description', key: 'description' }, { title: 'Tanggal dibuat', dataIndex: 'created_at', key: 'created_at', render: (text, record) => (
{text ? moment(text).format("D-M-YYYY") : "-"}
) }, diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index fbd297d..c0c8204 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -1718,7 +1718,8 @@ const CreatedProyek = ({ params, ...props }) => { role_name, company_id: text.company_id, dataViewStartDate, - companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name) + companyName: (role_name === 'Super Admin' ? text.join_third_company_name : JSON.parse(configApp).company_name), + ganttName : res.name_version } }}>
diff --git a/src/views/SimproV2/Gantt/GanttFrame.js b/src/views/SimproV2/Gantt/GanttFrame.js index decf9d0..be06e2f 100644 --- a/src/views/SimproV2/Gantt/GanttFrame.js +++ b/src/views/SimproV2/Gantt/GanttFrame.js @@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react'; import { useHistory, withRouter } from 'react-router-dom'; import { BASE_SIMPRO_LUMEN } from '../../../const/ApiConst'; -const GanttFrame = React.memo(({ versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, companyId, role_name, company_name }) => { +const GanttFrame = React.memo(({ versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, companyId, role_name, company_name, ganttName }) => { const history = useHistory(); - const { versionGanttId, idProject, ro, timestamp, dataViewStartDate, token, companyId, role_name, company_name } = props; - const iframeSrc = `https://si-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}×tamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}`; - // const iframeSrc = `http://localhost:8444/generic-ospro-gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}×tamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}`; + + const iframeSrc = `https://si-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}×tamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}&gantt_name=${ganttName}`; + // const iframeSrc = `http://localhost:8444/surveyor_indonesia_gantt/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}×tamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}&gantt_name=${ganttName}`; const [batchEntityData, setBatchEntityData] = useState(null); useEffect(() => { diff --git a/src/views/SimproV2/Gantt/index.js b/src/views/SimproV2/Gantt/index.js index e2483f7..5a2d04c 100644 --- a/src/views/SimproV2/Gantt/index.js +++ b/src/views/SimproV2/Gantt/index.js @@ -12,12 +12,13 @@ const Gantt = (props) => { const location = useLocation(); const { company_id, dataViewStartDate, companyName, role_name } = location.state || {}; - let role_id = '', userId = '', isLogin = '', token = ''; + let role_id = '', userId = '', isLogin = '', token = '', ganttName = ''; if (props.location.state && props.location.state.role_id && props.location.state.user_id) { role_id = props.location.state.role_id; userId = props.location.state.user_id; token = props.location.state.token; isLogin = props.location.state.isLogin; + ganttName = props.location.state.ganttName; } else { role_id = localStorage.getItem("role_id"); userId = localStorage.getItem("user_id"); @@ -116,6 +117,7 @@ const Gantt = (props) => { timestamp={timestamp} dataViewStartDate={dataViewStartDate} company_name={companyName} + ganttName={ganttName} /> )}
-- 2.25.1 From 958e0d4b1dcff9487c081ac672fb179dc84bbb7f Mon Sep 17 00:00:00 2001 From: wahyun Date: Wed, 10 Jul 2024 16:29:22 +0700 Subject: [PATCH 2/4] fix: update name header chart --- src/views/Dashboard/DashboardBOD.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Dashboard/DashboardBOD.js b/src/views/Dashboard/DashboardBOD.js index b7a8687..822de60 100644 --- a/src/views/Dashboard/DashboardBOD.js +++ b/src/views/Dashboard/DashboardBOD.js @@ -925,8 +925,8 @@ const DashboardBOD = (props) => { setHealthPerDivisionMode(mode)} chartType="vertical-bar" -- 2.25.1 From 74d8250013a4151e3ded1547f14c5821557f855e Mon Sep 17 00:00:00 2001 From: wahyun Date: Wed, 10 Jul 2024 16:29:55 +0700 Subject: [PATCH 3/4] feat: automate adding duration --- src/views/SimproV2/CreatedProyek/DialogFormProyek.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js index 6cddc65..f475c47 100644 --- a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js +++ b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js @@ -389,10 +389,18 @@ const DialogFormProyek = ({ const handleDatePickerStart = (date, dateString) => { setStartDate(date); + if (endDate) { + const duration = moment(endDate).diff(moment(date), 'days'); + setProjectDuration(duration); + } }; const handleDatePickerEnd = (date, dateString) => { setEndDate(date); + if (startDate) { + const duration = moment(date).diff(moment(startDate), 'days'); + setProjectDuration(duration); + } }; const nextStep = () => { -- 2.25.1 From 74cd6f449a0fcdc9ce1c1a699013dd5be3d0d6ad Mon Sep 17 00:00:00 2001 From: wahyun Date: Wed, 10 Jul 2024 16:30:25 +0700 Subject: [PATCH 4/4] fix: update default status schedule health --- src/views/Dashboard/DashboardProject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js index 19dc791..a843992 100644 --- a/src/views/Dashboard/DashboardProject.js +++ b/src/views/Dashboard/DashboardProject.js @@ -385,7 +385,7 @@ const DashboardProject = (props) => { let selisihProgress = 0; let planningProgress = 0; let actualProgress = 0; - let statusHealthBySchedule = "on-schedule"; + let statusHealthBySchedule = "behind-schedule"; if ( result.data.data.length > 0 && result.data.data[0].data?.budget_control @@ -438,7 +438,7 @@ const DashboardProject = (props) => { selisihProgress = planningProgress - actualProgress; if (selisihProgress > 0 && selisihProgress <= 20) { statusHealthBySchedule = "warning"; - } else if (selisihProgress > 5) { + } else if (selisihProgress == 0 || selisihProgress < 0) { statusHealthBySchedule = "behind-schedule"; } setHealthBySchedule(statusHealthBySchedule); -- 2.25.1