Commit 52fc15e9 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'rifka' into 'master'

update apprv matrix

See merge request !219
parents ed543fff 53d9c7b9
......@@ -39,6 +39,9 @@ export default class ApprovalMatrix extends Component {
rows: null,
dataLoaded: false,
popupError: false,
alert: false,
tipeAlert: '',
messageAlert: '',
btncreate: false,
btnedit: false,
load: false,
......@@ -75,10 +78,11 @@ export default class ApprovalMatrix extends Component {
this.setState({ payload: body, buttonError: false })
api.create().checkUploadAM(body).then(response => {
// console.log(response.data)
let dataRow = []
if(response.data){
if (response.ok) {
if (response.data.status === "success") {
let dataRow = response.data.data.map((item, index) => {
dataRow = response.data.data.map((item, index) => {
return [
index + 1,
item.approval_type_name,
......@@ -91,7 +95,7 @@ export default class ApprovalMatrix extends Component {
]
})
let columns = [
"ID",
"Data",
{
name: "Approval Type",
options: {
......@@ -257,7 +261,7 @@ export default class ApprovalMatrix extends Component {
rows: dataRow
});
} else {
this.setState({ dataLoaded: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Token")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -267,7 +271,7 @@ export default class ApprovalMatrix extends Component {
})
}
} else {
this.setState({ dataLoaded: false, alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({
......@@ -303,6 +307,8 @@ export default class ApprovalMatrix extends Component {
load: true
})
}
} else {
this.setState({ load: true })
}
})
}
......@@ -820,7 +826,7 @@ export default class ApprovalMatrix extends Component {
{this.state.visibleUpload && (
<div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x" style={{ backgroundColor: '#51c6ea', height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
<div className="popup-title">
<span style={{ color: '#fff', fontSize: 16, fontWeight: 'bold' }}>Upload File</span>
......
......@@ -215,7 +215,6 @@ export default class CreateApprovalMatrix extends Component {
this.setState({ errorOrder: true, msgErrOrder: 'Order Cannot be Empty.'})
}
else if (R.isNil(this.state.userId)) {
// return alert("Pemberi Persetujuan tidak boleh kosong");
this.setState({ errorApproved: true, msgErrApproved: 'Approver Name Cannot be Empty.' })
}
else if (R.isNil(this.state.operatorId)) {
......
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