Commit b41b6449 authored by EKSAD's avatar EKSAD

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

parents ea77a9f6 0a5c464e
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"moment": "^2.27.0", "moment": "^2.27.0",
"mui-datatables": "^3.3.1", "mui-datatables": "^3.3.1",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"ramda": "^0.27.1",
"react": "^16.13.1", "react": "^16.13.1",
"react-bootstrap": "^1.3.0", "react-bootstrap": "^1.3.0",
"react-d3-donut": "^1.1.2", "react-d3-donut": "^1.1.2",
......
...@@ -79,6 +79,12 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -79,6 +79,12 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
//UNIT BISNIS //UNIT BISNIS
const getUnitBisnis = () => api.get('business_unit/get_all_business_unit') const getUnitBisnis = () => api.get('business_unit/get_all_business_unit')
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)
// APPROVAL MATRIX
const getAM = () => api.get('approval_matrix/get_all_approval_matrix')
// ------ // ------
// STEP 3 // STEP 3
...@@ -105,7 +111,11 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') ...@@ -105,7 +111,11 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
editRole, editRole,
deleteRole, deleteRole,
getMenu, getMenu,
getUnitBisnis getUnitBisnis,
createUnitBisnis,
updateUnitBisnis,
searchUnitBisnis,
getAM
} }
} }
......
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
background-color: #fff; } background-color: #fff; }
.app-popup-show { .app-popup-show {
display: flex; display: flex;
z-index: 1290;
-webkit-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1); -webkit-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1);
-moz-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1); -moz-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1);
-ms-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1); -ms-transition: all 0.35s cubic-bezier(0, 1, 0.5, 1);
...@@ -192,7 +192,8 @@ export default function MiniDrawer() { ...@@ -192,7 +192,8 @@ export default function MiniDrawer() {
> >
<div className={classes.toolbarDrawer} style={{ <div className={classes.toolbarDrawer} style={{
backgroundColor: '#51c6ea', backgroundColor: '#51c6ea',
height: open ? 152 : 68 height: open ? null : 68,
paddingBottom: open ? 25 : null
}}> }}>
<div style={{ display: 'flex', justifyContent: 'space-between', flex: 1, padding: 10 }}> <div style={{ display: 'flex', justifyContent: 'space-between', flex: 1, padding: 10 }}>
<img src={Images.triputra} alt="React Logo" style={{ height: 31, width: 151, alignSelf: 'center' }} /> <img src={Images.triputra} alt="React Logo" style={{ height: 31, width: 151, alignSelf: 'center' }} />
...@@ -218,13 +219,13 @@ export default function MiniDrawer() { ...@@ -218,13 +219,13 @@ export default function MiniDrawer() {
</div> </div>
} }
{open && {open &&
<div style={{ marginLeft: 25, marginTop: 20, marginBottom: 20 }}> <div style={{ marginLeft: 20, marginTop: 20 }}>
<Typography style={{ color: 'white', fontSize: 12 }}>APLIKASI</Typography> <Typography style={{ color: 'white', fontSize: 12 }}>APLIKASI</Typography>
</div> </div>
} }
<List> <List>
{ArraySide.map((item, index) => ( {ArraySide.map((item, index) => (
<div> <div style={{ marginTop: index === 0 ? null : 10}}>
{item.subItem != null ? {item.subItem != null ?
<div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingRight: 10 }} onClick={() => selectedIndex == 0 ? setSelectedIndex(index) : setSelectedIndex(0)}> <div style={{ justifyContent: 'space-between', flexDirection: 'row', display: 'flex', paddingRight: 10 }} onClick={() => selectedIndex == 0 ? setSelectedIndex(index) : setSelectedIndex(0)}>
<ListItem button key={item.label}> <ListItem button key={item.label}>
......
...@@ -9,6 +9,7 @@ import CreateUnitBisnis from "./formUnitBisnis/CreateUnitBisnis"; ...@@ -9,6 +9,7 @@ import CreateUnitBisnis from "./formUnitBisnis/CreateUnitBisnis";
import { TextField, InputBase } from "@material-ui/core"; import { TextField, InputBase } from "@material-ui/core";
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import api from "../../api"; import api from "../../api";
import { isThisSecond } from "date-fns";
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -90,18 +91,45 @@ export default class UnitBisnis extends Component { ...@@ -90,18 +91,45 @@ export default class UnitBisnis extends Component {
} }
} }
handleInputChange = (e) => { handleInputChange(e) {
// Immediately update the state this.setState({ search: e })
this.setState({ let body = {
search: e.target.value "keyword": e
}
api.create().searchUnitBisnis(body).then(response => {
// console.log(response.data);
if (response.data.status == 'success') {
let data = response.data.data
let listData = data.map((item, index) => {
return [index, item.business_unit_id, item.business_unit_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
} else {
alert(response.data.message)
}
}) })
}
// Execute the debounced onChange method updateUnitBisnis = (payload) => {
this.onChangeDebounced(e) this.setState({ visibleEdit: false })
api.create().updateUnitBisnis(payload).then(response => {
if (response.data.status == 'success') {
this.getData()
} else {
alert(response.data.message)
}
})
} }
onChangeDebounced = (e) => { createUnitBisnis = (payload) => {
// Delayed logic goes here this.setState({ visibleCreate: false })
api.create().createUnitBisnis(payload).then(response => {
if (response.data.status == 'success') {
this.getData()
} else {
alert(response.data.message)
}
})
} }
render() { render() {
...@@ -175,18 +203,19 @@ export default class UnitBisnis extends Component { ...@@ -175,18 +203,19 @@ export default class UnitBisnis extends Component {
{this.state.visibleUnitBisnis === true ? {this.state.visibleUnitBisnis === true ?
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center' }}>Master Data - Unit Bisnis</label> <label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Master Data - Unit Bisnis</label>
<div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5 }}> <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
<img src={Images.searchBlack} style={{ marginRight: 10 }} /> <img src={Images.searchBlack} style={{ marginRight: 10 }} />
<InputBase <InputBase
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder="Search" placeholder="Search"
value={this.state.search} value={this.state.search}
onChange={(e) => this.handleInputChange(e)} onChange={(e) => this.handleInputChange(e.target.value)}
inputProps={{ 'aria-label': 'naked' }} inputProps={{ 'aria-label': 'naked' }}
/> />
{/* <input type="text" value={this.state.search} onChange={(e)=> this.setState({ search: e.target.value})} style={{ width: '100%'}} /> */}
</div> </div>
<div style={{ width: '20%', justifyContent: 'space-around', display: 'flex' }}> <div style={{ width: '30%', justifyContent: 'space-around', display: 'flex', flexFlow: 'wrap' }}>
<img src={Images.template} /> <img src={Images.template} />
<button <button
style={{ style={{
...@@ -244,7 +273,7 @@ export default class UnitBisnis extends Component { ...@@ -244,7 +273,7 @@ export default class UnitBisnis extends Component {
<button <button
type="button" type="button"
onClick={() => this.setState({ visibleUnitBisnis: true })} onClick={() => this.setState({ visibleUnitBisnis: true })}
style={{ marginRight: 20}} style={{ marginRight: 20 }}
> >
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Batal</span> <span style={{ color: '#354960', fontSize: 11 }}>Batal</span>
...@@ -260,6 +289,8 @@ export default class UnitBisnis extends Component { ...@@ -260,6 +289,8 @@ export default class UnitBisnis extends Component {
{this.state.visibleCreate && ( {this.state.visibleCreate && (
<CreateUnitBisnis <CreateUnitBisnis
onClickClose={() => this.setState({ visibleCreate: false })} onClickClose={() => this.setState({ visibleCreate: false })}
type={"create"}
createUnitBisnis={this.createUnitBisnis.bind(this)}
/> />
)} )}
...@@ -268,6 +299,7 @@ export default class UnitBisnis extends Component { ...@@ -268,6 +299,7 @@ export default class UnitBisnis extends Component {
type={"edit"} type={"edit"}
onClickClose={() => this.setState({ visibleEdit: false })} onClickClose={() => this.setState({ visibleEdit: false })}
data={this.state.listData[this.state.selectIndex]} data={this.state.listData[this.state.selectIndex]}
updateUnitBisnis={this.updateUnitBisnis.bind(this)}
/> />
)} )}
{this.state.visibleUpload && ( {this.state.visibleUpload && (
......
...@@ -8,6 +8,7 @@ import AddRole from './UserRole/AddRole'; ...@@ -8,6 +8,7 @@ import AddRole from './UserRole/AddRole';
import EditRole from './UserRole/EditRole' import EditRole from './UserRole/EditRole'
import api from "../../api"; import api from "../../api";
import { titleCase } from "../../library/Utils"; import { titleCase } from "../../library/Utils";
import { InputAdornment, TextField } from "@material-ui/core";
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -148,16 +149,42 @@ export default class UserRole extends Component { ...@@ -148,16 +149,42 @@ export default class UserRole extends Component {
<div style={{ height: 199, backgroundColor: '#354960', width: '100%' }} /> <div style={{ height: 199, backgroundColor: '#354960', width: '100%' }} />
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -150 }}>
<label style={{ color: 'white', width: '20%', alignSelf: 'center'}}>Master Data - Role & Otorisasi</label> <label style={{ fontFamily: 'nunito', color: 'white', width: '20%', alignSelf: 'center', fontSize: 18}}>Master Data - User</label>
<div style={{width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}> <div style={{width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
<div style={{width: '50%', backgroundColor:'white', padding: 10, borderRadius: 7.5, flexDirection: 'row', display: 'flex'}}> <div style={{width: '50%', backgroundColor:'white', padding: 10, borderRadius: 7.5}}>
<SearchIcon/> <TextField
<input type="text" placeholder={'Search Role'} style={{flexGrow: 1, marginLeft: 10}}/> id="input-with-icon-textfield"
name="search"
value={this.state.search}
placeholder={'Search'}
onChange={(e) => {
this.setState({ search: e.target.value }, () => {
if (this.state.search.length > 0) {
this.searchRole()
} else {
this.getRole()
}
});
}}
onKeyDown={(e) => this._handleKeyDown(e)}
style={{width: '100%', borderBottomWidth: 0, borderBottomColor: 'red'}}
InputProps={{
style: { fontFamily: 'nunito', borderBottomColor: 'white'},
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
}}
/>
</div> </div>
</div> </div>
{/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */} {/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */}
<div style={{ width: '20%', justifyContent: 'flex-end', display: 'flex' }}> <div style={{ width: '20%', justifyContent: 'flex-end', display: 'flex' }}>
<img src={Images.add} onClick={() => this.setState({add: true})}/> <img src={Images.template}/>
<img src={Images.upload} style={{marginLeft: 20}}/>
<img src={Images.download} style={{marginLeft: 20}}/>
<img src={Images.add} onClick={() => this.setState({add: true})} style={{marginLeft: 20}}/>
</div> </div>
</div> </div>
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
......
...@@ -184,19 +184,12 @@ class UserRole extends Component { ...@@ -184,19 +184,12 @@ class UserRole extends Component {
<label style={{ fontFamily: 'nunito', color: 'white', width: '20%', alignSelf: 'center', fontSize: 18}}>Master Data - Role & Otorisasi</label> <label style={{ fontFamily: 'nunito', color: 'white', width: '20%', alignSelf: 'center', fontSize: 18}}>Master Data - Role & Otorisasi</label>
<div style={{width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}> <div style={{width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
<div style={{width: '50%', backgroundColor:'white', padding: 10, borderRadius: 7.5}}> <div style={{width: '50%', backgroundColor:'white', padding: 10, borderRadius: 7.5}}>
{/* <SearchIcon/> */}
<TextField <TextField
// className={classes.margin}
id="input-with-icon-textfield" id="input-with-icon-textfield"
// label="TextField"
name="search" name="search"
value={this.state.search} value={this.state.search}
placeholder={'Search Role'} placeholder={'Search'}
onChange={(e) => { onChange={(e) => {
// let { search } = this.state;
// search = [...search];
// search.push(e.target.value);
// search[0] = search;
this.setState({ search: e.target.value }, () => { this.setState({ search: e.target.value }, () => {
if (this.state.search.length > 0) { if (this.state.search.length > 0) {
this.searchRole() this.searchRole()
......
...@@ -235,6 +235,7 @@ export default class AddRole extends Component { ...@@ -235,6 +235,7 @@ export default class AddRole extends Component {
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')}
minDate={this.state.startDate}
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
......
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