Browse Source

Merge pull request 'Use waypoint coordinates' (#92) from dev-wahyu into staging

Reviewed-on: ordo/adw-frontend#92
pull/2/head
ibnu 1 year ago
parent
commit
d61afa179d
  1. 2
      src/appredux/modules/map/actions.js
  2. 8
      src/views/Dashboard/DashboardProject.js

2
src/appredux/modules/map/actions.js

@ -133,7 +133,7 @@ export const getUserPoints = async () => {
feature.geometry = {
"type": "Point",
"coordinates": [n.clock_in_lng, n.clock_in_lat]
"coordinates": [n.wp_lon, n.wp_lat]
}
featureCollection.features.push(feature);

8
src/views/Dashboard/DashboardProject.js

@ -40,7 +40,7 @@ const DashboardProject = () => {
}
}
const { PROJECT_ID, GANTT_ID, SCURVE } = useParams();
const URL_GANTT = `https://adw-gantt.ospro.id/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1`;
const URL_GANTT = `http://localhost/adw-gantt/view-mode/index.html?base_url=${BASE_OSPRO}/api&gantt_id=${GANTT_ID}&proyek_id=${PROJECT_ID}&token=${token}&ro=1`;
const mapRef = useRef()
const [projectName, setProjectName] = useState("");
const [projectManagerName, setProjectManagerName] = useState("");
@ -89,6 +89,7 @@ const DashboardProject = () => {
const [dataGanttParents, setDataGanttParents] = useState({});
const [isReadyGanttParents, setIsReadyGanttParents] = useState(false);
const [calculationStatus, setCalculationStatus] = useState(false);
const [isHierarchy, setIsHierarchy] = useState(false);
let history = useHistory();
@ -151,6 +152,9 @@ const DashboardProject = () => {
try {
const response = await axios.get(url, HEADER)
setDataGantt(response)
if (response.data.data.hierarchy_ftth_id) {
setIsHierarchy(true)
}
setIsReadyGantt(true)
} catch (error) {
console.error('Failed to get gantt data:', error)
@ -251,7 +255,7 @@ const DashboardProject = () => {
const getSCurve = async () => {
setIsReadySCurve(false);
let URL = `${BASE_OSPRO}/api/project/get-s-curve`;
if(SCURVE && SCURVE == "1"){
if(SCURVE && SCURVE == "1" && isHierarchy){
URL = `${BASE_OSPRO}/api/project/calculate-s-curve`;
}

Loading…
Cancel
Save