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 {
...
@@ -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> */
}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
2b7d52e4
...
@@ -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
>
)
)
})}
})}
...
...
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