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
2cc73dd6
Commit
2cc73dd6
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
1039484f
83cb8d8a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
180 additions
and
63 deletions
+180
-63
Images.js
src/assets/Images.js
+1
-0
triputra-logo.png
src/assets/triputra-logo.png
+0
-0
Home.js
src/container/Home.js
+38
-13
AddUser.js
src/container/Otorisasi/User/AddUser.js
+16
-9
EditUser.js
src/container/Otorisasi/User/EditUser.js
+16
-9
Profile.js
src/container/Profile.js
+109
-32
No files found.
src/assets/Images.js
View file @
2cc73dd6
...
...
@@ -43,6 +43,7 @@ const Images = {
logout
:
require
(
'./setting.png'
),
setting
:
require
(
'./logout.png'
),
failedCopy
:
require
(
'./failed-copy.svg'
),
triputraLogo
:
require
(
'./triputra-logo.png'
)
}
...
...
src/assets/triputra-logo.png
0 → 100644
View file @
2cc73dd6
1.42 KB
src/container/Home.js
View file @
2cc73dd6
...
...
@@ -69,6 +69,30 @@ const useStyles = makeStyles((theme) => ({
flexShrink
:
0
,
whiteSpace
:
'nowrap'
,
},
topleftOpen
:
{
width
:
drawerWidth
,
borderRight
:
0
,
transition
:
theme
.
transitions
.
create
(
'width'
,
{
easing
:
theme
.
transitions
.
easing
.
sharp
,
duration
:
theme
.
transitions
.
duration
.
enteringScreen
,
}),
backgroundColor
:
'#1a2d3e'
},
topleftClose
:
{
borderRight
:
0
,
transition
:
theme
.
transitions
.
create
(
'width'
,
{
easing
:
theme
.
transitions
.
easing
.
sharp
,
duration
:
theme
.
transitions
.
duration
.
leavingScreen
,
}),
overflowX
:
'hidden'
,
width
:
theme
.
spacing
(
3
)
+
2
,
height
:
'78px'
,
[
theme
.
breakpoints
.
up
(
'sm'
)]:
{
width
:
theme
.
spacing
(
7
)
+
1
,
},
paddingLeft
:
15
,
backgroundColor
:
'#1a2d3e'
},
drawerOpen
:
{
width
:
drawerWidth
,
borderRight
:
0
,
...
...
@@ -76,7 +100,7 @@ const useStyles = makeStyles((theme) => ({
easing
:
theme
.
transitions
.
easing
.
sharp
,
duration
:
theme
.
transitions
.
duration
.
enteringScreen
,
}),
backgroundColor
:
'#f6f7f9'
backgroundColor
:
'#f6f7f9'
,
},
drawerClose
:
{
borderRight
:
0
,
...
...
@@ -89,7 +113,7 @@ const useStyles = makeStyles((theme) => ({
[
theme
.
breakpoints
.
up
(
'sm'
)]:
{
width
:
theme
.
spacing
(
7
)
+
1
,
},
backgroundColor
:
'#f6f7f9'
backgroundColor
:
'#f6f7f9'
,
},
toolbar
:
{
display
:
'flex'
,
...
...
@@ -300,7 +324,6 @@ export default function MiniDrawer() {
if
(
response
.
data
.
status
==
'success'
)
{
setUserFullname
(
response
.
data
.
data
.
fullname
==
null
?
'Anonym'
:
response
.
data
.
data
.
fullname
)
setUserEmail
(
response
.
data
.
data
.
email
==
null
?
'Anonym@123.xyz'
:
response
.
data
.
data
.
email
)
console
.
log
(
userEmail
)
}
})
}
...
...
@@ -367,20 +390,22 @@ export default function MiniDrawer() {
}),
}}
>
<
div
className
=
{
classes
.
toolbarDrawer
}
style
=
{{
backgroundColor
:
'#1a2d3e'
,
height
:
open
?
203
:
78
,
paddingLeft
:
open
?
null
:
55
,
display
:
open
?
null
:
'grid'
,
// paddingBottom: open ? 55 : null,
alignSelf
:
open
?
null
:
'center'
<
div
className
=
{
clsx
(
classes
.
drawer
,
{
[
classes
.
topleftOpen
]:
open
,
[
classes
.
topleftClose
]:
!
open
,
})}
classes
=
{{
paper
:
clsx
({
[
classes
.
topleftOpen
]:
open
,
[
classes
.
topleftClose
]:
!
open
,
}),
}}
>
{
open
===
true
?
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'space-between'
,
flex
:
1
,
padding
:
10
}}
>
<
img
src
=
{
Images
.
triputra
}
alt
=
"React Logo"
style
=
{{
height
:
31
,
width
:
151
,
alignSelf
:
'center'
}}
/
>
<
img
src
=
{
Images
.
triputra
}
alt
=
"React Logo"
style
=
{{
height
:
31
,
width
:
151
,
alignSelf
:
'center'
,
marginLeft
:
5
}}
/
>
<
IconButton
onClick
=
{
handleDrawerClose
}
style
=
{{
outline
:
'none'
}}
>
<
ChevronLeft
Icon
style
=
{{
fill
:
'white'
}}
/
>
<
Menu
Icon
style
=
{{
fill
:
'white'
}}
/
>
<
/IconButton
>
<
/div>
:
<
IconButton
...
...
@@ -393,7 +418,7 @@ export default function MiniDrawer() {
[
classes
.
hide
]:
open
,
})}
>
<
MenuIcon
style
=
{{
fill
:
'white'
}}
/
>
<
img
src
=
{
Images
.
triputraLogo
}
alt
=
"React Logo"
style
=
{{
height
:
30
,
width
:
30
,
alignSelf
:
'center'
,
marginTop
:
10
}}
/
>
<
/IconButton>
}
{
open
&&
<
div
style
=
{{
width
:
'100%'
,
marginTop
:
15
,
marginBottom
:
60
}}
>
...
...
src/container/Otorisasi/User/AddUser.js
View file @
2cc73dd6
...
...
@@ -178,12 +178,19 @@ export default class AddUser extends Component {
<
ul
>
{
item
.
child
.
map
((
data
,
index
)
=>
{
return
(
<
li
>
//
<li>
<
Collapse
key
=
{
index
}
timeout
=
"auto"
unmountOnExit
in
=
{
item
.
collapse
}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
child
)
?
(
padding
+
20
)
:
padding
}}
>
{
!
R
.
isNil
(
data
.
child
)
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
R
.
isNil
(
data
.
child
)?
null
:
data
.
child
.
length
<
1
?
null
:
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
/span>
}
<
span
>
<
CustomCheckbox
checked
=
{
this
.
handleItemChecked
(
data
)}
...
...
@@ -194,7 +201,7 @@ export default class AddUser extends Component {
<
/div
>
{
!
R
.
isNil
(
data
.
child
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
<
/Collapse
>
<
/li
>
//
</li>
)
})}
<
/ul
>
...
...
@@ -436,8 +443,8 @@ export default class AddUser extends Component {
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
<
ul
>
<
li
>
{
/*
<ul>
<li>
*/
}
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
{
item
.
child
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
item
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
...
...
@@ -451,8 +458,8 @@ export default class AddUser extends Component {
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
item
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
item
.
child
)
&&
this
.
renderChildren
(
item
)}
<
/li
>
<
/ul
>
{
/*
</li>
</ul>
*/
}
<
/div
>
)
})}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
2cc73dd6
...
...
@@ -214,12 +214,19 @@ export default class EditUser extends Component {
<
ul
>
{
item
.
child
.
map
((
data
,
index
)
=>
{
return
(
<
li
>
//
<li>
<
Collapse
key
=
{
index
}
timeout
=
"auto"
unmountOnExit
in
=
{
item
.
collapse
}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
child
)
?
(
padding
+
20
)
:
padding
}}
>
{
!
R
.
isNil
(
data
.
child
)
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
R
.
isNil
(
data
.
child
)?
null
:
data
.
child
.
length
<
1
?
null
:
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
/span>
}
<
span
>
<
CustomCheckbox
checked
=
{
this
.
handleItemChecked
(
data
)}
...
...
@@ -230,7 +237,7 @@ export default class EditUser extends Component {
<
/div
>
{
!
R
.
isNil
(
data
.
child
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
<
/Collapse
>
<
/li
>
//
</li>
)
})}
<
/ul
>
...
...
@@ -473,8 +480,8 @@ export default class EditUser extends Component {
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
<
ul
>
<
li
>
{
/*
<ul>
<li>
*/
}
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
}}
>
{
item
.
child
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
item
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
...
...
@@ -488,8 +495,8 @@ export default class EditUser extends Component {
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
item
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
item
.
child
)
&&
this
.
renderChildren
(
item
)}
<
/li
>
<
/ul
>
{
/*
</li>
</ul>
*/
}
<
/div
>
)
})}
...
...
src/container/Profile.js
View file @
2cc73dd6
...
...
@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
import
RemoveIcon
from
'@material-ui/icons/Remove'
;
import
AddIcon
from
'@material-ui/icons/Add'
;
import
{
titleCase
}
from
'../library/Utils'
;
import
*
as
R
from
'ramda'
const
CustomCheckbox
=
withStyles
({
root
:
{
...
...
@@ -145,6 +146,97 @@ export default class Profile extends Component {
return
indexID
==
-
1
?
false
:
true
}
renderChildren
=
(
item
,
pad
)
=>
{
let
padding
=
null
if
(
pad
!==
undefined
)
{
padding
=
pad
}
else
{
padding
=
20
}
return
(
<
ul
>
{
item
.
child
.
map
((
data
,
index
)
=>
{
return
(
// <li>
<
Collapse
key
=
{
index
}
timeout
=
"auto"
unmountOnExit
in
=
{
item
.
collapse
}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
R
.
isNil
(
data
.
child
)
?
(
padding
+
20
)
:
padding
}}
>
{
R
.
isNil
(
data
.
child
)?
null
:
data
.
child
.
length
<
1
?
null
:
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
data
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
data
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
span
>
<
CustomCheckbox
checked
=
{
this
.
handleItemChecked
(
data
)}
onChange
=
{()
=>
null
}
/
>
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
child
)
&&
this
.
renderChildren
(
data
,
padding
+
20
)}
<
/Collapse
>
// </li>
)
})}
<
/ul
>
)
}
handleCollapse
(
item
)
{
let
path
=
this
.
searchIt
({
child
:
this
.
state
.
listCompany
},
item
.
company_id
)
let
listCompany
=
this
.
state
.
listCompany
let
arrayPath
=
[]
if
(
path
.
length
>
1
)
{
arrayPath
=
path
.
split
(
'-'
);
arrayPath
=
arrayPath
.
map
((
item
)
=>
{
return
item
})
}
else
{
arrayPath
.
push
(
path
)
}
let
pathSelect
=
null
if
(
arrayPath
.
length
==
1
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]]
}
else
if
(
arrayPath
.
length
==
2
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]]
}
else
if
(
arrayPath
.
length
==
3
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]].
child
[
arrayPath
[
2
]]
}
else
if
(
arrayPath
.
length
==
4
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]].
child
[
arrayPath
[
2
]].
child
[
arrayPath
[
3
]]
}
else
if
(
arrayPath
.
length
==
5
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]].
child
[
arrayPath
[
2
]].
child
[
arrayPath
[
3
]].
child
[
arrayPath
[
4
]]
}
else
if
(
arrayPath
.
length
==
6
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]].
child
[
arrayPath
[
2
]].
child
[
arrayPath
[
3
]].
child
[
arrayPath
[
4
]].
child
[
arrayPath
[
5
]]
}
else
if
(
arrayPath
.
length
==
7
)
{
pathSelect
=
listCompany
[
arrayPath
[
0
]].
child
[
arrayPath
[
1
]].
child
[
arrayPath
[
2
]].
child
[
arrayPath
[
3
]].
child
[
arrayPath
[
4
]].
child
[
arrayPath
[
5
]].
child
[
arrayPath
[
6
]]
}
pathSelect
.
collapse
=
!
pathSelect
.
collapse
// console.log(pathSelect.collapse)
this
.
setState
({
listCompany
},
()
=>
console
.
log
(
pathSelect
))
}
searchIt
=
(
node
,
search
,
path
=
''
,
position
=
0
)
=>
{
if
(
node
.
company_id
&&
node
.
company_id
===
search
)
{
return
path
!==
''
?
`
${
path
}
-
${
position
}
`
:
position
;}
if
(
!
node
.
child
)
{
return
false
}
const
index
=
node
.
child
.
findIndex
((
x
)
=>
x
.
company_id
&&
x
.
company_id
===
search
);
if
(
index
>=
0
)
{
return
path
!==
''
?
`
${
path
}
-
${
index
}
`
:
index
;
}
for
(
let
i
=
0
;
i
<
node
.
child
.
length
;
i
++
)
{
const
result
=
this
.
searchIt
(
node
.
child
[
i
],
search
,
path
!==
''
?
`
${
path
}
-
${
i
}
`
:
i
,
i
);
if
(
result
){
return
result
;
}
}
return
false
;
};
render
()
{
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
...
...
@@ -249,38 +341,23 @@ export default class Profile 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
.
handleCollapse
(
item
)}
style
=
{{
marginLeft
:
7
,
marginRight
:
2
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
span
>
<
CustomCheckbox
disabled
=
{
true
}
disabled
=
{
true
}
checked
=
{
this
.
handleItemChecked
(
item
)}
// onChange={() => this.handleItemClick(item)
}
onChange
=
{()
=>
null
}
/
>
<
/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
:
30
,
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
disabled
=
{
true
}
checked
=
{
this
.
handleItemChecked
(
items
)}
// onChange={() => this.handleItemClick(items)}
/
>
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
items
.
company_name
)}
<
/Typography
>
<
/div
>
<
/Collapse
>
)
})}
{
!
R
.
isNil
(
item
.
child
)
&&
this
.
renderChildren
(
item
)}
{
/* </li>
</ul> */
}
<
/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