|
|
@ -31,15 +31,34 @@ import { |
|
|
|
import { Fab, Action } from "react-tiny-fab"; |
|
|
|
import { Fab, Action } from "react-tiny-fab"; |
|
|
|
import "react-tiny-fab/dist/styles.css"; |
|
|
|
import "react-tiny-fab/dist/styles.css"; |
|
|
|
import { useHistory, useLocation, useParams } from "react-router-dom"; |
|
|
|
import { useHistory, useLocation, useParams } from "react-router-dom"; |
|
|
|
import { Icon } from '@iconify/react'; |
|
|
|
|
|
|
|
import arrowLeft from '@iconify/icons-ion/ios-arrow-back'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input; |
|
|
|
const { TextArea } = Input; |
|
|
|
|
|
|
|
const styles = { |
|
|
|
|
|
|
|
cardContainer: { |
|
|
|
|
|
|
|
backgroundColor: "#F8F8F8", |
|
|
|
|
|
|
|
margin: 2, |
|
|
|
|
|
|
|
paddingLeft: 20, |
|
|
|
|
|
|
|
paddingRight: 20, |
|
|
|
|
|
|
|
paddingTop: 10, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cardHeaderContainer: { |
|
|
|
|
|
|
|
display: "flex", |
|
|
|
|
|
|
|
flexDirection: "row", |
|
|
|
|
|
|
|
marginBottom: 10, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cardChartContainer: { |
|
|
|
|
|
|
|
position: "relative", |
|
|
|
|
|
|
|
height: "21vh", |
|
|
|
|
|
|
|
margin: "auto", |
|
|
|
|
|
|
|
paddingBottom: 10, |
|
|
|
|
|
|
|
justifyContent: "center", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cardTitle: { color: "#444444", fontSize: 16, fontWeight: "bold" }, |
|
|
|
|
|
|
|
cardSubtitle: { color: "#888888", fontSize: 12 }, |
|
|
|
|
|
|
|
}; |
|
|
|
const center = { |
|
|
|
const center = { |
|
|
|
lat: -6.2, |
|
|
|
lat: -6.2, |
|
|
|
lng: 106.816666, |
|
|
|
lng: 106.816666, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const DashboardProject = (props) => { |
|
|
|
const DashboardProject = (props) => { |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', all_project = null, role_name = '', hierarchy = [], user_name = ''; |
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', all_project = null, role_name = '', hierarchy = [], user_name = ''; |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
|
if (props && props.role_id && props.user_id) { |
|
|
@ -53,14 +72,12 @@ const DashboardProject = (props) => { |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
user_name = props.user_name; |
|
|
|
user_name = props.user_name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
"Content-Type": "application/json", |
|
|
|
"Content-Type": "application/json", |
|
|
|
Authorization: `Bearer ${token}`, |
|
|
|
Authorization: `Bearer ${token}`, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
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}`; |
|
|
|
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}`; |
|
|
|
// 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}`;
|
|
|
|
// 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}`;
|
|
|
@ -80,7 +97,6 @@ const DashboardProject = (props) => { |
|
|
|
const [activeTabIdx, setActiveTabIdx] = useState(0); |
|
|
|
const [activeTabIdx, setActiveTabIdx] = useState(0); |
|
|
|
const [activeTabCommentIdx, setActiveTabCommentIdx] = useState(0); |
|
|
|
const [activeTabCommentIdx, setActiveTabCommentIdx] = useState(0); |
|
|
|
const [planningProgress, setPlanningProgress] = useState(0); |
|
|
|
const [planningProgress, setPlanningProgress] = useState(0); |
|
|
|
const [planningProgressToDay, setPlanningProgressToDay] = useState(0); |
|
|
|
|
|
|
|
const [actualProgress, setActualProgress] = useState(0); |
|
|
|
const [actualProgress, setActualProgress] = useState(0); |
|
|
|
const [currentBudget, setCurrentBudget] = useState(null); |
|
|
|
const [currentBudget, setCurrentBudget] = useState(null); |
|
|
|
const [addCostToComplete, setAddCostToComplete] = useState(null); |
|
|
|
const [addCostToComplete, setAddCostToComplete] = useState(null); |
|
|
@ -118,7 +134,6 @@ const DashboardProject = (props) => { |
|
|
|
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); |
|
|
|
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); |
|
|
|
const [calculationStatus, setCalculationStatus] = useState(false); |
|
|
|
const [calculationStatus, setCalculationStatus] = useState(false); |
|
|
|
const [isHierarchy, setIsHierarchy] = useState(null); |
|
|
|
const [isHierarchy, setIsHierarchy] = useState(null); |
|
|
|
const [dashboardGantt, setDashboardStatus] = useState(false); |
|
|
|
|
|
|
|
let history = useHistory(); |
|
|
|
let history = useHistory(); |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
getProjectDetail(); |
|
|
|
getProjectDetail(); |
|
|
@ -127,11 +142,9 @@ const DashboardProject = (props) => { |
|
|
|
getComments(); |
|
|
|
getComments(); |
|
|
|
getGantt(); |
|
|
|
getGantt(); |
|
|
|
getGanttParents(); |
|
|
|
getGanttParents(); |
|
|
|
getQueryParams(); |
|
|
|
|
|
|
|
return () => { |
|
|
|
return () => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (isHierarchy != null) { |
|
|
|
if (isHierarchy != null) { |
|
|
|
getSCurve(); |
|
|
|
getSCurve(); |
|
|
@ -141,23 +154,21 @@ const DashboardProject = (props) => { |
|
|
|
window.removeEventListener("message", handleIframeMessage); |
|
|
|
window.removeEventListener("message", handleIframeMessage); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, [isHierarchy]); |
|
|
|
}, [isHierarchy]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (activeTabIdx === 1) { |
|
|
|
if (activeTabIdx === 1) { |
|
|
|
initMap(); |
|
|
|
initMap(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, [activeTabIdx]); |
|
|
|
}, [activeTabIdx]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
async function fetchData() { |
|
|
|
async function fetchData() { |
|
|
|
await Promise.all([ |
|
|
|
await Promise.all([ |
|
|
|
getManpower(), |
|
|
|
getManpower(), |
|
|
|
getAssignedHR() |
|
|
|
getAssignedHR(), |
|
|
|
|
|
|
|
...(assignedHr.length > 0 ? [getActualHR()] : []), |
|
|
|
]); |
|
|
|
]); |
|
|
|
} |
|
|
|
} |
|
|
|
fetchData(); |
|
|
|
fetchData(); |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
let deviation = 0; |
|
|
|
let deviation = 0; |
|
|
|
if (plannedCost && totalCost) { |
|
|
|
if (plannedCost && totalCost) { |
|
|
@ -165,11 +176,9 @@ const DashboardProject = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
setRemToComplete(deviation.toString()); |
|
|
|
setRemToComplete(deviation.toString()); |
|
|
|
}, [plannedCost, totalCost]); |
|
|
|
}, [plannedCost, totalCost]); |
|
|
|
|
|
|
|
|
|
|
|
const handleRedirect = () => { |
|
|
|
const handleRedirect = () => { |
|
|
|
history.push("/projects/" + GANTT_ID + "/" + PROJECT_ID + "/gantt"); |
|
|
|
history.push("/projects/" + GANTT_ID + "/" + PROJECT_ID + "/gantt"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getManpower = async () => { |
|
|
|
const getManpower = async () => { |
|
|
|
const url = `${BASE_OSPRO}/api/project/manpower/${PROJECT_ID}`; |
|
|
|
const url = `${BASE_OSPRO}/api/project/manpower/${PROJECT_ID}`; |
|
|
|
try { |
|
|
|
try { |
|
|
@ -178,7 +187,6 @@ const DashboardProject = (props) => { |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getGantt = async () => { |
|
|
|
const getGantt = async () => { |
|
|
|
setIsReadyGantt(false); |
|
|
|
setIsReadyGantt(false); |
|
|
|
const url = `${BASE_OSPRO}/api/version-gantt/edit/${GANTT_ID}`; |
|
|
|
const url = `${BASE_OSPRO}/api/version-gantt/edit/${GANTT_ID}`; |
|
|
@ -195,7 +203,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyGantt(true); |
|
|
|
setIsReadyGantt(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getGanttParents = async () => { |
|
|
|
const getGanttParents = async () => { |
|
|
|
setIsReadyGanttParents(false); |
|
|
|
setIsReadyGanttParents(false); |
|
|
|
const url = `${BASE_OSPRO}/api/hierarchy-ftths/tree-gantt/${GANTT_ID}`; |
|
|
|
const url = `${BASE_OSPRO}/api/hierarchy-ftths/tree-gantt/${GANTT_ID}`; |
|
|
@ -207,7 +214,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyGanttParents(true); |
|
|
|
setIsReadyGanttParents(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getAssignedHR = async () => { |
|
|
|
const getAssignedHR = async () => { |
|
|
|
const url = `${BASE_OSPRO}/api/project/manpower/assigned/${GANTT_ID}`; |
|
|
|
const url = `${BASE_OSPRO}/api/project/manpower/assigned/${GANTT_ID}`; |
|
|
|
try { |
|
|
|
try { |
|
|
@ -218,16 +224,11 @@ const DashboardProject = (props) => { |
|
|
|
today.isBetween(moment(item.start_date), moment(item.end_date)) |
|
|
|
today.isBetween(moment(item.start_date), moment(item.end_date)) |
|
|
|
) |
|
|
|
) |
|
|
|
.map((item) => item.user_id); |
|
|
|
.map((item) => item.user_id); |
|
|
|
const uniqueUserIds = new Set(assignedList); |
|
|
|
setAssignedHrCount(assignedList.length); |
|
|
|
setAssignedHrCount(uniqueUserIds.size); |
|
|
|
setAssignedHr(assignedList); |
|
|
|
if (assignedList.length > 0) { |
|
|
|
|
|
|
|
getActualHR(assignedList) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
console.error("Failed to get assigned HR:", error); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getActualHR = async () => { |
|
|
|
const getActualHR = async () => { |
|
|
|
const dateStart = moment().startOf("day").toDate(); |
|
|
|
const dateStart = moment().startOf("day").toDate(); |
|
|
|
const dateEnd = moment().endOf("day").toDate(); |
|
|
|
const dateEnd = moment().endOf("day").toDate(); |
|
|
@ -267,7 +268,6 @@ const DashboardProject = (props) => { |
|
|
|
console.error("Failed to get actual HR:", error); |
|
|
|
console.error("Failed to get actual HR:", error); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getProjectDetail = async () => { |
|
|
|
const getProjectDetail = async () => { |
|
|
|
setIsReadyProjectDetail(false); |
|
|
|
setIsReadyProjectDetail(false); |
|
|
|
let URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`; |
|
|
|
let URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`; |
|
|
@ -352,7 +352,6 @@ const DashboardProject = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getSCurve = async () => { |
|
|
|
const getSCurve = async () => { |
|
|
|
setIsReadySCurve(false); |
|
|
|
setIsReadySCurve(false); |
|
|
|
let URL = `${BASE_OSPRO}/api/project/get-s-curve`; |
|
|
|
let URL = `${BASE_OSPRO}/api/project/get-s-curve`; |
|
|
@ -385,7 +384,6 @@ const DashboardProject = (props) => { |
|
|
|
let selisihProgress = 0; |
|
|
|
let selisihProgress = 0; |
|
|
|
let planningProgress = 0; |
|
|
|
let planningProgress = 0; |
|
|
|
let actualProgress = 0; |
|
|
|
let actualProgress = 0; |
|
|
|
let progressPlanToDay = 0; |
|
|
|
|
|
|
|
let statusHealthBySchedule = "behind-schedule"; |
|
|
|
let statusHealthBySchedule = "behind-schedule"; |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
result.data.data.length > 0 && |
|
|
|
result.data.data.length > 0 && |
|
|
@ -425,14 +423,6 @@ const DashboardProject = (props) => { |
|
|
|
planningProgress = result.data.data[0].data?.percentagePlan[n]; |
|
|
|
planningProgress = result.data.data[0].data?.percentagePlan[n]; |
|
|
|
setPlanningProgress(planningProgress); |
|
|
|
setPlanningProgress(planningProgress); |
|
|
|
} |
|
|
|
} |
|
|
|
if ( |
|
|
|
|
|
|
|
result.data.data.length > 0 && |
|
|
|
|
|
|
|
result.data.data[0].data?.progressPlanToDay && |
|
|
|
|
|
|
|
result.data.data[0].data?.progressPlanToDay != null |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
progressPlanToDay = result.data.data[0].data?.progressPlanToDay; |
|
|
|
|
|
|
|
setPlanningProgressToDay(+(Math.round(progressPlanToDay + "e+2") + "e-2")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ( |
|
|
|
if ( |
|
|
|
result.data.data.length > 0 && |
|
|
|
result.data.data.length > 0 && |
|
|
|
result.data.data[0].data?.percentageReal && |
|
|
|
result.data.data[0].data?.percentageReal && |
|
|
@ -442,7 +432,7 @@ const DashboardProject = (props) => { |
|
|
|
result.data.data[0].data?.percentageReal[ |
|
|
|
result.data.data[0].data?.percentageReal[ |
|
|
|
result.data.data[0].data?.percentageReal.length - 1 |
|
|
|
result.data.data[0].data?.percentageReal.length - 1 |
|
|
|
]; |
|
|
|
]; |
|
|
|
setActualProgress(+(Math.round(actualProgress + "e+2") + "e-2")); |
|
|
|
setActualProgress(actualProgress); |
|
|
|
} |
|
|
|
} |
|
|
|
selisihProgress = planningProgress - actualProgress; |
|
|
|
selisihProgress = planningProgress - actualProgress; |
|
|
|
if (selisihProgress > 0 && selisihProgress <= 20) { |
|
|
|
if (selisihProgress > 0 && selisihProgress <= 20) { |
|
|
@ -454,7 +444,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadySCurve(true); |
|
|
|
setIsReadySCurve(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getOverdueActivities = async () => { |
|
|
|
const getOverdueActivities = async () => { |
|
|
|
setIsReadyOverdueActivities(false); |
|
|
|
setIsReadyOverdueActivities(false); |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-overdue-activities`; |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-overdue-activities`; |
|
|
@ -488,7 +477,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyOverdueActivities(true); |
|
|
|
setIsReadyOverdueActivities(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getIntegrationInvoice = async (kode_sortname, id, gantt_id = null) => { |
|
|
|
const getIntegrationInvoice = async (kode_sortname, id, gantt_id = null) => { |
|
|
|
setIsReadyIntegrationInvoice(false); |
|
|
|
setIsReadyIntegrationInvoice(false); |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-integration-invoice`; |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-integration-invoice`; |
|
|
@ -509,10 +497,10 @@ const DashboardProject = (props) => { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (result.status !== 200) { |
|
|
|
if (result.status !== 200) { |
|
|
|
// NotificationManager.error(
|
|
|
|
NotificationManager.error( |
|
|
|
// `Get integration invoice failed, ${result.data.message}`,
|
|
|
|
`Get integration invoice failed, ${result.data.message}`, |
|
|
|
// "Failed"
|
|
|
|
"Failed" |
|
|
|
// );
|
|
|
|
); |
|
|
|
setIsReadyIntegrationInvoice(true); |
|
|
|
setIsReadyIntegrationInvoice(true); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (result.status == 200 && result.data.data) { |
|
|
|
} else if (result.status == 200 && result.data.data) { |
|
|
@ -532,7 +520,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyIntegrationInvoice(true); |
|
|
|
setIsReadyIntegrationInvoice(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getReportDistribution = async () => { |
|
|
|
const getReportDistribution = async () => { |
|
|
|
setIsReadyReportDistribution(false); |
|
|
|
setIsReadyReportDistribution(false); |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-report-distribution`; |
|
|
|
const URL = `${BASE_OSPRO}/api/project/get-report-distribution`; |
|
|
@ -565,7 +552,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyReportDistribution(true); |
|
|
|
setIsReadyReportDistribution(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getComments = async () => { |
|
|
|
const getComments = async () => { |
|
|
|
setIsReadyComments(false); |
|
|
|
setIsReadyComments(false); |
|
|
|
const URL = `${BASE_OSPRO}/api/project-comment/search`; |
|
|
|
const URL = `${BASE_OSPRO}/api/project-comment/search`; |
|
|
@ -594,7 +580,6 @@ const DashboardProject = (props) => { |
|
|
|
orders: { columns: ["created_at"], ascending: false }, |
|
|
|
orders: { columns: ["created_at"], ascending: false }, |
|
|
|
paging: { start: 0, length: -1 }, |
|
|
|
paging: { start: 0, length: -1 }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const result = await axios |
|
|
|
const result = await axios |
|
|
|
.post(URL, payload, HEADER) |
|
|
|
.post(URL, payload, HEADER) |
|
|
|
.then((res) => res) |
|
|
|
.then((res) => res) |
|
|
@ -616,7 +601,6 @@ const DashboardProject = (props) => { |
|
|
|
setIsReadyComments(true); |
|
|
|
setIsReadyComments(true); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleSendComment = async () => { |
|
|
|
const handleSendComment = async () => { |
|
|
|
setIsSendingComment(true); |
|
|
|
setIsSendingComment(true); |
|
|
|
if (comment === "") { |
|
|
|
if (comment === "") { |
|
|
@ -656,23 +640,10 @@ const DashboardProject = (props) => { |
|
|
|
getComments(); |
|
|
|
getComments(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const resetInputComment = () => { |
|
|
|
const resetInputComment = () => { |
|
|
|
setComment(""); |
|
|
|
setComment(""); |
|
|
|
setIsSendingComment(false); |
|
|
|
setIsSendingComment(false); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getQueryParams = () => { |
|
|
|
|
|
|
|
const searchParams = new URLSearchParams(props.location.search); |
|
|
|
|
|
|
|
const dashboardGantt = searchParams.get('dashboardGantt'); |
|
|
|
|
|
|
|
setDashboardStatus(dashboardGantt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleBack = async () => { |
|
|
|
|
|
|
|
const domainUrl = window.location.origin; |
|
|
|
|
|
|
|
!SCURVE ? (dashboardGantt ? window.parent.location.reload() : window.location.replace(`${domainUrl}/#/projects/${GANTT_ID}/${PROJECT_ID}/gantt`)) : window.history.go(-1); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initMap = () => { |
|
|
|
const initMap = () => { |
|
|
|
let mymap = L.map("map-area", { |
|
|
|
let mymap = L.map("map-area", { |
|
|
|
center: center, |
|
|
|
center: center, |
|
|
@ -684,7 +655,6 @@ const DashboardProject = (props) => { |
|
|
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
|
|
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', |
|
|
|
}).addTo(mymap); |
|
|
|
}).addTo(mymap); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (mymap) { |
|
|
|
if (mymap) { |
|
|
|
if (reportDistribution.length > 0) { |
|
|
|
if (reportDistribution.length > 0) { |
|
|
@ -696,7 +666,6 @@ const DashboardProject = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, [mymap, reportDistribution]); |
|
|
|
}, [mymap, reportDistribution]); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
// Add event listener for receiving messages from the iframe
|
|
|
|
// Add event listener for receiving messages from the iframe
|
|
|
|
window.addEventListener("message", handleIframeMessage); |
|
|
|
window.addEventListener("message", handleIframeMessage); |
|
|
@ -705,7 +674,6 @@ const DashboardProject = (props) => { |
|
|
|
window.removeEventListener("message", handleIframeMessage); |
|
|
|
window.removeEventListener("message", handleIframeMessage); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
const handleIframeMessage = (event) => { |
|
|
|
const handleIframeMessage = (event) => { |
|
|
|
if (event.data && event.data.action === "getUrl") { |
|
|
|
if (event.data && event.data.action === "getUrl") { |
|
|
|
const childUrl = window.location.href; |
|
|
|
const childUrl = window.location.href; |
|
|
@ -716,7 +684,6 @@ const DashboardProject = (props) => { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const RenderGantt = useMemo( |
|
|
|
const RenderGantt = useMemo( |
|
|
|
() => ( |
|
|
|
() => ( |
|
|
|
<iframe |
|
|
|
<iframe |
|
|
@ -733,7 +700,6 @@ const DashboardProject = (props) => { |
|
|
|
), |
|
|
|
), |
|
|
|
[activeTabIdx] |
|
|
|
[activeTabIdx] |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const RenderComments = useMemo(() => { |
|
|
|
const RenderComments = useMemo(() => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
@ -837,25 +803,12 @@ const DashboardProject = (props) => { |
|
|
|
); |
|
|
|
); |
|
|
|
}, [overdueActivities, isReadyOverdueActivities]); |
|
|
|
}, [overdueActivities, isReadyOverdueActivities]); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div style={{ marginLeft: dashboardGantt ? -80 : -25, marginRight: -25 }}> |
|
|
|
<div style={{ marginLeft: -25, marginRight: -25 }}> |
|
|
|
<NotificationContainer /> |
|
|
|
<NotificationContainer /> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col span={18}> |
|
|
|
<Col span={18}> |
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
<Col span={2}> |
|
|
|
<Col span={8}> |
|
|
|
<Button |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
height: "100%", |
|
|
|
|
|
|
|
width: "100%", |
|
|
|
|
|
|
|
fontSize: "18px" |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
onClick={handleBack} |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Icon icon={arrowLeft} style={{ fontSize: "20px" }} /> Back |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
</Col> |
|
|
|
|
|
|
|
<Col span={6}> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
border: "solid", |
|
|
|
border: "solid", |
|
|
@ -904,14 +857,14 @@ const DashboardProject = (props) => { |
|
|
|
} |
|
|
|
} |
|
|
|
return SCURVE && SCURVE == "1" |
|
|
|
return SCURVE && SCURVE == "1" |
|
|
|
? projectName |
|
|
|
? projectName |
|
|
|
// ? calculationStatus
|
|
|
|
? calculationStatus |
|
|
|
// ? projectName + " - S-Curve Ready"
|
|
|
|
? projectName + " - S-Curve Ready" |
|
|
|
// : projectName + " - S-Curve Loading"
|
|
|
|
: projectName + " - S-Curve Loading" |
|
|
|
// : null
|
|
|
|
: null |
|
|
|
: projectName |
|
|
|
: projectName + |
|
|
|
// + parentNames +
|
|
|
|
parentNames + |
|
|
|
// " - " +
|
|
|
|
" - " + |
|
|
|
// dataGantt.data.data.name_version;
|
|
|
|
dataGantt.data.data.name_version; |
|
|
|
})() |
|
|
|
})() |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<SingleTextLoader /> |
|
|
|
<SingleTextLoader /> |
|
|
@ -1462,7 +1415,7 @@ const DashboardProject = (props) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{isReadySCurve ? ( |
|
|
|
{isReadySCurve ? ( |
|
|
|
<ProgressPlanningBar |
|
|
|
<ProgressPlanningBar |
|
|
|
progress={planningProgressToDay > 100 ? 100 : planningProgressToDay} |
|
|
|
progress={planningProgress > 100 ? 100 : planningProgress} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<SingleTextLoader width={"100%"} height={30} /> |
|
|
|
<SingleTextLoader width={"100%"} height={30} /> |
|
|
|