Browse Source

Adjusting s curve

pull/2/head
Wahyu Ramadhan 1 year ago
parent
commit
04c2255a4f
  1. 15
      src/views/Dashboard/DashboardProject.js

15
src/views/Dashboard/DashboardProject.js

@ -248,7 +248,11 @@ const DashboardProject = () => {
const getSCurve = async () => {
setIsReadySCurve(false);
const URL = `${BASE_OSPRO}/api/project/get-s-curve`;
let URL = `${BASE_OSPRO}/api/project/get-s-curve`;
if(SCURVE && SCURVE == "1"){
URL = `${BASE_OSPRO}/api/project/get-linear-s-curve`;
}
const payload = {
"project_id": PROJECT_ID.toString(),
"gantt_id": GANTT_ID.toString(),
@ -285,7 +289,11 @@ const DashboardProject = () => {
let dates = result.data.data[0].data?.date;
let n = dates.findIndex(element => new Date(now) < new Date(element[0])) - 1;
if (result.data.data.length > 0 && result.data.data[0].data?.percentagePlan && result.data.data[0].data?.percentagePlan.length > 0) {
planningProgress = result.data.data[0].data?.percentagePlan[n];
if(SCURVE && SCURVE == "1"){
planningProgress = result.data.data[0].data?.percentagePlan[result.data.data[0].data?.percentagePlan.length - 1];
} else {
planningProgress = result.data.data[0].data?.percentagePlan[n];
}
setPlanningProgress(planningProgress);
}
if (result.data.data.length > 0 && result.data.data[0].data?.percentageReal && result.data.data[0].data?.percentageReal.length > 0) {
@ -600,7 +608,8 @@ const DashboardProject = () => {
parentNames += " - ";
parentNames += dataGanttParents.data.data[i].name;
}
return projectName + parentNames + " - " + dataGantt.data.data.name_version;
return SCURVE && SCURVE == "1" ? projectName
: projectName + parentNames + " - " + dataGantt.data.data.name_version;
})()
: <SingleTextLoader />}
</div>

Loading…
Cancel
Save