Browse Source

fix(props): adding props for gantt iframe

pull/1/head
Watiah11 6 months ago
parent
commit
e9a3adf796
  1. 8
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  2. 8
      src/views/SimproV2/CreatedProyek/index.js
  3. 9
      src/views/SimproV2/Gantt/index.js

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

@ -1,5 +1,5 @@
import React, { useEffect, useState, useMemo } from 'react'
import { Modal, ModalHeader, ModalBody, Col, Row, Breadcrumb, BreadcrumbItem } from 'reactstrap';
import { Modal, ModalHeader, ModalBody, Breadcrumb, BreadcrumbItem } from 'reactstrap';
import { Button } from 'reactstrap';
import { Select, Table, Tooltip, Spin } from 'antd';
import 'antd/dist/antd.css';
@ -13,14 +13,13 @@ import DialogUserGantt from './DialogUserGantt';
import { Link } from 'react-router-dom';
const { Option } = Select
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, companyId, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id, dataViewStartDate }) => {
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, companyId, configApp, hierarchyId, hierarchyName, openDialogHierarchy, isLogin, token, role_id, user_id, dataViewStartDate }) => {
const HEADER = {
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
}
}
const [openDialogForm, setOpenDialogForm] = useState(false)
const [openDialogUserGantt, setOpenDialogUserGantt] = useState(false)
const [dataGantt, setDataGantt] = useState([])
@ -134,7 +133,8 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
role_id,
user_id,
company_id: companyId,
dataViewStartDate
dataViewStartDate,
configApp: configApp
}
}}>
<Tooltip title="Gantt">

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

@ -103,6 +103,7 @@ const CreatedProyek = ({ params, ...props }) => {
isLogin = props.isLogin;
hierarchy = props.hierarchy;
user_name = props.user_name;
configApp = props.configApp;
}
const location = useLocation();
const history = useHistory();
@ -618,7 +619,7 @@ const CreatedProyek = ({ params, ...props }) => {
setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name);
setOpenDialogAsignHR(true);
};
@ -626,7 +627,7 @@ const CreatedProyek = ({ params, ...props }) => {
setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name);
setOpenDialogAsignCust(true);
};
@ -1605,7 +1606,7 @@ const CreatedProyek = ({ params, ...props }) => {
await setidTask(data.id);
setProyekName(data.nama);
setCompanyId(data.company_id);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(props.configApp).company_name);
setCompanyName(role_name === 'Super Admin' ? data.join_third_company_name : JSON.parse(configApp).company_name);
setOpenDialogDoc(true);
};
@ -2117,6 +2118,7 @@ const CreatedProyek = ({ params, ...props }) => {
user_id={user_id}
token={token}
isLogin={isLogin}
configApp={configApp}
proyekName={proyekName}
companyId={companyId}
dataViewStartDate={dataViewStartDate}

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

@ -1,13 +1,7 @@
import React, { useEffect, useMemo, useState } from "react";
import Timeline from "react-calendar-timeline";
import "react-calendar-timeline/lib/Timeline.css";
import {
USER_VERSION_GANTT_SEARCH,
BASE_SIMPRO_LUMEN,
BASE_URL_GANTT,
} from "../../../const/ApiConst";
import {USER_VERSION_GANTT_SEARCH} from "../../../const/ApiConst";
import axios from "../../../const/interceptorApi";
import { Fab, Action } from "react-tiny-fab";
import "react-tiny-fab/dist/styles.css";
import { useHistory } from "react-router-dom";
import GanttFrame from "./GanttFrame";
@ -35,6 +29,7 @@ const Gantt = (props) => {
Authorization: `Bearer ${token}`,
},
};
const versionGanttId = props.match.params ? props.match.params.id : 0;
const idProject = props.match.params.project ? props.match.params.project : 0;
const timestamp = props.match.params.timestamp

Loading…
Cancel
Save