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
163b234e
Commit
163b234e
authored
Aug 28, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
permission role & user role See merge request
!201
parents
8d32f088
26ab9b2a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
216 additions
and
153 deletions
+216
-153
Login.js
src/container/Login.js
+1
-1
ReportItems.js
src/container/MasterData/ReportItems.js
+2
-2
User.js
src/container/Otorisasi/User.js
+129
-97
UserRole.js
src/container/Otorisasi/UserRole.js
+84
-53
No files found.
src/container/Login.js
View file @
163b234e
...
@@ -112,7 +112,7 @@ class Login extends Component {
...
@@ -112,7 +112,7 @@ class Login extends Component {
}
}
this
.
props
.
history
.
push
(
'/home/beranda'
)
this
.
props
.
history
.
push
(
'/home/beranda'
)
}
else
{
}
else
{
if
(
response
.
data
.
message
==
'
Incorrect password.
'
)
{
if
(
response
.
data
.
message
==
'
Password is Not Correct
'
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
response
.
data
.
message
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
response
.
data
.
message
})
}
else
{
}
else
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
response
.
data
.
message
})
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
response
.
data
.
message
})
...
...
src/container/MasterData/ReportItems.js
View file @
163b234e
...
@@ -838,7 +838,7 @@ export default class ReportItems extends Component {
...
@@ -838,7 +838,7 @@ export default class ReportItems extends Component {
<
img
src
=
{
Images
.
download
}
/
>
<
img
src
=
{
Images
.
download
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"
download
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"
visualisasi
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Visualization'
}
data
-
for
=
"visualisasi"
>
<
a
data
-
tip
=
{
'Visualization'
}
data
-
for
=
"visualisasi"
>
<
button
<
button
style
=
{{
style
=
{{
...
@@ -852,7 +852,7 @@ export default class ReportItems extends Component {
...
@@ -852,7 +852,7 @@ export default class ReportItems extends Component {
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
img
src
=
{
Images
.
visualisasi
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"
visualisasi
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"
tambah
"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"tambah"
>
<
a
data
-
tip
=
{
'Add New'
}
data
-
for
=
"tambah"
>
<
button
<
button
...
...
src/container/Otorisasi/User.js
View file @
163b234e
...
@@ -34,12 +34,16 @@ export default class UserRole extends Component {
...
@@ -34,12 +34,16 @@ export default class UserRole extends Component {
buttonError
:
false
,
buttonError
:
false
,
alert
:
false
,
alert
:
false
,
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
buttonCreate
:
false
,
buttonEdit
:
false
,
load
:
false
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getUser
()
this
.
getUser
()
this
.
getPermission
()
}
}
closeEdit
()
{
closeEdit
()
{
...
@@ -72,6 +76,26 @@ export default class UserRole extends Component {
...
@@ -72,6 +76,26 @@ export default class UserRole extends Component {
})
})
}
}
getPermission
()
{
let
payload
=
{
menu
:
"user"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
searchUser
()
{
searchUser
()
{
let
payload
=
{
let
payload
=
{
"keyword"
:
this
.
state
.
search
"keyword"
:
this
.
state
.
search
...
@@ -355,6 +379,7 @@ export default class UserRole extends Component {
...
@@ -355,6 +379,7 @@ export default class UserRole extends Component {
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
/* {tableMeta.rowData[6] === "Active" ? */
}
{
/* {tableMeta.rowData[6] === "Active" ? */
}
{
this
.
state
.
buttonEdit
&&
(
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -366,6 +391,7 @@ export default class UserRole extends Component {
...
@@ -366,6 +391,7 @@ export default class UserRole extends Component {
>
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
<
/button
>
)}
{
/* :
{
/* :
null
null
} */
}
} */
}
...
@@ -450,6 +476,7 @@ export default class UserRole extends Component {
...
@@ -450,6 +476,7 @@ export default class UserRole extends Component {
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
{
this
.
state
.
visibleUser
?
<
div
>
{
this
.
state
.
visibleUser
?
<
div
>
{
this
.
state
.
load
&&
(
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
User
<
/label
>
<
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: '60%', justifyContent: 'center', display: 'flex', borderWidth: 2, alignItems: 'center' }}>
...
@@ -515,6 +542,7 @@ export default class UserRole extends Component {
...
@@ -515,6 +542,7 @@ export default class UserRole extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"template"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
a
data
-
tip
=
{
'Upload'
}
data
-
for
=
"upload"
>
<
button
<
button
style
=
{{
style
=
{{
...
@@ -528,6 +556,7 @@ export default class UserRole extends Component {
...
@@ -528,6 +556,7 @@ export default class UserRole extends Component {
<
img
src
=
{
Images
.
upload
}
/
>
<
img
src
=
{
Images
.
upload
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"upload"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
a
data
-
tip
=
{
'Download'
}
data
-
for
=
"download"
>
<
button
<
button
...
@@ -543,6 +572,7 @@ export default class UserRole extends Component {
...
@@ -543,6 +572,7 @@ export default class UserRole extends Component {
<
/button
>
<
/button
>
<
/a
>
<
/a
>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"download"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Create'
}
data
-
for
=
"create"
>
<
a
data
-
tip
=
{
'Create'
}
data
-
for
=
"create"
>
<
button
<
button
style
=
{{
style
=
{{
...
@@ -556,9 +586,11 @@ export default class UserRole extends Component {
...
@@ -556,9 +586,11 @@ export default class UserRole extends Component {
<
img
src
=
{
Images
.
add
}
/
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
<
div
style
=
{{
padding
:
25
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
...
...
src/container/Otorisasi/UserRole.js
View file @
163b234e
...
@@ -32,12 +32,16 @@ class UserRole extends Component {
...
@@ -32,12 +32,16 @@ class UserRole extends Component {
search
:
''
,
search
:
''
,
alert
:
false
,
alert
:
false
,
tipeAlert
:
''
,
tipeAlert
:
''
,
messageAlert
:
''
messageAlert
:
''
,
buttonCreate
:
false
,
buttonEdit
:
false
,
load
:
false
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getRole
()
this
.
getRole
()
this
.
getPermission
()
}
}
closeEdit
()
{
closeEdit
()
{
...
@@ -75,6 +79,26 @@ class UserRole extends Component {
...
@@ -75,6 +79,26 @@ class UserRole extends Component {
})
})
}
}
getPermission
()
{
let
payload
=
{
menu
:
"user role"
}
api
.
create
().
getPermission
(
payload
).
then
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
load
:
true
})
}
else
{
this
.
setState
({
load
:
true
})
}
}
})
}
searchRole
()
{
searchRole
()
{
let
payload
=
{
let
payload
=
{
"keyword"
:
this
.
state
.
search
"keyword"
:
this
.
state
.
search
...
@@ -130,6 +154,7 @@ class UserRole extends Component {
...
@@ -130,6 +154,7 @@ class UserRole extends Component {
console
.
log
(
tableMeta
);
console
.
log
(
tableMeta
);
return
(
return
(
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
{
this
.
state
.
buttonEdit
&&
(
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -147,6 +172,7 @@ class UserRole extends Component {
...
@@ -147,6 +172,7 @@ class UserRole extends Component {
<
/div
>
<
/div
>
<
/button
>
<
/button
>
)}
<
/div
>
<
/div
>
);
);
}
}
...
@@ -206,6 +232,8 @@ class UserRole extends Component {
...
@@ -206,6 +232,8 @@ class UserRole extends Component {
<
/Alert
>
<
/Alert
>
<
/Snackbar
>
<
/Snackbar
>
<
div
>
<
div
>
{
this
.
state
.
load
&&
(
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
div
style
=
{{
display
:
'flex'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
paddingRight
:
25
,
paddingLeft
:
25
,
marginTop
:
-
118
}}
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Role
&
Authorization
<
/label
>
<
label
style
=
{{
color
:
'white'
,
fontSize
:
16
,
alignSelf
:
'center'
,
width
:
'20%'
,
}}
>
Master
Data
-
Role
&
Authorization
<
/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'
}}
>
<
div
style
=
{{
color
:
'white'
,
width
:
'50%'
,
height
:
37
,
display
:
'flex'
,
backgroundColor
:
'white'
,
borderWidth
:
2
,
alignItems
:
'center'
,
borderRadius
:
6
,
paddingLeft
:
5
,
paddingRight
:
5
,
alignSelf
:
'center'
}}
>
...
@@ -228,6 +256,7 @@ class UserRole extends Component {
...
@@ -228,6 +256,7 @@ class UserRole extends Component {
<
/div
>
<
/div
>
{
/* <label style={{ color: 'white', width: '60%', justifyContent: 'center', display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center' }}>Search</label> */
}
{
/* <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'
}}
>
<
div
style
=
{{
width
:
'20%'
,
justifyContent
:
'flex-end'
,
display
:
'flex'
}}
>
{
this
.
state
.
buttonCreate
&&
(
<
a
data
-
tip
=
{
'Create'
}
data
-
for
=
"create"
>
<
a
data
-
tip
=
{
'Create'
}
data
-
for
=
"create"
>
<
button
<
button
style
=
{{
style
=
{{
...
@@ -241,9 +270,11 @@ class UserRole extends Component {
...
@@ -241,9 +270,11 @@ class UserRole extends Component {
<
img
src
=
{
Images
.
add
}
/
>
<
img
src
=
{
Images
.
add
}
/
>
<
/button
>
<
/button
>
<
/a
>
<
/a
>
)}
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
ReactTooltip
border
=
{
true
}
id
=
"create"
place
=
"bottom"
type
=
"light"
effect
=
"solid"
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
<
div
style
=
{{
padding
:
25
}}
>
<
div
style
=
{{
padding
:
25
}}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MuiThemeProvider
theme
=
{
getMuiTheme
()}
>
<
MUIDataTable
<
MUIDataTable
...
...
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