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