Browse Source

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

Reviewed-on: ordo/adw-frontend#63
pull/2/head
ibnu 2 years ago
parent
commit
977bc79bd0
  1. 13
      src/views/Dashboard/DashboardProject.js

13
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) {
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