Browse Source

Merge pull request 'staging upload' (#65) from staging into master

Reviewed-on: ordo/adw-frontend#65
pull/2/head
ibnu 1 year ago
parent
commit
1341b98200
  1. 15
      src/views/Dashboard/DashboardProject.js

15
src/views/Dashboard/DashboardProject.js

@ -88,6 +88,7 @@ const DashboardProject = () => {
const [dataGantt, setDataGantt] = useState({});
const [dataGanttParents, setDataGanttParents] = useState({});
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false);
const [calculationStatus, setCalculationStatus] = useState(false);
let history = useHistory();
@ -239,6 +240,7 @@ const DashboardProject = () => {
setEstimatedFinish(result.data.data.header?.end_date ? result.data.data.header.end_date : null)
setPlannedCost(result.data.data.rencana_biaya ? result.data.data.rencana_biaya : null)
setIsReadyProjectDetail(true);
setCalculationStatus(result.data.data.calculation_status ? result.data.data.calculation_status : false)
if (result.data.data.kode_sortname && result.data.data.kode_sortname !== '') {
getIntegrationInvoice(result.data.data.kode_sortname)
@ -250,7 +252,7 @@ const DashboardProject = () => {
setIsReadySCurve(false);
let URL = `${BASE_OSPRO}/api/project/get-s-curve`;
if(SCURVE && SCURVE == "1"){
URL = `${BASE_OSPRO}/api/project/get-linear-s-curve`;
URL = `${BASE_OSPRO}/api/project/calculate-s-curve`;
}
const payload = {
@ -608,7 +610,12 @@ const DashboardProject = () => {
parentNames += " - ";
parentNames += dataGanttParents.data.data[i].name;
}
return SCURVE && SCURVE == "1" ? projectName
return SCURVE && SCURVE == "1"
? projectName
? calculationStatus
? projectName + " - S-Curve Ready"
: projectName + " - S-Curve Loading"
: null
: projectName + parentNames + " - " + dataGantt.data.data.name_version;
})()
: <SingleTextLoader />}
@ -802,13 +809,13 @@ const DashboardProject = () => {
<div style={{ backgroundColor: '#222222', padding: 10, marginBottom: 5 }}>
<div style={{ color: '#FFFFFF', textAlign: 'center', marginBottom: 10, fontWeight: 'bold' }}>Progress</div>
{isReadySCurve ?
<ProgressPlanningBar progress={planningProgress} />
<ProgressPlanningBar progress={planningProgress > 100 ? 100 : planningProgress} />
:
<SingleTextLoader width={"100%"} height={30} />
}
<div style={{ marginTop: 10, marginBottom: 10 }}></div>
{isReadySCurve ?
<ProgressActualBar progress={actualProgress} />
<ProgressActualBar progress={planningProgress > 100 ? parseFloat(actualProgress / planningProgress * 100).toFixed(2) : actualProgress} />
:
<SingleTextLoader width={"100%"} height={30} />
}

Loading…
Cancel
Save