Browse Source

feat: add gantt name in header gantt chart

pull/5/head
wahyun 4 months ago
parent
commit
15e1f2bd0a
  1. 5
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  2. 3
      src/views/SimproV2/CreatedProyek/index.js
  3. 8
      src/views/SimproV2/Gantt/GanttFrame.js
  4. 4
      src/views/SimproV2/Gantt/index.js

5
src/views/SimproV2/CreatedProyek/DialogGantt.js

@ -135,7 +135,8 @@ const DialogGantt = ({ openDialog, closeDialog, role_name, toggleDialog, idTask,
company_id: companyId, company_id: companyId,
dataViewStartDate, dataViewStartDate,
companyName, companyName,
role_name role_name,
ganttName : text.name_version
} }
}}> }}>
<Tooltip title="Gantt"> <Tooltip title="Gantt">
@ -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: 'Tipe kalkulasi', dataIndex: 'calculation_type', key: 'calculation_type' },
{ title: 'Deskripsi', dataIndex: 'description', key: 'description' }, { title: 'Deskripsi', dataIndex: 'description', key: 'description' },
{ title: 'Tanggal dibuat', dataIndex: 'created_at', key: 'created_at', render: (text, record) => (<div style={{ whiteSpace: "nowrap" }}>{text ? moment(text).format("D-M-YYYY") : "-"}</div>) }, { title: 'Tanggal dibuat', dataIndex: 'created_at', key: 'created_at', render: (text, record) => (<div style={{ whiteSpace: "nowrap" }}>{text ? moment(text).format("D-M-YYYY") : "-"}</div>) },

3
src/views/SimproV2/CreatedProyek/index.js

@ -1718,7 +1718,8 @@ const CreatedProyek = ({ params, ...props }) => {
role_name, role_name,
company_id: text.company_id, company_id: text.company_id,
dataViewStartDate, 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
} }
}}> }}>
<div className="menu-list"> <div className="menu-list">

8
src/views/SimproV2/Gantt/GanttFrame.js

@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react';
import { useHistory, withRouter } from 'react-router-dom'; import { useHistory, withRouter } from 'react-router-dom';
import { BASE_SIMPRO_LUMEN } from '../../../const/ApiConst'; 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 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}&timestamp=${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}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}&gantt_name=${ganttName}`;
// 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}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}`; // 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}&timestamp=${timestamp}&start=${dataViewStartDate}&role_name=${role_name}&company_id=${companyId}&company_name=${company_name}&gantt_name=${ganttName}`;
const [batchEntityData, setBatchEntityData] = useState(null); const [batchEntityData, setBatchEntityData] = useState(null);
useEffect(() => { useEffect(() => {

4
src/views/SimproV2/Gantt/index.js

@ -12,12 +12,13 @@ const Gantt = (props) => {
const location = useLocation(); const location = useLocation();
const { company_id, dataViewStartDate, companyName, role_name } = location.state || {}; 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) { if (props.location.state && props.location.state.role_id && props.location.state.user_id) {
role_id = props.location.state.role_id; role_id = props.location.state.role_id;
userId = props.location.state.user_id; userId = props.location.state.user_id;
token = props.location.state.token; token = props.location.state.token;
isLogin = props.location.state.isLogin; isLogin = props.location.state.isLogin;
ganttName = props.location.state.ganttName;
} else { } else {
role_id = localStorage.getItem("role_id"); role_id = localStorage.getItem("role_id");
userId = localStorage.getItem("user_id"); userId = localStorage.getItem("user_id");
@ -116,6 +117,7 @@ const Gantt = (props) => {
timestamp={timestamp} timestamp={timestamp}
dataViewStartDate={dataViewStartDate} dataViewStartDate={dataViewStartDate}
company_name={companyName} company_name={companyName}
ganttName={ganttName}
/> />
)} )}
</div> </div>

Loading…
Cancel
Save