staging #6

Merged
farhantock merged 5 commits from staging into master 6 months ago
  1. 4
      src/views/Dashboard/DashboardBOD.js
  2. 4
      src/views/Dashboard/DashboardProject.js
  3. 8
      src/views/SimproV2/CreatedProyek/DialogFormProyek.js
  4. 5
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  5. 3
      src/views/SimproV2/CreatedProyek/index.js
  6. 8
      src/views/SimproV2/Gantt/GanttFrame.js
  7. 4
      src/views/SimproV2/Gantt/index.js

4
src/views/Dashboard/DashboardBOD.js

@ -925,8 +925,8 @@ const DashboardBOD = (props) => {
<Col span={24}>
<CardScheduleHealthPerDivision
isReady={READY_PROJECT_SCHEDULE_BUDGET_HEALTH_PER_DIVISION}
title={`Projects by ${capitalizeFirstLetter(healthPerDivisionMode)} Health per Division`}
subtitle={`${capitalizeFirstLetter(healthPerDivisionMode)} health per division.`}
title={`Projects by ${capitalizeFirstLetter(healthPerDivisionMode)} Health per MP`}
subtitle={`${capitalizeFirstLetter(healthPerDivisionMode)} health per MP.`}
mode={healthPerDivisionMode}
changeMode={(mode) => setHealthPerDivisionMode(mode)}
chartType="vertical-bar"

4
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);

8
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 = () => {

5
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
}
}}>
<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: '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>) },

3
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
}
}}>
<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 { 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}&timestamp=${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}&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/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);
useEffect(() => {

4
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}
/>
)}
</div>

Loading…
Cancel
Save