Commit 353230fa authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'master' into 'faisal'

# Conflicts:
#   src/api/index.js
parents 464dde29 2821fd69
...@@ -1448,6 +1448,18 @@ ...@@ -1448,6 +1448,18 @@
"@babel/runtime": "^7.4.4" "@babel/runtime": "^7.4.4"
} }
}, },
"@material-ui/lab": {
"version": "4.0.0-alpha.56",
"resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.56.tgz",
"integrity": "sha512-xPlkK+z/6y/24ka4gVJgwPfoCF4RCh8dXb1BNE7MtF9bXEBLN/lBxNTK8VAa0qm3V2oinA6xtUIdcRh0aeRtVw==",
"requires": {
"@babel/runtime": "^7.4.4",
"@material-ui/utils": "^4.10.2",
"clsx": "^1.0.4",
"prop-types": "^15.7.2",
"react-is": "^16.8.0"
}
},
"@material-ui/pickers": { "@material-ui/pickers": {
"version": "3.2.10", "version": "3.2.10",
"resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.2.10.tgz", "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.2.10.tgz",
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"@date-io/moment": "^2.8.0", "@date-io/moment": "^2.8.0",
"@material-ui/core": "^4.11.0", "@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1", "@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/pickers": "^3.2.10", "@material-ui/pickers": "^3.2.10",
"@testing-library/jest-dom": "^4.2.4", "@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0", "@testing-library/react": "^9.5.0",
......
...@@ -91,6 +91,10 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -91,6 +91,10 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
// APPROVAL MATRIX // APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix') const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
const getApprovedByAM = () => api.get('approval_matrix/get_all_approver')
const createAM = (body) => api.post('/approval_matrix/create_approval_matrix', body)
const updateAM = (body) => api.post('/approval_matrix/update_approval_matrix', body)
// ------ // ------
// STEP 3 // STEP 3
...@@ -126,6 +130,9 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -126,6 +130,9 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
getPerusahaan, getPerusahaan,
createPerusahaan, createPerusahaan,
updatePerusahaan updatePerusahaan
getApprovedByAM,
createAM,
updateAM
} }
} }
......
...@@ -78,12 +78,6 @@ export default class ApprovalMatrix extends Component { ...@@ -78,12 +78,6 @@ export default class ApprovalMatrix extends Component {
getData() { getData() {
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
// console.log(response) // console.log(response)
let datas = response.data.data
let listData = datas.map((item, index) => {
return [item.fullname ]
})
console.log(listData)
if(response.status == null){ if(response.status == null){
alert(response.problem) alert(response.problem)
} }
...@@ -127,6 +121,17 @@ export default class ApprovalMatrix extends Component { ...@@ -127,6 +121,17 @@ export default class ApprovalMatrix extends Component {
// Delayed logic goes here // Delayed logic goes here
} }
createAM = (payload) => {
this.setState({ visibleCreate: false })
api.create().createAM(payload).then(response => {
if (response.data.status == 'success') {
this.getData()
} else {
alert(response.data.message)
}
})
}
render() { render() {
const columns = [{ const columns = [{
name: "Action", name: "Action",
...@@ -366,6 +371,7 @@ export default class ApprovalMatrix extends Component { ...@@ -366,6 +371,7 @@ export default class ApprovalMatrix extends Component {
<CreateApprovalMatrix <CreateApprovalMatrix
onClickClose={() => this.setState({ visibleCreate: false })} onClickClose={() => this.setState({ visibleCreate: false })}
data={this.state.listData} data={this.state.listData}
createAM={this.createAM.bind(this)}
/> />
)} )}
{this.state.visibleEdit && ( {this.state.visibleEdit && (
......
...@@ -126,7 +126,7 @@ export default class EditApprovalMatrix extends Component { ...@@ -126,7 +126,7 @@ export default class EditApprovalMatrix extends Component {
</div> </div>
</div> </div>
<div className="column-2"> <div className="column-2">
<div className="" style={{ paddingTop: 4, paddingRight: 10, paddingBottom: 10, paddingLeft: 10, borderRadius: 5 }}> <div className="" style={{ padding: 10, paddingLeft: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="type" id="type"
...@@ -134,7 +134,8 @@ export default class EditApprovalMatrix extends Component { ...@@ -134,7 +134,8 @@ export default class EditApprovalMatrix extends Component {
label="Tipe Persetujuan" label="Tipe Persetujuan"
value={this.props.data.approval_type_name} value={this.props.data.approval_type_name}
onChange={(e) => null} onChange={(e) => null}
selectProps={{ SelectProps={{
// native: true,
style: { style: {
fontSize: 11 fontSize: 11
} }
......
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