Commit 3c4072ad authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

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

parents 865f91e5 d8554ae1
......@@ -12135,6 +12135,22 @@
"prop-types": "^15.7.2"
}
},
"react-tooltip": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-4.2.8.tgz",
"integrity": "sha512-pDWa0/khTAgIfldp95tHgyuYyBhWNlfaU2LF9ubAKxpoqNe15uyf+uLlnhK/Lstb6FU8E8/SL28Wp6oEO9xw3g==",
"requires": {
"prop-types": "^15.7.2",
"uuid": "^7.0.3"
},
"dependencies": {
"uuid": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg=="
}
}
},
"react-transition-group": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz",
......
......@@ -29,7 +29,8 @@
"react-excel-renderer": "^1.1.0",
"react-number-format": "^4.4.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
"react-scripts": "3.4.1",
"react-tooltip": "^4.2.8"
},
"scripts": {
"start": "react-scripts start",
......
......@@ -3,7 +3,7 @@ import apisauce from 'apisauce'
import Constant from '../library/Constant'
// our "constructor"
const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') => {
const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => {
// ------
// STEP 1
// ------
......@@ -83,6 +83,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
const createUnitBisnis = (body) => api.post('/business_unit/create_business_unit', body)
const updateUnitBisnis = (body) => api.post('/business_unit/update_business_unit', body)
const searchUnitBisnis = (body) => api.post('/business_unit/search_business_unit', body)
const checkUploadUnitBisnis = (body) => api.post('/business_unit/check_import', body)
// Perusahaan
const getPerusahaan = () => api.get('company/get_all_company')
......@@ -95,7 +96,16 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
const createAM = (body) => api.post('/approval_matrix/create_approval_matrix', body)
const updateAM = (body) => api.post('/approval_matrix/update_approval_matrix', body)
//User
const getUser = () => api.get('user/get_all_user')
const getDetailUser = (userId) => api.get(`user/get_user_by_id/${userId}`)
const searchUser = (body) => api.post('user/search_user', body)
const createUser = (body) => api.get('user/create_user', body)
const updateUser = (body) => api.get('user/update_user', body)
const deleteUser = (userId) => api.get(`user/delete_user/${userId}`)
//Template
const downloadTemplate = (fileName,fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
// ------
// STEP 3
// ------
......@@ -132,7 +142,15 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
updatePerusahaan,
getApprovedByAM,
createAM,
updateAM
updateAM,
getUser,
getDetailUser,
searchUser,
createUser,
updateUser,
deleteUser,
downloadTemplate,
checkUploadUnitBisnis
}
}
......
......@@ -59,6 +59,8 @@ export default class CreateApprovalMatrix extends Component {
// operator: '',
startDate: '',
endDate: '',
userData: [],
value: null
}
}
......@@ -83,7 +85,7 @@ export default class CreateApprovalMatrix extends Component {
options: userData,
getOptionLabel: (option) => option.fullname,
};
this.setState({ approvedBy: defaultProps, userData: response.data.data })
this.setState({ approvedBy: defaultProps, userData: response.data.data, value: userData[0] })
} else {
alert(response.data.message)
}
......@@ -239,6 +241,7 @@ export default class CreateApprovalMatrix extends Component {
onChange={(event, newInputValue) => this.setState({userId:newInputValue.user_id})}
debug
renderInput={(params) => <TextField {...params} label="debug" margin="normal" />}
value={this.state.value}
/>
</div>
</div>
......
......@@ -75,7 +75,9 @@ class Login extends Component {
}
api.create().login(payload).then((response) => {
if (response.data.status === 'success') {
console.log(response.data.data)
localStorage.setItem(Constant.TOKEN, response.data.data.token)
localStorage.setItem(Constant.USER, response.data.data.user_id)
if (this.state.rememberMe) {
localStorage.setItem(Constant.EMAIL, this.state.email)
localStorage.setItem(Constant.PASSWORD, this.state.password)
......
......@@ -12,6 +12,7 @@ export default class CreatePerusahaan extends Component {
company: '',
parentCompany: '',
unitBisnis: '',
totalReport: '',
startDate: '',
endDate: ''
......@@ -30,6 +31,7 @@ export default class CreatePerusahaan extends Component {
company: data.company_name,
parentCompany: data.parent,
unitBisnis: data.businessUnitId,
totalReport: data.total_report,
startDate: data.start_date,
endDate: data.end_date
})
......@@ -66,8 +68,9 @@ export default class CreatePerusahaan extends Component {
let payload = {
"company_id": this.state.id,
"company_name": this.state.company,
"parent": this.state.parentCompany,
"business_unit_id": this.state.unitBisnis,
"parent": this.state.parentCompany,
"total_report": this.state.totalReport,
"start_date": this.state.startDate,
"end_date": this.state.endDate
}
......@@ -277,6 +280,27 @@ export default class CreatePerusahaan extends Component {
style={{ padding: 0, margin: 0, width: '100%' }}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
id="report"
label="Jumlah Laporan"
value={this.state.totalReport}
inputProps={{
style: {
fontSize: 11
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085'
}
}}
onChange={(e) => this.setState({ totalReport: e.target.value })}
>
</TextField>
</div>
</div>
</div>
......@@ -469,7 +493,7 @@ export default class CreatePerusahaan extends Component {
>
</TextField>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="endDate"
......
This diff is collapsed.
......@@ -204,7 +204,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="startDate"
label="Berlaku Hingga"
label="Berakhir Hingga"
format="dd MMMM yyyy"
value={this.state.endDate}
onChange={(e) => this.handleChange(e, 'end_date')}
......@@ -381,7 +381,7 @@ export default class CreateUnitBisnis extends Component {
<DatePicker
margin="normal"
id="endDate"
label="Berlaku Hingga"
label="Berakhir Hingga"
format="dd MMMM yyyy"
value={this.state.endDate == "" ? null : this.state.endDate}
onChange={(e) => this.handleChange(e, 'end_date')}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
const Constant = {
TOKEN: null,
USER: null,
USER: 0,
EMAIL: 'TOKEN',
PASSWORD: 'PASSWORD'
......
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