Browse Source

Merge pull request 'staging' (#181) from staging into general

Reviewed-on: ordo/adw-frontend#181
pull/2/head
farhantock 1 year ago
parent
commit
fd90a02da8
  1. 13
      src/views/Dashboard/DashboardCustomer.js
  2. 12
      src/views/SimproV2/CreatedProyek/index.js

13
src/views/Dashboard/DashboardCustomer.js

@ -101,8 +101,11 @@ const DashboardCustomer = () => {
const getProjectDetail = async () => { const getProjectDetail = async () => {
setIsReadyProjectDetail(false); setIsReadyProjectDetail(false);
const URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`; let URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}`;
const result = await axios.get(URL, HEADER).then(res => res).catch(err => err.response) URL = `${BASE_OSPRO}/api/project/detail/${PROJECT_ID}/${GANTT_ID}/1`
const result = await axios.get(URL, HEADER)
.then(res => res)
.catch(err => err.response)
console.log('getProjectDetail', result); console.log('getProjectDetail', result);
if (!result) { if (!result) {
NotificationManager.error(`Could not connect to internet.`, "Failed"); NotificationManager.error(`Could not connect to internet.`, "Failed");
@ -195,7 +198,9 @@ const DashboardCustomer = () => {
const URL = `${BASE_OSPRO}/api/project/get-overdue-activities`; const URL = `${BASE_OSPRO}/api/project/get-overdue-activities`;
const payload = { const payload = {
"id": PROJECT_ID.toString(), "id": PROJECT_ID.toString(),
"till_date": moment(new Date()).format('YYYY-MM-DD') "till_date": moment(new Date()).format('YYYY-MM-DD'),
'gantt': GANTT_ID.toString(),
'scurve': SCURVE ? SCURVE.toString() : null
} }
const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response) const result = await axios.post(URL, payload, HEADER).then(res => res).catch(err => err.response)
console.log('getOverdueActivities', result); console.log('getOverdueActivities', result);
@ -431,7 +436,7 @@ const DashboardCustomer = () => {
<div style={{ display: 'flex', flexDirection: 'row', marginBottom: 10 }}> <div style={{ display: 'flex', flexDirection: 'row', marginBottom: 10 }}>
<div style={{ flex: 20, display: 'flex', flexDirection: 'column' }}> <div style={{ flex: 20, display: 'flex', flexDirection: 'column' }}>
<div style={{fontSize: 16, fontWeight: 'bold', marginBottom: 10}}>Project</div> <div style={{fontSize: 16, fontWeight: 'bold', marginBottom: 10}}>Project</div>
<div style={{fontSize: 14}}>{isReadyProjectDetail <div style={{fontSize: 14}}>{isReadyProjectDetail
? projectName ? projectName
? calculationStatus ? calculationStatus
? projectName + " - S-Curve Ready" ? projectName + " - S-Curve Ready"

12
src/views/SimproV2/CreatedProyek/index.js

@ -266,8 +266,8 @@ const CreatedProyek = ({ params, ...props }) => {
} }
}; };
const handleDashboard = async (text) => { const handleDashboard = async (id) => {
const URL = `${BASE_OSPRO}/api/project/detail/${text.id}`; const URL = `${BASE_OSPRO}/api/project/detail/${id}`;
const result = await axios const result = await axios
.get(URL, HEADER) .get(URL, HEADER)
.then((res) => res) .then((res) => res)
@ -285,7 +285,7 @@ const CreatedProyek = ({ params, ...props }) => {
return; return;
} else if (result.status == 200 && result.data.data) { } else if (result.status == 200 && result.data.data) {
history.push( history.push(
`dashboard-customer/${text.id}/${result.data.gantt}/1` `/dashboard-customer/${id}/${result.data.gantt}/1`
); );
} }
}; };
@ -596,6 +596,10 @@ const CreatedProyek = ({ params, ...props }) => {
getProjectDetail(data.id); getProjectDetail(data.id);
}; };
const handleDashboardCustomer = async (data) => {
handleDashboard(data.id);
};
const handleOpenReport = async (data) => { const handleOpenReport = async (data) => {
setOpenDialogRA(true); setOpenDialogRA(true);
setProjectId(data.id); setProjectId(data.id);
@ -1615,7 +1619,7 @@ const CreatedProyek = ({ params, ...props }) => {
<Tooltip title="Dashboard Project"> <Tooltip title="Dashboard Project">
<Button <Button
size="small" size="small"
onClick={() => handleDashboard(text)} onClick={() => handleDashboardCustomer(text)}
type="link" type="link"
style={{ color: "green" }} style={{ color: "green" }}
> >

Loading…
Cancel
Save