|
|
|
@ -10,7 +10,21 @@ let roCount = 0;
|
|
|
|
|
|
|
|
|
|
const Gantt = (props) => { |
|
|
|
|
const location = useLocation(); |
|
|
|
|
const { isLogin, token, role_id, user_id, company_id, dataViewStartDate, companyName, role_name } = location.state || {}; |
|
|
|
|
const { company_id, dataViewStartDate, companyName, role_name } = location.state || {}; |
|
|
|
|
|
|
|
|
|
let role_id = '', userId = '', isLogin = '', token = ''; |
|
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
|
role_id = props.location.state.role_id; |
|
|
|
|
userId = props.location.state.user_id; |
|
|
|
|
token = props.location.state.token; |
|
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
|
} else { |
|
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
|
userId = localStorage.getItem("user_id"); |
|
|
|
|
token = localStorage.getItem("token"); |
|
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const HEADER = { |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
@ -76,7 +90,7 @@ const Gantt = (props) => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const cekPermission = () => { |
|
|
|
|
let check = listUserGant.includes(parseInt(user_id)); |
|
|
|
|
let check = listUserGant.includes(parseInt(userId)); |
|
|
|
|
if (check) { |
|
|
|
|
setRo(0); |
|
|
|
|
} else { |
|
|
|
@ -100,6 +114,7 @@ const Gantt = (props) => {
|
|
|
|
|
role_name={role_name} |
|
|
|
|
companyId={company_id} |
|
|
|
|
timestamp={timestamp} |
|
|
|
|
dataViewStartDate={dataViewStartDate} |
|
|
|
|
company_name={companyName} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|