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
0484d044
Commit
0484d044
authored
Aug 24, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push didim
parent
2f4cacc7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
414 additions
and
80 deletions
+414
-80
OperatingIndicator.js
src/container/OperatingIndicator/OperatingIndicator.js
+173
-0
User.js
src/container/Otorisasi/User.js
+14
-14
AddUser.js
src/container/Otorisasi/User/AddUser.js
+42
-14
EditUser.js
src/container/Otorisasi/User/EditUser.js
+39
-12
UserRole.js
src/container/Otorisasi/UserRole.js
+7
-7
AddRole.js
src/container/Otorisasi/UserRole/AddRole.js
+85
-16
EditRole.js
src/container/Otorisasi/UserRole/EditRole.js
+49
-17
homeRoutes.js
src/router/homeRoutes.js
+5
-0
No files found.
src/container/OperatingIndicator/OperatingIndicator.js
0 → 100644
View file @
0484d044
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
Paper
,
TextField
,
MenuItem
}
from
'@material-ui/core'
;
import
MUIDataTable
from
'mui-datatables'
;
import
Images
from
'../../assets/Images'
;
import
BalanceSheet
from
'../BudgetTahunan/BalanceSheet'
;
export
default
class
BudgetTahunan
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
periode
:
'2020'
,
perusahaan
:
'TAP Group'
,
revisi
:
'0'
,
visibleBudgetTahunan
:
true
,
visibleBalanceSheet
:
false
}
}
render
()
{
const
columns
=
[
"#"
,
"Jenis Laporan"
,
{
name
:
"Status"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
val
==
'done'
?
<
img
src
=
{
Images
.
ceklis
}
style
=
{{
width
:
31
,
height
:
24
}}
/>
:
null
}
<
/div
>
);
}
}
},
{
name
:
"Action"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
}}
onClick
=
{()
=>
this
.
setState
({
visibleBudgetTahunan
:
false
,
visibleBalanceSheet
:
true
})}
>
<
Typography
style
=
{{
color
:
'#5198ea'
,
fontSize
:
12
,
}}
>
Detail
<
/Typography
>
<
/button
>
<
/div
>
);
}
}
}]
const
dataTable
=
[
[
"1"
,
"Balance Sheet"
,
"done"
],
[
"2"
,
"Profit & Loss"
,
""
],
[
"3"
,
"CAT"
,
"done"
],
[
"4"
,
"Fixed Assets Movement"
,
""
],
[
"5"
,
"Tax Planning"
,
"done"
],
[
"6"
,
"Balance Sheet"
,
"done"
],
[
"7"
,
"Profit & Loss"
,
""
],
[
"8"
,
"CAT"
,
"done"
],
[
"9"
,
"Fixed Assets Movement"
,
""
],
[
"10"
,
"Tax Planning"
,
"done"
],
[
"11"
,
"Balance Sheet"
,
"done"
],
[
"12"
,
"Profit & Loss"
,
"done"
],
[
"13"
,
"CAT"
,
"done"
],
[
"14"
,
"Fixed Assets Movement"
,
"done"
],
[
"15"
,
"Tax Planning"
,
"done"
],
]
const
options
=
{
filter
:
false
,
sort
:
false
,
responsive
:
"scroll"
,
print
:
false
,
download
:
false
,
selectableRows
:
false
,
viewColumns
:
false
,
rowsPerPage
:
5
,
rowsPerPageOptions
:
[
5
,
25
,
100
],
search
:
false
}
const
periode
=
[
{
value
:
'2020'
,
label
:
'2020'
},
{
value
:
'2019'
,
label
:
'2019'
},
{
value
:
'2018'
,
label
:
'2018'
},
{
value
:
'2017'
,
label
:
'2017'
},
{
value
:
'2016'
,
label
:
'2016'
},
]
const
perusahaan
=
[
{
value
:
'TAP Group'
,
label
:
'TAP Group'
},
{
value
:
'2019'
,
label
:
'2019'
},
{
value
:
'2018'
,
label
:
'2018'
},
{
value
:
'2017'
,
label
:
'2017'
},
{
value
:
'2016'
,
label
:
'2016'
},
]
const
revisi
=
[
{
value
:
'0'
,
label
:
'0'
},
{
value
:
'1'
,
label
:
'1'
},
]
return
(
<
div
style
=
{{
flex
:
1
,
backgroundColor
:
'#f8f8f8'
}}
>
{
this
.
state
.
visibleBudgetTahunan
&&
(
<
div
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
78
,
display
:
'flex'
,
alignItems
:
'center'
,
paddingLeft
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
'16px'
,
color
:
'white'
}}
>
Operating
Indicator
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
,
width
:
'100%'
}}
>
<
Paper
style
=
{{
paddingTop
:
10
}}
>
<
div
style
=
{{
borderBottom
:
'solid 1px #c4c4c4'
}}
>
<
Typography
style
=
{{
fontSize
:
'12px'
,
color
:
'#4b4b4b'
,
margin
:
10
}}
>
Operating
Indicator
<
/Typography
>
<
/div
>
<
div
style
=
{{
padding
:
20
}}
>
<
div
>
<
TextField
style
=
{{
width
:
250
,
}}
id
=
"periode"
select
label
=
"Periode"
value
=
{
this
.
state
.
periode
}
onChange
=
{(
e
)
=>
this
.
setState
({
periode
:
e
.
target
.
value
})}
>
{
periode
.
map
((
option
)
=>
(
<
MenuItem
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/MenuItem
>
))}
<
/TextField
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
TextField
style
=
{{
width
:
250
,
}}
id
=
"perusahaan"
select
label
=
"Perusahaan"
value
=
{
this
.
state
.
perusahaan
}
onChange
=
{(
e
)
=>
this
.
setState
({
perusahaan
:
e
.
target
.
value
})}
>
{
perusahaan
.
map
((
option
)
=>
(
<
MenuItem
key
=
{
option
.
value
}
value
=
{
option
.
value
}
>
{
option
.
label
}
<
/MenuItem
>
))}
<
/TextField
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
MUIDataTable
data
=
{
dataTable
}
columns
=
{
columns
}
options
=
{
options
}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
borderTop
:
'solid 1px #c4c4c4'
,
padding
:
10
,
backgroundColor
:
'#f5f5f5'
,
width
:
'100%'
,
display
:
'flex'
,
justifyContent
:
'flex-end'
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Submit
<
/Typography
>
<
/div
>
<
/div
>
<
/Paper
>
<
/div
>
<
/div
>
)}
{
this
.
state
.
visibleBalanceSheet
&&
(
<
BalanceSheet
/>
)}
<
/div
>
);
}
}
src/container/Otorisasi/User.js
View file @
0484d044
...
...
@@ -123,7 +123,7 @@ export default class UserRole extends Component {
let
body
=
{
user
:
payload
}
this
.
setState
({
payload
:
body
})
this
.
setState
({
payload
:
body
,
rows
:
[]
})
api
.
create
().
checkUploadUser
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
...
...
@@ -142,7 +142,7 @@ export default class UserRole extends Component {
let
columns
=
[
"Data Ke-"
,
"
Nama Lengkap
"
,
"
Full Name
"
,
{
name
:
"Email"
,
options
:
{
...
...
@@ -334,7 +334,7 @@ export default class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
{
/* {tableMeta.rowData[6] === "A
ktif
" ? */
}
{
/* {tableMeta.rowData[6] === "A
ctive
" ? */
}
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
@@ -359,18 +359,18 @@ export default class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"
Nama Lengkap
"
,
name
:
"
Full Name
"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
...
...
@@ -381,7 +381,7 @@ export default class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
...
...
@@ -392,18 +392,18 @@ export default class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
}
},
{
name
:
"
Perusahaan
"
,
name
:
"
Company
"
,
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
...
...
@@ -414,7 +414,7 @@ export default class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
6
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
...
...
@@ -423,14 +423,14 @@ export default class UserRole extends Component {
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
19
9
,
width
:
'100%'
}}
/
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
19
5
,
width
:
'100%'
}}
/
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
{
this
.
state
.
visibleUser
?
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
1
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
1
18
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
User
<
/label
>
{
/* <div style={{ width: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
<div style={{ width: '50%', backgroundColor: 'white', padding: 10, borderRadius: 7.5 }}>
...
...
@@ -523,7 +523,7 @@ export default class UserRole extends Component {
<
/button
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'
Tambah
'
}
data
-
for
=
"create"
>
<
a
data
-
tip
=
{
'
Create
'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
src/container/Otorisasi/User/AddUser.js
View file @
0484d044
...
...
@@ -270,11 +270,39 @@ export default class AddUser extends Component {
handleItemClick
(
item
)
{
let
indexID
=
this
.
state
.
company
.
findIndex
((
val
)
=>
val
===
item
.
id
)
let
listCompany
=
this
.
state
.
listCompany
let
company
=
this
.
state
.
company
if
(
indexID
===
-
1
)
{
company
.
push
(
item
.
id
)
if
(
item
.
parent
!==
null
)
{
let
indexIDs
=
this
.
state
.
company
.
findIndex
((
val
)
=>
val
===
item
.
parent
)
if
(
indexIDs
===
-
1
)
{
company
.
push
(
item
.
parent
)
}
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
this
.
handleItemClick
(
items
)
})
}
}
}
else
{
company
.
splice
(
indexID
,
1
)
if
(
item
.
parent
!==
null
)
{
let
indexIDs
=
this
.
state
.
company
.
findIndex
((
val
)
=>
val
===
item
.
parent
)
if
(
indexIDs
!==
-
1
)
{
company
.
splice
(
indexIDs
,
1
)
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
this
.
handleItemClick
(
items
)
})
}
}
}
}
this
.
setState
({
company
})
}
...
...
@@ -284,7 +312,7 @@ export default class AddUser extends Component {
if
(
pad
!==
undefined
)
{
padding
=
pad
}
else
{
padding
=
2
0
padding
=
3
0
}
return
(
<
div
>
...
...
@@ -294,7 +322,7 @@ export default class AddUser extends Component {
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
.
children
)
?
(
padding
+
20
)
:
padding
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
!
R
.
isNil
(
data
.
children
)?
(
data
.
children
.
length
>
0
?
padding
:
padding
+
30
)
:
padding
+
30
}}
>
{
R
.
isNil
(
data
.
children
)
?
null
:
...
...
@@ -324,7 +352,7 @@ export default class AddUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
2
0
)}
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
3
0
)}
<
/Collapse
>
// </li>
)
...
...
@@ -401,7 +429,7 @@ export default class AddUser extends Component {
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Ubah
Data
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Create
Data
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
...
...
@@ -456,7 +484,7 @@ export default class AddUser extends Component {
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
id
=
"fullname"
name
=
"fullname"
label
=
"
Nama Lengkap
"
label
=
"
Full Name
"
value
=
{
this
.
state
.
fullname
}
error
=
{
this
.
state
.
errorFullname
}
helperText
=
{
this
.
state
.
msgErrorFN
}
...
...
@@ -549,7 +577,7 @@ export default class AddUser extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"
Berlaku Mulai
"
label
=
"
Start Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
startDate
}
error
=
{
this
.
state
.
errorStartDate
}
...
...
@@ -582,7 +610,7 @@ export default class AddUser extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
label
=
"
Berlaku Hingga
"
label
=
"
End Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
}
error
=
{
this
.
state
.
errorEndDate
}
...
...
@@ -622,7 +650,7 @@ export default class AddUser extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
'A
ktif
'
}
value
=
{
'A
ctive
'
}
inputProps
=
{{
style
:
{
fontSize
:
11
,
...
...
@@ -656,7 +684,7 @@ export default class AddUser extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
'
T
'
}
value
=
{
'
N
'
}
inputProps
=
{{
style
:
{
fontSize
:
11
,
...
...
@@ -680,13 +708,13 @@ export default class AddUser extends Component {
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
{
/*
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}>
<Typography style={{ fontSize: 12 }}>{`Dibuat: `}</Typography>
<Typography style={{fontSize: 12}}>{`Diubah: `}</Typography>
<
/div
>
</div>
*/
}
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
h5
>
Otorisasi
Perusahaan
<
/h5
>
<
h5
>
Authorization
Company
<
/h5
>
<
div
style
=
{{
paddingLeft
:
10
,
overflow
:
'scroll'
,
height
:
'25vh'
}}
>
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -728,14 +756,14 @@ export default class AddUser extends Component {
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
<
button
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/Otorisasi/User/EditUser.js
View file @
0484d044
...
...
@@ -275,8 +275,35 @@ export default class EditUser extends Component {
let
company
=
this
.
state
.
company
if
(
indexID
===
-
1
)
{
company
.
push
(
item
.
id
)
if
(
item
.
parent
!==
null
)
{
let
indexIDs
=
this
.
state
.
company
.
findIndex
((
val
)
=>
val
===
item
.
parent
)
if
(
indexIDs
===
-
1
)
{
company
.
push
(
item
.
parent
)
}
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
this
.
handleItemClick
(
items
)
})
}
}
}
else
{
company
.
splice
(
indexID
,
1
)
if
(
item
.
parent
!==
null
)
{
let
indexIDs
=
this
.
state
.
company
.
findIndex
((
val
)
=>
val
===
item
.
parent
)
if
(
indexIDs
!==
-
1
)
{
company
.
splice
(
indexIDs
,
1
)
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
this
.
handleItemClick
(
items
)
})
}
}
}
}
this
.
setState
({
company
})
}
...
...
@@ -286,7 +313,7 @@ export default class EditUser extends Component {
if
(
pad
!==
undefined
)
{
padding
=
pad
}
else
{
padding
=
2
0
padding
=
3
0
}
return
(
<
div
>
...
...
@@ -296,7 +323,7 @@ export default class EditUser extends Component {
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
.
children
)
?
(
padding
+
20
)
:
padding
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
!
R
.
isNil
(
data
.
children
)?
(
data
.
children
.
length
>
0
?
padding
:
padding
+
30
)
:
padding
+
30
}}
>
{
R
.
isNil
(
data
.
children
)
?
null
:
...
...
@@ -326,7 +353,7 @@ export default class EditUser extends Component {
<
/span
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
titleCase
(
data
.
company_name
)}
<
/Typography
>
<
/div
>
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
2
0
)}
{
!
R
.
isNil
(
data
.
children
)
&&
this
.
renderChildren
(
data
,
padding
+
3
0
)}
<
/Collapse
>
// </li>
)
...
...
@@ -403,7 +430,7 @@ export default class EditUser extends Component {
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Ubah
Data
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Edit
Data
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
...
...
@@ -458,7 +485,7 @@ export default class EditUser extends Component {
style
=
{{
width
:
'100%'
,
marginTop
:
7
}}
id
=
"fullname"
name
=
"fullname"
label
=
"
Nama Lengkap
"
label
=
"
Full Name
"
value
=
{
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
fullname
}
onChange
=
{(
e
)
=>
this
.
handleChange
(
e
,
''
)}
// defaultValue="Default Value"
...
...
@@ -548,7 +575,7 @@ export default class EditUser extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"
Berlaku Mulai
"
label
=
"
Start Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
start_date
}
error
=
{
this
.
state
.
errorStartDate
}
...
...
@@ -580,7 +607,7 @@ export default class EditUser extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
label
=
"
Berlaku Hingga
"
label
=
"
End Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
end_date
}
error
=
{
this
.
state
.
errorEndDate
}
...
...
@@ -678,12 +705,12 @@ export default class EditUser extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Dibuat
:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
created
}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Diubah
:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
updated
}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Created by
:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
created
}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Updated by
:
${
this
.
state
.
tempData
===
null
?
''
:
this
.
state
.
tempData
.
updated
}
`
}
<
/Typography
>
<
/div
>
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
h5
>
Otorisasi
Perusahaan
<
/h5
>
<
h5
>
Authorization
Company
<
/h5
>
<
div
style
=
{{
paddingLeft
:
10
,
overflow
:
'scroll'
,
height
:
'25vh'
}}
>
{
this
.
state
.
listCompany
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -726,14 +753,14 @@ export default class EditUser extends Component {
<
div
className
=
"column-1"
style
=
{{
alignSelf
:
'center'
}}
>
<
button
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
/div
>
<
div
className
=
"column-2"
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
alignItems
:
'center'
}}
>
<
button
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/Otorisasi/UserRole.js
View file @
0484d044
...
...
@@ -157,7 +157,7 @@ class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
...
...
@@ -168,7 +168,7 @@ class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
titleCase
(
val
)}
<
/span
>
<
/div
>
);
}
...
...
@@ -179,7 +179,7 @@ class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
+
' Modul'
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
+
' Modul'
}
<
/span
>
<
/div
>
);
}
...
...
@@ -190,7 +190,7 @@ class UserRole extends Component {
customBodyRender
:
(
val
,
tableMeta
)
=>
{
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ktif
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
span
style
=
{{
color
:
tableMeta
.
rowData
[
4
]
===
"A
ctive
"
?
"#656565"
:
'rgba(0, 0, 0, 0.25)'
}}
>
{
val
}
<
/span
>
<
/div
>
);
}
...
...
@@ -199,14 +199,14 @@ class UserRole extends Component {
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
}}
>
{
/* <Row> */
}
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
19
9
,
width
:
'100%'
}}
/
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
19
5
,
width
:
'100%'
}}
/
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
1
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
1
18
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Role
&
Otorisasi
<
/label
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
<
img
src
=
{
Images
.
searchBlack
}
style
=
{{
marginRight
:
10
}}
/
>
...
...
@@ -228,7 +228,7 @@ class UserRole extends Component {
<
/div
>
{
/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */
}
<
div
style
=
{{
width
:
'20%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
}}
>
<
a
data
-
tip
=
{
'
Tambah
'
}
data
-
for
=
"create"
>
<
a
data
-
tip
=
{
'
Create
'
}
data
-
for
=
"create"
>
<
button
style
=
{{
backgroundColor
:
'transparent'
,
...
...
src/container/Otorisasi/UserRole/AddRole.js
View file @
0484d044
...
...
@@ -159,7 +159,8 @@ export default class AddRole extends Component {
menu_id
:
i
.
menu_id
,
label
:
i
.
menu_name
,
sub_menu
:
this
.
parseChildren
(
i
.
sub_menu
),
collapse
:
false
collapse
:
false
,
reference
:
i
.
reference
}
})
return
data
...
...
@@ -209,8 +210,76 @@ export default class AddRole extends Component {
menu_id
:
item
.
menu_id
,
button_id
:
[
1
,
2
,
3
]
})
if
(
item
.
sub_menu
.
length
>
0
)
{
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDs
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
if
(
indexIDs
===
-
1
)
{
privileges
.
push
({
menu_id
:
items
.
menu_id
,
button_id
:
[
1
,
2
,
3
]
})
}
})
}
if
(
item
.
reference
!==
null
&&
item
.
reference
!==
13
&&
item
.
reference
!==
1
)
{
let
indexIDapp
=
this
.
state
.
application
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDset
=
this
.
state
.
setting
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDref
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDs
=
indexIDapp
==
-
1
?
indexIDset
:
indexIDapp
let
total
=
0
let
array
=
indexIDapp
==
-
1
?
this
.
state
.
setting
:
this
.
state
.
application
array
[
indexIDs
].
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDsub
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
if
(
indexIDsub
!==
-
1
)
{
total
+=
1
}
})
if
(
indexIDref
==
-
1
)
{
privileges
.
push
({
menu_id
:
item
.
reference
,
button_id
:
[
1
,
2
,
3
]
})
}
else
{
if
(
total
<
1
)
{
privileges
.
splice
(
indexIDref
,
1
)
}
}
}
}
else
{
privileges
.
splice
(
indexID
,
1
)
if
(
item
.
sub_menu
.
length
>
0
)
{
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDs
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
privileges
.
splice
(
indexIDs
,
1
)
})
}
if
(
item
.
reference
!==
null
&&
item
.
reference
!==
13
&&
item
.
reference
!==
1
)
{
let
indexIDapp
=
this
.
state
.
application
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDset
=
this
.
state
.
setting
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDref
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
reference
)
let
indexIDs
=
indexIDapp
==
-
1
?
indexIDset
:
indexIDapp
let
total
=
0
let
array
=
indexIDapp
==
-
1
?
this
.
state
.
setting
:
this
.
state
.
application
array
[
indexIDs
].
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDsub
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
if
(
indexIDsub
!==
-
1
)
{
total
+=
1
}
})
if
(
indexIDref
==
-
1
)
{
privileges
.
push
({
menu_id
:
item
.
reference
,
button_id
:
[
1
,
2
,
3
]
})
}
else
{
if
(
total
<
1
)
{
privileges
.
splice
(
indexIDref
,
1
)
}
}
}
}
this
.
setState
({
privileges
})
}
...
...
@@ -283,7 +352,7 @@ export default class AddRole extends Component {
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Tambah
Data
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Create
Data
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
...
...
@@ -369,7 +438,7 @@ export default class AddRole extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"
Berlaku Mulai
"
label
=
"
Start Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
startDate
}
error
=
{
this
.
state
.
errorStartDate
}
...
...
@@ -402,7 +471,7 @@ export default class AddRole extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
label
=
"
Berlaku Hingga
"
label
=
"
End Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
endDate
}
error
=
{
this
.
state
.
errorEndDate
}
...
...
@@ -442,7 +511,7 @@ export default class AddRole extends Component {
disabled
// id="outlined-read-only-input"
variant
=
"filled"
value
=
{
'A
ktif
'
}
value
=
{
'A
ctive
'
}
inputProps
=
{{
style
:
{
...
...
@@ -467,26 +536,26 @@ export default class AddRole extends Component {
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
{
/*
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}>
<Typography style={{ fontSize: 12 }}>{`Dibuat: `}</Typography>
<Typography style={{fontSize: 12}}>{`Diubah: `}</Typography>
<
/div
>
</div>
*/
}
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
h5
>
Hak
Akse
s
<
/h5
>
<
h5
>
Access
Right
s
<
/h5
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-top-5px padding-bottom-5px padding-left-10px padding-right-10px "
style
=
{{
backgroundColor
:
'#4b4b4b'
}}
>
<
div
className
=
"column-1"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Otorisasi
Modul
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Authorization
Module
<
/Typography
>
<
/div
>
<
div
className
=
"column-2 grid grid-3x content-center grid-mobile-none gap-15px"
>
<
div
className
=
"column-1"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Lihat
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
View
<
/Typography
>
<
/div
>
<
div
className
=
"column-2"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Tambah
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Create
<
/Typography
>
<
/div
>
<
div
className
=
"column 3"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Ubah
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Edit
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -578,7 +647,7 @@ export default class AddRole extends Component {
{
this
.
state
.
setting
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-left-10px padding-right-10px"
>
{
item
.
menu_id
!==
23
&&
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-left-10px padding-right-10px"
>
<
div
className
=
"column-1"
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
8
}}
>
{
item
.
sub_menu
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapseSetting
(
item
)}
style
=
{{
marginRight
:
2
,
marginLeft
:
-
22
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
...
...
@@ -616,7 +685,7 @@ export default class AddRole extends Component {
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div>
}
{
item
.
sub_menu
.
length
>
0
&&
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
return
(
<
Collapse
in
=
{
item
.
collapse
}
timeout
=
"auto"
unmountOnExit
>
...
...
@@ -668,7 +737,7 @@ export default class AddRole extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
...
...
@@ -679,7 +748,7 @@ export default class AddRole extends Component {
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/container/Otorisasi/UserRole/EditRole.js
View file @
0484d044
...
...
@@ -131,12 +131,25 @@ export default class EditRole extends Component {
updateRole
()
{
// let startDate = format(this.state.tempData.start_date, 'yyyy-MM-dd')
// let endDate = format(this.state.tempData.end_date, 'yyyy-MM-dd')
let
privileges
=
this
.
state
.
privileges
privileges
.
push
({
menu_id
:
23
,
button_id
:
[
1
,
2
,
3
]
})
privileges
.
push
({
menu_id
:
24
,
button_id
:
[
1
,
2
,
3
]
})
privileges
.
push
({
menu_id
:
25
,
button_id
:
[
1
,
2
,
3
]
})
let
payload
=
{
"role_id"
:
this
.
state
.
tempData
.
role_id
,
"role_name"
:
this
.
state
.
tempData
.
role_name
,
"start_date"
:
this
.
state
.
tempData
.
start_date
,
"end_date"
:
this
.
state
.
tempData
.
end_date
,
"privileges"
:
this
.
state
.
privileges
"privileges"
:
privileges
}
// console.log(payload)
api
.
create
().
editRole
(
payload
).
then
((
response
)
=>
{
...
...
@@ -166,7 +179,8 @@ export default class EditRole extends Component {
menu_id
:
i
.
menu_id
,
label
:
i
.
menu_name
,
sub_menu
:
this
.
parseChildren
(
i
.
sub_menu
),
collapse
:
false
collapse
:
false
,
reference
:
i
.
reference
}
})
return
data
...
...
@@ -210,14 +224,32 @@ export default class EditRole extends Component {
handleItemClick
(
item
)
{
let
indexID
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
item
.
menu_id
)
console
.
log
(
item
)
let
privileges
=
this
.
state
.
privileges
if
(
indexID
===
-
1
)
{
privileges
.
push
({
menu_id
:
item
.
menu_id
,
button_id
:
[
1
,
2
,
3
]
})
if
(
item
.
sub_menu
.
length
>
0
)
{
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDs
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
if
(
indexIDs
===
-
1
)
{
privileges
.
push
({
menu_id
:
items
.
menu_id
,
button_id
:
[
1
,
2
,
3
]
})
}
})
}
}
else
{
privileges
.
splice
(
indexID
,
1
)
if
(
item
.
sub_menu
.
length
>
0
)
{
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
let
indexIDs
=
this
.
state
.
privileges
.
findIndex
((
val
)
=>
val
.
menu_id
===
items
.
menu_id
)
privileges
.
splice
(
indexIDs
,
1
)
})
}
}
this
.
setState
({
privileges
})
}
...
...
@@ -290,7 +322,7 @@ export default class EditRole extends Component {
<
div
className
=
"popup-panel grid grid-2x main-color"
style
=
{{
height
:
64
,
borderTopRightRadius
:
8
,
borderTopLeftRadius
:
8
}}
>
<
div
className
=
"col-1"
style
=
{{
maxWidth
:
"inherit"
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
className
=
"popup-title"
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Ubah
Data
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
16
,
fontWeight
:
'bold'
}}
>
Edit
Data
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"col-2 content-right"
style
=
{{
maxWidth
:
"inherit"
,
alignSelf
:
'center'
}}
>
...
...
@@ -376,7 +408,7 @@ export default class EditRole extends Component {
<
DatePicker
margin
=
"normal"
id
=
"startDate"
label
=
"
Berlaku Mulai
"
label
=
"
Start Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
start_date
}
error
=
{
this
.
state
.
errorStartDate
}
...
...
@@ -409,7 +441,7 @@ export default class EditRole extends Component {
<
DatePicker
margin
=
"normal"
id
=
"endDate"
label
=
"
Berlaku Hingga
"
label
=
"
End Date
"
format
=
"dd MMMM yyyy"
value
=
{
this
.
state
.
tempData
===
null
?
null
:
this
.
state
.
tempData
.
end_date
}
error
=
{
this
.
state
.
errorEndDate
}
...
...
@@ -474,25 +506,25 @@ export default class EditRole extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
flexDirection
:
'column'
,
display
:
'flex'
,
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Dibuat
:
${
this
.
state
.
tempData
===
null
?
''
:
(
this
.
state
.
tempData
.
created
===
null
?
'-'
:
this
.
state
.
tempData
.
created
)}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Diubah
:
${
this
.
state
.
tempData
===
null
?
''
:
(
this
.
state
.
tempData
.
updated
===
null
?
'-'
:
this
.
state
.
tempData
.
updated
)}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Created by
:
${
this
.
state
.
tempData
===
null
?
''
:
(
this
.
state
.
tempData
.
created
===
null
?
'-'
:
this
.
state
.
tempData
.
created
)}
`
}
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
{
`
Updated by
:
${
this
.
state
.
tempData
===
null
?
''
:
(
this
.
state
.
tempData
.
updated
===
null
?
'-'
:
this
.
state
.
tempData
.
updated
)}
`
}
<
/Typography
>
<
/div
>
<
Divider
style
=
{{
margin
:
20
}}
/
>
<
div
style
=
{{
paddingLeft
:
20
,
paddingRight
:
20
}}
>
<
h5
>
Hak
Akse
s
<
/h5
>
<
h5
>
Access
Right
s
<
/h5
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-top-5px padding-bottom-5px padding-left-10px padding-right-10px "
style
=
{{
backgroundColor
:
'#4b4b4b'
}}
>
<
div
className
=
"column-1"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Otorisasi
Modul
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Authorization
Module
<
/Typography
>
<
/div
>
<
div
className
=
"column-2 grid grid-3x content-center grid-mobile-none gap-15px"
>
<
div
className
=
"column-1"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Lihat
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
View
<
/Typography
>
<
/div
>
<
div
className
=
"column-2"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Tambah
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Create
<
/Typography
>
<
/div
>
<
div
className
=
"column 3"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Ubah
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Edit
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
...
...
@@ -503,7 +535,7 @@ export default class EditRole extends Component {
<
div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-left-10px padding-right-10px"
>
<
div
className
=
"column-1"
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
8
}}
>
{
item
.
sub_menu
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
item
)}
style
=
{{
marginRight
:
2
,
marginLeft
:
-
22
}}
>
{
item
.
sub_menu
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapse
(
item
)}
style
=
{{
marginRight
:
2
,
marginLeft
:
-
22
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
display
:
'flex'
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
<
/span>
}
<
span
>
...
...
@@ -584,7 +616,7 @@ export default class EditRole extends Component {
{
this
.
state
.
setting
.
map
((
item
,
index
)
=>
{
return
(
<
div
>
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-left-10px padding-right-10px"
>
{
item
.
menu_id
!==
23
&&
<
div
className
=
"grid grid-2x grid-mobile-none gap-15px padding-left-10px padding-right-10px"
>
<
div
className
=
"column-1"
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
alignItems
:
'center'
,
justifyContent
:
'flex-start'
,
paddingLeft
:
8
}}
>
{
item
.
sub_menu
.
length
>
0
&&
<
span
onClick
=
{()
=>
this
.
handleCollapseSetting
(
item
)}
style
=
{{
marginRight
:
2
,
marginLeft
:
-
22
}}
>
{
item
.
collapse
?
<
RemoveIcon
color
=
{
'action'
}
fontSize
=
{
'small'
}
/> : <AddIcon color={'action'} fontSize={'small'} /
>
}
...
...
@@ -622,7 +654,7 @@ export default class EditRole extends Component {
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div>
}
{
item
.
sub_menu
.
length
>
0
&&
item
.
sub_menu
.
map
((
items
,
indexs
)
=>
{
return
(
<
Collapse
in
=
{
item
.
collapse
}
timeout
=
"auto"
unmountOnExit
>
...
...
@@ -674,7 +706,7 @@ export default class EditRole extends Component {
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
>
<
div
onClick
=
{()
=>
this
.
props
.
onClickClose
()}
style
=
{{
width
:
102
,
height
:
30
,
border
:
'solid 1px #354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Bata
l
<
/span
>
<
span
style
=
{{
color
:
'#354960'
,
fontSize
:
11
}}
>
Cance
l
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
@@ -684,7 +716,7 @@ export default class EditRole extends Component {
onClick
=
{()
=>
this
.
validasi
()}
>
<
div
style
=
{{
width
:
102
,
height
:
30
,
backgroundColor
:
'#354960'
,
borderRadius
:
5
,
alignItems
:
'center'
,
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
impan
<
/span
>
<
span
style
=
{{
color
:
'#fff'
,
fontSize
:
11
}}
>
S
ave
<
/span
>
<
/div
>
<
/button
>
<
/div
>
...
...
src/router/homeRoutes.js
View file @
0484d044
...
...
@@ -11,6 +11,7 @@ import Parameter from '../container/MasterData/Parameter/Parameter'
import
ReportItems
from
'../container/MasterData/ReportItems'
import
DashboardCAT
from
'../container/Laporan/DashboardCAT'
import
BudgetTahunan
from
'../container/BudgetTahunan'
;
import
OperatingIndicator
from
'../container/OperatingIndicator/OperatingIndicator'
const
routes
=
[
{
...
...
@@ -57,6 +58,10 @@ const routes = [
path
:
"/home/cat-dashboard"
,
main
:
DashboardCAT
},
{
path
:
"/home/operating-indicator"
,
main
:
OperatingIndicator
},
{
path
:
"/home/profile"
,
main
:
Profile
...
...
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