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
816c209e
Commit
816c209e
authored
Sep 08, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
update See merge request
!264
parents
2311975c
56482014
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
10 deletions
+27
-10
User.js
src/container/Otorisasi/User.js
+17
-7
UserRole.js
src/container/Otorisasi/UserRole.js
+5
-3
AddRole.js
src/container/Otorisasi/UserRole/AddRole.js
+1
-0
EditRole.js
src/container/Otorisasi/UserRole/EditRole.js
+4
-0
No files found.
src/container/Otorisasi/User.js
View file @
816c209e
...
@@ -40,16 +40,23 @@ export default class UserRole extends Component {
...
@@ -40,16 +40,23 @@ export default class UserRole extends Component {
messageAlert
:
''
,
messageAlert
:
''
,
buttonCreate
:
false
,
buttonCreate
:
false
,
buttonEdit
:
false
,
buttonEdit
:
false
,
buttonDelete
:
false
,
load
:
false
,
load
:
false
,
judul
:
''
judul
:
''
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
daskdkas
()
this
.
getUser
()
this
.
getUser
()
this
.
getPermission
()
this
.
getPermission
()
}
}
async
daskdkas
()
{
let
res
=
await
localStorage
.
getItem
(
Constant
.
TOKEN
)
console
.
log
(
res
)
}
closeEdit
()
{
closeEdit
()
{
this
.
setState
({
edit
:
false
})
this
.
setState
({
edit
:
false
})
}
}
...
@@ -99,6 +106,7 @@ export default class UserRole extends Component {
...
@@ -99,6 +106,7 @@ export default class UserRole extends Component {
this
.
setState
({
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
buttonEdit
:
response
.
data
.
data
.
edit
,
buttonDelete
:
response
.
data
.
data
.
delete
,
load
:
true
load
:
true
})
})
}
else
{
}
else
{
...
@@ -401,6 +409,7 @@ export default class UserRole extends Component {
...
@@ -401,6 +409,7 @@ export default class UserRole extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
getUser
()
this
.
getUser
()
this
.
closeEdit
()
this
.
closeEdit
()
window
.
location
.
reload
();
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
@@ -430,6 +439,7 @@ export default class UserRole extends Component {
...
@@ -430,6 +439,7 @@ export default class UserRole extends Component {
if
(
response
.
data
.
status
===
'Success'
)
{
if
(
response
.
data
.
status
===
'Success'
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
add
:
false
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
add
:
false
})
this
.
getUser
()
this
.
getUser
()
window
.
location
.
reload
();
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
...
@@ -472,9 +482,9 @@ export default class UserRole extends Component {
...
@@ -472,9 +482,9 @@ export default class UserRole extends Component {
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
getUser
()
this
.
getUser
()
this
.
setState
({
visibleUser
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
visibleUser
:
true
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
,
payload
:
[],
rows
:
[],
judul
:
''
})
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
payload
:
[],
rows
:
[],
judul
:
''
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
))
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
...
@@ -484,10 +494,10 @@ export default class UserRole extends Component {
...
@@ -484,10 +494,10 @@ export default class UserRole extends Component {
})
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
,
payload
:
[],
rows
:
[],
judul
:
''
})
}
}
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
,
payload
:
[],
rows
:
[],
judul
:
''
})
}
}
})
})
}
}
...
@@ -518,7 +528,7 @@ export default class UserRole extends Component {
...
@@ -518,7 +528,7 @@ export default class UserRole extends Component {
<
img
src
=
{
Images
.
editCopy
}
/
>
<
img
src
=
{
Images
.
editCopy
}
/
>
<
/button
>
<
/button
>
)}
)}
{
this
.
state
.
button
Edit
&&
(
{
this
.
state
.
button
Delete
&&
(
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -801,11 +811,11 @@ export default class UserRole extends Component {
...
@@ -801,11 +811,11 @@ export default class UserRole extends Component {
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
img
src
=
{
Images
.
failed
Copy
}
/
>
<
img
src
=
{
Images
.
failed
}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
Delete
{
t
his
.
state
.
rowData
[
2
]
}
?
Delete
{
t
itleCase
(
this
.
state
.
rowData
[
2
])
}
?
<
/span
>
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
{`Please try again later.`}
...
...
src/container/Otorisasi/UserRole.js
View file @
816c209e
...
@@ -36,6 +36,7 @@ class UserRole extends Component {
...
@@ -36,6 +36,7 @@ class UserRole extends Component {
messageAlert
:
''
,
messageAlert
:
''
,
buttonCreate
:
false
,
buttonCreate
:
false
,
buttonEdit
:
false
,
buttonEdit
:
false
,
buttonDelete
:
false
,
load
:
false
load
:
false
}
}
}
}
...
@@ -98,6 +99,7 @@ class UserRole extends Component {
...
@@ -98,6 +99,7 @@ class UserRole extends Component {
this
.
setState
({
this
.
setState
({
buttonCreate
:
response
.
data
.
data
.
create
,
buttonCreate
:
response
.
data
.
data
.
create
,
buttonEdit
:
response
.
data
.
data
.
edit
,
buttonEdit
:
response
.
data
.
data
.
edit
,
buttonDelete
:
response
.
data
.
data
.
delete
,
load
:
true
load
:
true
})
})
}
else
{
}
else
{
...
@@ -215,7 +217,7 @@ class UserRole extends Component {
...
@@ -215,7 +217,7 @@ class UserRole extends Component {
<
/div
>
<
/div
>
<
/button
>
<
/button
>
)}
)}
{
this
.
state
.
button
Edit
&&
(
{
this
.
state
.
button
Delete
&&
(
<
button
<
button
style
=
{{
style
=
{{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
@@ -363,11 +365,11 @@ class UserRole extends Component {
...
@@ -363,11 +365,11 @@ class UserRole extends Component {
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"test app-popup-show"
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
className
=
"popup-content background-white border-radius"
style
=
{{
borderRadius
:
8
,
padding
:
50
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'center'
}}
>
<
img
src
=
{
Images
.
failed
Copy
}
/
>
<
img
src
=
{
Images
.
failed
}
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
div
style
=
{{
display
:
'grid'
,
justifyContent
:
'center'
,
marginTop
:
20
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
<
span
style
=
{{
textAlign
:
'center'
,
fontSize
:
14
,
fontWeight
:
'bold'
}}
>
Delete
{
t
his
.
state
.
rowData
[
2
]
}
?
Delete
{
t
itleCase
(
this
.
state
.
rowData
[
2
])
}
?
<
/span
>
<
/span
>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{
/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
{`Please try again later.`}
...
...
src/container/Otorisasi/UserRole/AddRole.js
View file @
816c209e
...
@@ -142,6 +142,7 @@ export default class AddRole extends Component {
...
@@ -142,6 +142,7 @@ export default class AddRole extends Component {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
this
.
props
.
onClickClose
()
this
.
props
.
refresh
()
this
.
props
.
refresh
()
window
.
location
.
reload
();
},
750
);
},
750
);
}
else
{
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
src/container/Otorisasi/UserRole/EditRole.js
View file @
816c209e
...
@@ -168,6 +168,7 @@ export default class EditRole extends Component {
...
@@ -168,6 +168,7 @@ export default class EditRole extends Component {
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
props
.
onClickClose
()
this
.
props
.
onClickClose
()
window
.
location
.
reload
();
this
.
props
.
refresh
()
this
.
props
.
refresh
()
},
750
);
},
750
);
}
else
{
}
else
{
...
@@ -621,6 +622,9 @@ export default class EditRole extends Component {
...
@@ -621,6 +622,9 @@ export default class EditRole extends Component {
<
div
className
=
"column 3"
>
<
div
className
=
"column 3"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Edit
<
/Typography
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Edit
<
/Typography
>
<
/div
>
<
/div
>
<
div
className
=
"column 4"
>
<
Typography
style
=
{{
fontSize
:
12
,
color
:
'white'
}}
>
Delete
<
/Typography
>
<
/div
>
<
/div
>
<
/div
>
<
/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