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