Browse Source

Merge pull request 'dev-wahyun' (#85) from dev-wahyun into staging

Reviewed-on: ibnu/generic-ospro-frontend#85
pull/1/head
farhantock 6 months ago
parent
commit
ade4651bdc
  1. 5
      src/const/ApiConst.js
  2. 5
      src/views/Dashboard/DashboardProject.js
  3. 1
      src/views/Dashboard/DashboardProjectCarousell.js
  4. 3
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  5. 60
      src/views/SimproV2/Gantt/GanttFrame.js.save

5
src/const/ApiConst.js

@ -116,8 +116,11 @@ export const TOKEN_ADW =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjAyIiwiZXhwIjoxNjkxODMwNDkzfQ.DvBQIOZsdFndWsliPCZT65Y6G5Xx4vWBKz8Rhe7rvRA"; "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxMjAyIiwiZXhwIjoxNjkxODMwNDkzfQ.DvBQIOZsdFndWsliPCZT65Y6G5Xx4vWBKz8Rhe7rvRA";
// export let BASE_OSPRO = "https://ospro-api.ospro.id"; // export let BASE_OSPRO = "https://ospro-api.ospro.id";
export let BASE_OSPRO = "https://project-api.ospro.id";
// export let BASE_OSPRO = "http://localhost:8444/adw-backend";
// export let BASE_OSPRO = "https://project-api.ospro.id"; // export let BASE_OSPRO = "https://project-api.ospro.id";
export let BASE_OSPRO = "http://localhost:8444/generic-ospro-backend";
export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`; export let BASE_SIMPRO_LUMEN = `${BASE_OSPRO}/api`;
export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`; export let BASE_SIMPRO_LUMEN_IMAGE = `${BASE_OSPRO}/assets/image`;
export let BASE_SIMPRO_LUMEN_FILE = `${BASE_OSPRO}/assets/file/project`; export let BASE_SIMPRO_LUMEN_FILE = `${BASE_OSPRO}/assets/file/project`;

5
src/views/Dashboard/DashboardProject.js

@ -80,8 +80,9 @@ const DashboardProject = (props) => {
}, },
}; };
const { PROJECT_ID, GANTT_ID, SCURVE } = useParams(); const { PROJECT_ID, GANTT_ID, SCURVE } = useParams();
// const URL_GANTT = `https://project-gantt.ospro.id/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1&role_name=${role_name}&company_id=${company_id}`; const URL_GANTT = `https://project-gantt.ospro.id/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1&role_name=${role_name}&company_id=${company_id}`;
const URL_GANTT = `http://localhost:8444/generic-ospro-gantt/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1&role_name=${role_name}&company_id=${company_id}`; // const URL_GANTT = `http://localhost:8444/generic-ospro-gantt/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1&role_name=${role_name}&company_id=${company_id}`;
const mapRef = useRef(); const mapRef = useRef();
const [projectName, setProjectName] = useState(""); const [projectName, setProjectName] = useState("");
const [projectManagerName, setProjectManagerName] = useState(""); const [projectManagerName, setProjectManagerName] = useState("");

1
src/views/Dashboard/DashboardProjectCarousell.js

@ -232,6 +232,7 @@ const DashboardProject = ({args,...props}) => {
); );
const slides = allDataMaster.map((item, index) => { const slides = allDataMaster.map((item, index) => {
let URL_GANTT = ""; let URL_GANTT = "";
let version_gantt = ""; let version_gantt = "";

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

@ -234,7 +234,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
<> <>
<Modal size="xl" isOpen={openDialog} toggle={toggleDialog}> <Modal size="xl" isOpen={openDialog} toggle={toggleDialog}>
<ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}> <ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}>
{hierarchyName ? ( {hierarchyName ? (
<Breadcrumb> <Breadcrumb>
<BreadcrumbItem><a href="/projects">Project</a></BreadcrumbItem> <BreadcrumbItem><a href="/projects">Project</a></BreadcrumbItem>
<BreadcrumbItem active>{hierarchyName}</BreadcrumbItem> <BreadcrumbItem active>{hierarchyName}</BreadcrumbItem>
@ -264,7 +264,6 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
</Button> </Button>
)} )}
</div> </div>
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
<div style={{ width: '100%', overflow: "auto" }}> <div style={{ width: '100%', overflow: "auto" }}>

60
src/views/SimproV2/Gantt/GanttFrame.js.save

@ -0,0 +1,60 @@
import React, { useEffect, useState } from 'react';
import { useHistory, withRouter } from 'react-router-dom';
import { BASE_SIMPRO_LUMEN } from '../../../const/ApiConst';
const GanttFrame = React.memo((props) => {
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = '';
if (props.location.state && props.location.state.role_id && props.location.state.user_id) {
role_id = props.location.state.role_id;
user_id = props.location.state.user_id;
isLogin = props.location.state.isLogin;
token = props.location.state.token;
} else {
role_id = localStorage.getItem("role_id");
proyek_id = localStorage.getItem("proyek_id");
user_id = localStorage.getItem("user_id");
isLogin = localStorage.getItem("isLogin");
token = localStorage.getItem("token");
}
const history = useHistory();
<<<<<<< HEAD
const { versionGanttId, idProject, ro, timestamp } = props;
const iframeSrc = `https://project-gantt.ospro.id/edit-mode/index.html?base_url=${BASE_SIMPRO_LUMEN}&gantt_id=${versionGanttId}&proyek_id=${idProject}&token=${token}&ro=${ro}&timestamp=${timestamp}`;
const [batchEntityData, setBatchEntityData] = useState(null);
useEffect(() => {
const handleMessage = (event) => {
if (event.data && event.data.batchEntity) {
setBatchEntityData(event.data.batchEntity);
}
};
window.addEventListener('message', handleMessage);
}, []);
useEffect(() => {
const handleNavigation = (event) => {
if (batchEntityData && batchEntityData !== '') {
const message = 'You have unsaved changes. Are you sure you want to leave this page?';
return message;
}
};
history.block(handleNavigation);
}, [batchEntityData])
return (
<iframe
id="frame-gantt"
src={iframeSrc}
style={{
width: '100%',
height: '95vh',
}}
scrolling="no"
frameBorder="0"
allow="fullscreen"
></iframe>
);
});
export default withRouter(GanttFrame);
Loading…
Cancel
Save