Commit 479478bf authored by EKSAD's avatar EKSAD

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 110d1fa2 2311975c
......@@ -173,6 +173,10 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
// UPLOAD FOTO
const uploadFoto = (body) => api.post('attachment/upload_foto', body)
// MANAGEMENT DOCUMENT
const getDocumentCategory = () => api.get('document_category/get_all_document_category')
const getAllDocument = (body) => api.post('document/get_all_document', body)
// ------
// STEP 3
// ------
......@@ -275,7 +279,9 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
deleteUnitBisnis,
deleteParameter,
deletePerusahaan,
deleteReportItems
deleteReportItems,
getDocumentCategory,
getAllDocument
}
}
......
......@@ -298,7 +298,7 @@ export default class ApprovalMatrix extends Component {
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -360,7 +360,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -413,7 +413,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -440,7 +440,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -467,7 +467,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -494,7 +494,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -552,7 +552,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ visibleAM: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -584,7 +584,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -72,7 +72,7 @@ export default class CreateApprovalMatrix extends Component {
this.setState({ approvedBy: defaultProps, userData: response.data.data})
} else {
// alert('Approver Name: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -111,7 +111,7 @@ export default class CreateApprovalMatrix extends Component {
this.setState({ types: typeProps, typeData: response.data.data })
} else {
// alert('Approval Type: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -151,7 +151,7 @@ export default class CreateApprovalMatrix extends Component {
this.setState({ operators: operatorProps, operatorData: response.data.data })
} else {
// alert('Operator: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......
......@@ -71,7 +71,7 @@ export default class EditApprovalMatrix extends Component {
}, () => this.getUserData(), this.getTypeData(), this.getOperatorData())
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -110,7 +110,7 @@ export default class EditApprovalMatrix extends Component {
} else {
// alert('Pemberi Persetujuan: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -150,7 +150,7 @@ export default class EditApprovalMatrix extends Component {
this.setState({ operators: operatorProps, operatorData: response.data.data, getOperators: index == -1 ? operatorData[0]: operatorData[index] })
} else {
// alert('Operator: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -190,7 +190,7 @@ export default class EditApprovalMatrix extends Component {
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? typeData[0]: typeData[index] })
} else {
// alert('Approval Type: ' +response.data.message)
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......
......@@ -34,7 +34,7 @@ export default class PopUpDeleteAM extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -64,7 +64,7 @@ export default class VisualisasiAM extends Component {
this.setState({ types: typeProps, typeData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -111,7 +111,7 @@ export default class VisualisasiAM extends Component {
// console.log(listVisual);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -114,7 +114,7 @@ export default class BudgetTahunan extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -288,6 +288,11 @@ export default class BudgetTahunan extends Component {
this.setState({ alert: false })
}
getDataBalanceSheet(data){
console.log(data)
}
render() {
const columns = ["#", "Jenis Laporan",
{
......@@ -594,6 +599,7 @@ export default class BudgetTahunan extends Component {
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
getDataBalanceSheet={this.getDataBalanceSheet.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleBudgetTahunan: true })}
/>
)}
......
......@@ -708,6 +708,17 @@ export default class BalanceSheet extends Component {
// }, () => console.log(this.state.dataTable))
}
backToMasterBudget(){
let data = this.state.dataTable.map(i => {
return [
i[1], i[4], i[6], i[7], i[8], i[9], i[10], i[11], i[12], i[13], i[14], i[15], i[16], i[17], i[18], i[19], i[20], i[21]
]
})
// console.log(data);
this.props.getDataBalanceSheet(data)
this.props.onClickClose()
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
......@@ -771,7 +782,7 @@ export default class BalanceSheet extends Component {
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300}}>
<div style={{ width: 300 }}>
{tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
......@@ -1957,7 +1968,7 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) , height: this.props.height - 400 }}>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable2}
......@@ -1967,7 +1978,7 @@ export default class BalanceSheet extends Component {
</MuiThemeProvider>
</div>
</div>
<div className="grid grid-2x" style={{ marginTop: 20}}>
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<button
className="button"
......@@ -1988,9 +1999,19 @@ export default class BalanceSheet extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Cancel</Typography>
</div>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div>
<button
type="button"
onClick={() => this.backToMasterBudget()}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save</Typography>
</div>
</button>
<button
className="button"
type="button"
......
import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
import api from '../../api';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptionsManagementDocument();
export default class AuditTahunan extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: []
}
}
componentDidMount() {
console.log(this.props.data)
this.getData()
}
getData() {
let payload = {
"company_id": 1,
"document_category_id": 1
}
api.create().getAllDocument(payload).then(respone => {
let dataTable = respone.data.data.map(item => {
return [
item.document_name,
item.description,
item.company_name,
"",
item.document_type,
String(Number(item.document_size) / 1000 + ' MB'),
item.created_by,
item.created_at,
]
})
this.setState({ dataTable })
})
}
render() {
let columns = [
"Nama File", "Keterangan", "Perusahaan", "Periode", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
]
return (
<div style={{ width: '100%' }}>
<div style={{ display: 'grid', justifyContent: 'flex-end' }}>
<button
type="button"
onClick={() => null}
style={{ marginRight: 25 }}
>
<div style={{ width: 150, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Add</span>
</div>
</button>
</div>
<div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.dataTable}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
)
}
}
import React, {useEffect} from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import ReactTooltip from 'react-tooltip';
import Images from '../../assets/Images';
import { Paper } from '@material-ui/core';
import ManualBookTia from './ManualBookTia';
import api from '../../api';
function TabPanel(props) {
const { children, value, index, ...other } = props;
return (
<div
role="tabpanel"
hidden={value !== index}
id={`vertical-tabpanel-${index}`}
aria-labelledby={`vertical-tab-${index}`}
{...other}
>
{value === index && (
<Box p={3}>
<Typography>{children}</Typography>
</Box>
)}
</div>
);
}
TabPanel.propTypes = {
children: PropTypes.node,
index: PropTypes.any.isRequired,
value: PropTypes.any.isRequired,
};
function a11yProps(index) {
return {
id: `vertical-tab-${index}`,
'aria-controls': `vertical-tabpanel-${index}`,
};
}
const useStyles = makeStyles((theme) => ({
root: {
display: 'flex',
// height: 244,
},
tabs: {
borderRight: `1px solid ${theme.palette.divider}`,
},
}));
export default function DocumentManagement() {
const classes = useStyles();
const [value, setValue] = React.useState(0);
const [listData, setListData] = React.useState([])
const handleChange = (event, newValue) => {
setValue(newValue);
};
useEffect(() => {
getDataDocument()
})
const getDataDocument = () => {
api.create().getDocumentCategory().then(response => {
let data = response.data.data
setListData(data)
})
}
return (
<div style={{ flex: 1 }}>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Document Management</Typography>
</div>
<Paper style={{ padding: 20 }}>
<div style={{ display: 'grid', justifyContent: 'flex-end' }}>
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5,
marginRight: 20
}}
onClick={() => null}
>
<img src={Images.add} />
</button>
</a>
<ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" />
</div>
<div className={classes.root}>
<Tabs
orientation="vertical"
variant="scrollable"
value={value}
onChange={handleChange}
aria-label="Vertical tabs example"
className={classes.tabs}
>
{listData.map((item, index) => {
return (
<Tab label={item.document_category_name} {...a11yProps(index)} />
)
})}
</Tabs>
{listData.map((item, index) => {
return (
<TabPanel value={value} index={index} style={{ width: '100%'}}>
{index === 0 ?
<ManualBookTia /> :
<span>Test</span>
}
</TabPanel>
)
})}
</div>
</Paper>
</div>
);
}
\ No newline at end of file
import React, { Component } from 'react'
import { Tabs, Tab, Typography, Paper } from '@material-ui/core'
import ReactTooltip from 'react-tooltip'
import Images from '../../assets/Images'
import ManualBookTia from './ManualBookTia'
import api from '../../api'
import AuditTahunan from './AuditTahunan'
export default class DocumentManagement extends Component {
constructor(props) {
super(props)
this.state = {
tab: 0,
listData: [],
id: 0
}
}
selectTab = (event, newEvent) => {
this.setState({ tab: newEvent })
}
componentDidMount() {
this.getDataDocument()
}
getDataDocument() {
api.create().getDocumentCategory().then(response => {
this.setState({
listData: response.data.data,
id: response.data.data[0].document_category_id,
loadTable: true
})
})
}
getID(id) {
console.log(id);
this.setState({ id })
}
render() {
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8' }}>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Management Document</Typography>
</div>
<div style={{ padding: 20 }}>
<Paper style={{ padding: 20 }}>
<div style={{ display: 'flex' }}>
<Tabs
orientation="vertical"
variant="scrollable"
value={this.state.tab}
onChange={this.selectTab}
aria-label="simple tabs example"
style={{ width: 350 }}
>
{this.state.listData.map((item, index) => {
return (
<Tab
onClick={() => this.setState({ id: item.document_category_id })}
label={item.document_category_name}
/>
)
})}
</Tabs>
{this.state.loadTable && (
this.state.id === 2 ?
<AuditTahunan
data={this.state.listData[this.state.tab]}
/> :
this.state.id === 1 ?
<ManualBookTia /> :
<span>Test2</span>
)}
</div>
</Paper>
</div>
</div>
)
}
}
import React, { Component } from 'react'
import MUIDataTable from 'mui-datatables'
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptions();
export default class ManualBookTia extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: []
}
}
render() {
let columns = [
"Nama File", "Keterangan", "Perusahaan", "Tipe", "Ukuran", "Ditambahkan Oleh", "Ditambahkan Tanggal"
]
return (
<div style={{ width: '100%' }}>
<div style={{ display: 'grid', justifyContent: 'flex-end' }}>
<button
type="button"
onClick={() => null}
style={{ marginRight: 25 }}
>
<div style={{ width: 150, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Add</span>
</div>
</button>
</div>
<div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
data={this.state.dataTable}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
)
}
}
......@@ -85,7 +85,7 @@ class ForgotPassword extends Component {
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{padding: 60, display: 'flex', flexDirection: 'column', width: (this.state.msgEmail.length > 45 ? 403 : 378), height: 351, borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff', justifyContent: 'center', alignItems: 'center' }}>
<div style={{padding: 60, display: 'flex', flexDirection: 'column', width: (this.state.msgEmail.length > 45 ? 423 : 378), height: 351, borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff', justifyContent: 'center', alignItems: 'center' }}>
<img src={Images.triputraBlack} style={{ height: 59, width: 175, alignSelf: 'center'}} />
<TextField
......@@ -106,7 +106,7 @@ class ForgotPassword extends Component {
}}
/>
<Button name="submit" variant="contained" disabled={this.state.email.trim() === '' ? true : false} onClick={() => this.validateEmail()} style={{ marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 60 : 35) : 23, width: '100%', height: 30, borderRadius: 4, color: this.state.email.trim() === '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.email.trim() === '' ? '#d8d8d8' : '#51c6ea' }}>
<Button name="submit" variant="contained" disabled={this.state.email.trim() === '' ? true : false} onClick={() => this.validateEmail()} style={{ marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 80 : 35) : 23, width: '100%', height: 30, borderRadius: 4, color: this.state.email.trim() === '' ? '#4b4b4b' : '#fff', backgroundColor: this.state.email.trim() === '' ? '#d8d8d8' : '#51c6ea' }}>
<Typography style={{fontSize: 12, fontFamily: 'Nunito Sans, sans-serif'}}>Reset Password</Typography>
</Button>
......
......@@ -157,7 +157,7 @@ class Login extends Component {
this.validateLogin()
}}
>
<div style={{ maxWidth: 397, paddingTop: 56, padding: 65, display: 'flex', flexDirection: 'column', height: (this.state.msgEmail.length > 45 ? 475 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}>
<div style={{ maxWidth: 397, paddingTop: 56, padding: 65, display: 'flex', flexDirection: 'column', height: (this.state.msgEmail.length > 45 ? 485 : 441), borderRadius: 12, boxShadow: '0 2 4 0 rgba(0, 0, 0, 0.2)', backgroundColor: '#ffffff' }}>
<img src={Images.triputraBlack} style={{ height: 59, width: 175, alignSelf: 'center'}} />
<TextField
......@@ -189,7 +189,7 @@ class Login extends Component {
}}
variant="outlined"
error={this.state.errorPassword}
style={{ width: '100%', height: 51, marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 70 : 35) : 20 }}
style={{ width: '100%', height: 51, marginTop: this.state.errorEmail ? (this.state.msgEmail.length > 45 ? 80 : 35) : 20 }}
helperText={this.state.msgPassword}
onSubmit={() => this.validateLogin()}
InputProps={{
......
......@@ -92,7 +92,7 @@ export default class CreateParameter extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -131,7 +131,7 @@ export default class CreateParameter extends Component {
this.getParameterByGroup(this.state.getTypes.setting_group_id)})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -172,7 +172,7 @@ export default class CreateParameter extends Component {
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index], msgErrorPerusahaan: index === -1 ? 'Company has been inactive' : "", errorPerusahaan: index === -1 ? true : false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -208,7 +208,7 @@ export default class CreateParameter extends Component {
this.setState({ types: typeProps, typeData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -248,7 +248,7 @@ export default class CreateParameter extends Component {
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -286,7 +286,7 @@ export default class CreateParameter extends Component {
this.setState({ enableParameter: true, parameter: typeProps, parameterData: response.data.data, getParameter: index == -1 ? typeData[0] : typeData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -433,7 +433,7 @@ export default class CreateParameter extends Component {
// } else if (R.isEmpty(this.state.tempData.description)) {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
} else if (R.isEmpty(this.state.tempData.value) && R.isEmpty(this.state.tempData.min_value) && R.isEmpty(this.state.tempData.max_value)) {
this.setState({ errorValue: true, msgErrorValue: 'Value tidak boleh kosong' })
this.setState({ errorValue: true, msgErrorValue: 'Value Cannot be Empty.' })
} else if ((!R.isEmpty(this.state.tempData.max_value) && R.isEmpty(this.state.tempData.min_value))) {
this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty.' })
} else if (R.isNil(this.state.tempData.start_date)) {
......@@ -459,7 +459,7 @@ export default class CreateParameter extends Component {
// } else if (R.isEmpty(this.state.description)) {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
} else if ((R.isEmpty(this.state.value) && R.isEmpty(this.state.maxValue) && R.isEmpty(this.state.minValue))) {
this.setState({ errorValue: true, msgErrorValue: 'Value tidak boleh kosong' })
this.setState({ errorValue: true, msgErrorValue: 'Value Cannot be Empty.' })
} else if ((!R.isEmpty(this.state.maxValue) && R.isEmpty(this.state.minValue))) {
this.setState({ errorMinValue: true, msgErrorMinValue: 'Min Value Cannot be Empty.' })
} else if (R.isNil(this.state.startDate)) {
......
......@@ -92,7 +92,7 @@ export default class Parameter extends Component {
this.setState({ dataTable: listData, data: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -139,7 +139,7 @@ export default class Parameter extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -166,7 +166,7 @@ export default class Parameter extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -242,7 +242,7 @@ export default class Parameter extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -588,7 +588,7 @@ export default class Parameter extends Component {
});
} else {
this.setState({ dataLoaded: true, cols: [], rows: [], alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -626,7 +626,7 @@ export default class Parameter extends Component {
this.setState({ visibleParameter: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -657,7 +657,7 @@ export default class Parameter extends Component {
this.setState({ visibleDelete: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -94,7 +94,7 @@ export default class CreatePerusahaan extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -146,7 +146,7 @@ export default class CreatePerusahaan extends Component {
this.setState({ perusahaan: typeProps, perusahaanData: response.data.data, getPerusahaan: index == -1 ? null : perusahaanData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -186,7 +186,7 @@ export default class CreatePerusahaan extends Component {
this.setState({ types: typeProps, typeData: response.data.data, getTypes: index == -1 ? null : typeData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -32,7 +32,7 @@ export default class DeletePerusahaan extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -74,8 +74,8 @@ export default class Perusahaan extends Component {
"company_name": item[0] === undefined ? "" : item[0],
"company_parent": item[1] === undefined ? "" : item[1],
"unit_bisnis": item[2] === undefined ? "" : item[2],
"startDate": item[3] === undefined ? "" : item[3],
"endDate": item[4] === undefined ? "" :item[4],
"start_date": item[3] === undefined ? "" : item[3],
"end_date": item[4] === undefined ? "" :item[4],
})
}
})
......@@ -248,7 +248,7 @@ export default class Perusahaan extends Component {
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -305,7 +305,7 @@ export default class Perusahaan extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -358,7 +358,7 @@ export default class Perusahaan extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -385,7 +385,7 @@ export default class Perusahaan extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -412,7 +412,7 @@ export default class Perusahaan extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -469,7 +469,7 @@ export default class Perusahaan extends Component {
this.setState({ visiblePerusahaan: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -496,7 +496,7 @@ export default class Perusahaan extends Component {
this.setState({ visibleDelete: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -62,7 +62,7 @@ export default class VisualPerusahaan extends Component {
console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -112,7 +112,7 @@ export default class VisualPerusahaan extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -192,7 +192,7 @@ export default class UnitBisnis extends Component {
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -254,7 +254,7 @@ export default class UnitBisnis extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -308,7 +308,7 @@ export default class UnitBisnis extends Component {
this.setState({ dataTable: listData, listData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -335,7 +335,7 @@ export default class UnitBisnis extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -363,7 +363,7 @@ export default class UnitBisnis extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -420,7 +420,7 @@ export default class UnitBisnis extends Component {
this.setState({ visibleUnitBisnis: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -452,7 +452,7 @@ export default class UnitBisnis extends Component {
this.setState({ visibleDelete: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -229,7 +229,7 @@ export default class CreateReportItems extends Component {
this.setState({ listInputType: defaultProps, inputData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -271,7 +271,7 @@ export default class CreateReportItems extends Component {
this.setState({ listCompany: typeProps, companyData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -310,7 +310,7 @@ export default class CreateReportItems extends Component {
} else {
// alert(response.data.message)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -352,7 +352,7 @@ export default class CreateReportItems extends Component {
this.setState({ listParent: defaultProps, parentData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -200,7 +200,7 @@ export default class EditReportItems extends Component {
console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -239,7 +239,7 @@ export default class EditReportItems extends Component {
this.setState({ listInputType: defaultProps, InputType: index === -1 ? null : inputData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -282,7 +282,7 @@ export default class EditReportItems extends Component {
this.setState({ listCompany: defaultProps, companyData: response.data.data, company: index === -1 ? null : companyData[index], msgErrorPerusahaan: index === -1 ? 'Company has been Inactive.' : "", errorPerusahaan: index === -1 ? true : false }, () => this.getParent())
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -321,7 +321,7 @@ export default class EditReportItems extends Component {
this.setState({ listReportType: defaultProps, reportType: index === -1 ? null : reportTypeData[index] }, () => this.getParent())
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -374,7 +374,7 @@ export default class EditReportItems extends Component {
this.setState({ listParent: defaultProps, parent: index == -1 ? null : parentData[index] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -96,7 +96,7 @@ export default class VisualReportItems extends Component {
this.setState({ listReport: defaultProps, report: reportData[0] })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -134,7 +134,7 @@ export default class VisualReportItems extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -228,7 +228,7 @@ export default class VisualReportItems extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -75,7 +75,7 @@ export default class CreateUnitBisnis extends Component {
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -71,7 +71,7 @@ export default class UserRole extends Component {
this.setState({ listUser: listData })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -123,7 +123,7 @@ export default class UserRole extends Component {
this.setState({ listUser: listData })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -346,7 +346,7 @@ export default class UserRole extends Component {
});
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -403,7 +403,7 @@ export default class UserRole extends Component {
this.closeEdit()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -432,7 +432,7 @@ export default class UserRole extends Component {
this.getUser()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -475,7 +475,7 @@ export default class UserRole extends Component {
this.setState({ visibleUser: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -242,7 +242,7 @@ export default class AddUser extends Component {
this.setState({ listRole: defaultProps })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -268,7 +268,7 @@ export default class AddUser extends Component {
console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -175,7 +175,7 @@ export default class EditUser extends Component {
console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -257,7 +257,7 @@ export default class EditUser extends Component {
this.setState({ listRole: defaultProps, role: index === -1 ? null : roleData[index], msgErrorRN: index === -1 ? 'Role has been inactive' : '', errorRoleName: index === -1 ? true : false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -285,7 +285,7 @@ export default class EditUser extends Component {
this.setState({ listCompany: dataBaru })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -70,7 +70,7 @@ class UserRole extends Component {
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -122,7 +122,7 @@ class UserRole extends Component {
this.setState({ listRole: listData })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -170,7 +170,7 @@ class UserRole extends Component {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', popupDel: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', popupDel: false }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -145,7 +145,7 @@ export default class AddRole extends Component {
}, 750);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -197,7 +197,7 @@ export default class AddRole extends Component {
// this.setState({ menuData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -105,7 +105,7 @@ export default class EditRole extends Component {
console.log(response.data.data.start_date)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -172,7 +172,7 @@ export default class EditRole extends Component {
}, 750);
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -224,7 +224,7 @@ export default class EditRole extends Component {
// this.setState({ menuData: response.data.data })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -123,7 +123,7 @@ export default class Profile extends Component {
this.setState({ errorOldPassword: true, msgOldPassword: 'Incorrect password.' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -162,7 +162,7 @@ export default class Profile extends Component {
console.log(response)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -189,7 +189,7 @@ export default class Profile extends Component {
console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......@@ -335,7 +335,7 @@ export default class Profile extends Component {
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
......
......@@ -527,4 +527,21 @@ exports.customOptionsFixedColumn = function () {
search:false,
pagination: false
}
}
exports.customOptionsManagementDocument = function () {
return {
// selectableRows: false,
selectableRows: 'none',
filterType: 'multiselect',
responsive: 'scroll',
viewColumns:true,
rowsPerPage: 10,
rowsPerPageOptions: [10, 20, 30, 50],
print: false,
download: false,
elevation: 5,
filter: true,
search: true,
}
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ import BudgetTahunan from '../container/BudgetTahunan';
import RollingOutlook from '../container/RollingOutlook';
import OperatingIndicator from '../container/OperatingIndicator/OperatingIndicator'
import MonthlyReport from '../container/MonthlyReport';
import DocumentManagement from '../container/DocumentManagement/DocumentManagement';
const routes = [
{
......@@ -76,6 +77,10 @@ const routes = [
path: "/home/monthly-report",
main: MonthlyReport
},
{
path: "/home/document-management",
main: DocumentManagement
},
{
path: "*",
main: screen404
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment