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
77dd2065
Commit
77dd2065
authored
Aug 16, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
12f6c03d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
+28
-24
User.js
src/container/Otorisasi/User.js
+3
-3
EditUser.js
src/container/Otorisasi/User/EditUser.js
+25
-21
No files found.
src/container/Otorisasi/User.js
View file @
77dd2065
...
...
@@ -47,7 +47,7 @@ export default class UserRole extends Component {
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
sort
((
a
,
b
)
=>
a
.
user_id
-
b
.
user_id
).
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
user_id
,
item
.
fullname
===
null
?
'-'
:
item
.
fullname
,
item
.
email
,
item
.
role_name
,
'-'
,
item
.
status
]
return
[
index
,
item
.
user_id
,
item
.
fullname
===
null
?
'-'
:
item
.
fullname
,
item
.
email
,
item
.
role_name
,
item
.
totalCompany
,
item
.
status
]
})
this
.
setState
({
listUser
:
listData
})
}
else
{
...
...
@@ -64,7 +64,7 @@ export default class UserRole extends Component {
if
(
response
.
data
.
status
===
'success'
)
{
let
data
=
response
.
data
.
data
let
listData
=
data
.
sort
((
a
,
b
)
=>
a
.
user_id
-
b
.
user_id
).
map
((
item
,
index
)
=>
{
return
[
index
,
item
.
user_id
,
item
.
fullname
==
null
?
'-'
:
item
.
fullname
,
item
.
email
,
item
.
role_name
,
'-'
,
item
.
status
]
return
[
index
,
item
.
user_id
,
item
.
fullname
==
null
?
'-'
:
item
.
fullname
,
item
.
email
,
item
.
role_name
,
item
.
totalCompany
,
item
.
status
]
})
this
.
setState
({
listUser
:
listData
})
}
else
{
...
...
@@ -271,7 +271,7 @@ export default class UserRole extends Component {
if
(
this
.
state
.
search
.
length
>
0
)
{
this
.
searchUser
()
}
else
{
this
.
get
Role
()
this
.
get
User
()
}
}
}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
77dd2065
...
...
@@ -201,6 +201,29 @@ 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>
// )
// })
}
render
()
{
return
(
<
div
className
=
"test app-popup-show"
>
...
...
@@ -388,7 +411,7 @@ export default class EditUser extends Component {
return
(
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
{
item
.
child
Company
.
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'} /
>
}
<
/span>
}
<
span
>
...
...
@@ -399,26 +422,7 @@ export default class EditUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
item
.
company_name
)}
<
/Typography
>
<
/div
>
{
item
.
childCompany
.
length
>
0
&&
item
.
childCompany
.
map
((
items
,
indexs
)
=>
{
return
(
<
Collapse
in
=
{
index
===
this
.
state
.
selectedIndex
}
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
>
)
})}
{
this
.
renderChild
(
item
,
index
)}
<
/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