Browse Source

Merge branch 'general' of https://git.oslog.id/ordo/adw-frontend

pull/2/head
root 1 year ago
parent
commit
d7e3f6df13
  1. 16
      src/views/Dashboard/DashboardProject.js
  2. 5
      src/views/SimproV2/CreatedProyek/DialogGantt.js

16
src/views/Dashboard/DashboardProject.js

@ -124,12 +124,11 @@ const DashboardProject = () => {
const [dataGanttParents, setDataGanttParents] = useState({});
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false);
const [calculationStatus, setCalculationStatus] = useState(false);
const [isHierarchy, setIsHierarchy] = useState(false);
const [isHierarchy, setIsHierarchy] = useState(null);
let history = useHistory();
useEffect(() => {
getProjectDetail();
getSCurve();
getOverdueActivities();
getReportDistribution();
getComments();
@ -140,6 +139,17 @@ const DashboardProject = () => {
};
}, []);
useEffect(() => {
if (isHierarchy != null) {
getSCurve();
}
window.addEventListener("message", handleIframeMessage);
return () => {
window.removeEventListener("message", handleIframeMessage);
};
}, [isHierarchy]);
useEffect(() => {
if (activeTabIdx === 1) {
initMap();
@ -187,6 +197,8 @@ const DashboardProject = () => {
setDataGantt(response);
if (response.data.data.hierarchy_ftth_id) {
setIsHierarchy(true);
} else {
setIsHierarchy(false);
}
setIsReadyGantt(true);
} catch (error) {

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

@ -92,7 +92,10 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
.catch((error) => error.response);
if (result && result.status == 200) {
setDataGantt(result.data.data);
const sortedData = result.data.data.sort((a, b) => {
return a.name_version.toLowerCase().localeCompare(b.name_version.toLowerCase());
});
setDataGantt(sortedData);
} else {
NotificationManager.error(`Data gantt project gagal terload silahkan coba lagi!`, 'Failed!!');
}

Loading…
Cancel
Save