Commit 39b359a0 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

update didam

See merge request !99
parents 5f095c76 e21023af
......@@ -291,6 +291,7 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] === "Aktif" ?
<button
style={{
backgroundColor: 'transparent',
......@@ -302,6 +303,9 @@ export default class UserRole extends Component {
>
<img src={Images.editCopy} />
</button>
:
null
}
</div >
);
}
......@@ -312,7 +316,7 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
{val}
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
......@@ -323,7 +327,7 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
{titleCase(val)}
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
......@@ -334,7 +338,7 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
{titleCase(val)}
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
......@@ -345,7 +349,7 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex'}}>
{titleCase(val)}
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
......@@ -356,12 +360,23 @@ export default class UserRole extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{val}
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
}
}, {
name: "Status",
options: {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
<span style={{ color: tableMeta.rowData[6] === "Aktif" ? "#656565" : 'rgba(0, 0, 0, 0.25)' }}>{titleCase(val)}</span>
</div >
);
}
}
}, "Status"]
}]
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
......
......@@ -201,28 +201,55 @@ export default class EditUser extends Component {
this.setState({ company })
}
renderChild = (item, index) => {
console.log(item.child)
// item.child.map((items,indexs) => {
// return (
// // <Collapse in={true} timeout="auto" unmountOnExit>
// <div style={{ paddingLeft: 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
// {/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
// {index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
// </span>} */}
// {/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
// <span>
// <CustomCheckbox
// checked={this.handleItemChecked(items)}
// onChange={() => this.handleItemClick(items)}
// />
// </span>
// <Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
// </div>
// // </Collapse>
renderChildren = (item) => {
return (
<ul>
{item.child.map((data, index) => {
return (
<li>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{!R.isNil(data.child) && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>}
<span>
<CustomCheckbox
checked={this.handleItemChecked(data)}
onChange={() => this.handleItemClick(data)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(data.company_name)}</Typography>
</div>
{!R.isNil(data.child) && this.renderChildren(data)}
</li>
)
})}
</ul>
)
}
// )
// })
renderChild(item,index){
return (
item.child.map((items,indexs, paddingLeft) => {
return (
<div>
<div style={{ paddingLeft: R.isNil(items.child)? 120 : 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} */}
{/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
<span>
<CustomCheckbox
checked={this.handleItemChecked(items)}
onChange={() => this.handleItemClick(items)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
</div>
{!R.isNil(items.child) && this.renderChild(items,indexs)}
</div>
)
})
)
}
render() {
return (
......@@ -410,6 +437,8 @@ export default class EditUser extends Component {
{this.state.listCompany.map((item,index) => {
return(
<div>
<ul>
<li>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{item.child.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
......@@ -422,7 +451,22 @@ export default class EditUser extends Component {
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography>
</div>
{this.renderChild(item,index)}
{!R.isNil(item.child) && this.renderChildren(item, semriwing)}
</li>
</ul>
{/* <div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{item.child.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>}
<span>
<CustomCheckbox
checked={this.handleItemChecked(item)}
onChange={() => this.handleItemClick(item)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography>
</div> */}
{/* {this.renderChild(item,index, 0)} */}
</div>
)
})}
......
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