Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
2b7d52e4
Commit
2b7d52e4
authored
Aug 17, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.44.149.204/d.arizona/tia-dev
into riri
parents
e7bedee0
39b359a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
32 deletions
+91
-32
User.js
src/container/Otorisasi/User.js
+22
-7
EditUser.js
src/container/Otorisasi/User/EditUser.js
+69
-25
No files found.
src/container/Otorisasi/User.js
View file @
2b7d52e4
...
...
@@ -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> */
}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
2b7d52e4
...
...
@@ -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
>
)
})}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment