From 15e1f2bd0a6104e8d0611cf0c273c08d34e5dddc Mon Sep 17 00:00:00 2001 From: wahyun Date: Wed, 10 Jul 2024 16:28:52 +0700 Subject: [PATCH] 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} /> )}