Commit 2b7d52e4 authored by EKSAD's avatar EKSAD

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

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