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
cd9bb020
Commit
cd9bb020
authored
Aug 20, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'syadziy' into 'master'
Syadziy See merge request
!141
parents
3cef8616
4e4caec8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
189 additions
and
129 deletions
+189
-129
AddUser.js
src/container/Otorisasi/User/AddUser.js
+44
-40
EditUser.js
src/container/Otorisasi/User/EditUser.js
+44
-40
Profile.js
src/container/Profile.js
+101
-49
No files found.
src/container/Otorisasi/User/AddUser.js
View file @
cd9bb020
...
@@ -287,6 +287,8 @@ export default class AddUser extends Component {
...
@@ -287,6 +287,8 @@ export default class AddUser extends Component {
padding
=
20
padding
=
20
}
}
return
(
return
(
<
div
>
{
item
.
children
.
length
>
0
&&
(
<
ul
>
<
ul
>
{
item
.
children
.
map
((
data
,
index
)
=>
{
{
item
.
children
.
map
((
data
,
index
)
=>
{
return
(
return
(
...
@@ -328,6 +330,8 @@ export default class AddUser extends Component {
...
@@ -328,6 +330,8 @@ export default class AddUser extends Component {
)
)
})}
})}
<
/ul
>
<
/ul
>
)}
<
/div
>
)
)
}
}
...
...
src/container/Otorisasi/User/EditUser.js
View file @
cd9bb020
...
@@ -289,6 +289,8 @@ export default class EditUser extends Component {
...
@@ -289,6 +289,8 @@ export default class EditUser extends Component {
padding
=
20
padding
=
20
}
}
return
(
return
(
<
div
>
{
item
.
children
.
length
>
0
&&
(
<
ul
>
<
ul
>
{
item
.
children
.
map
((
data
,
index
)
=>
{
{
item
.
children
.
map
((
data
,
index
)
=>
{
return
(
return
(
...
@@ -330,6 +332,8 @@ export default class EditUser extends Component {
...
@@ -330,6 +332,8 @@ export default class EditUser extends Component {
)
)
})}
})}
<
/ul
>
<
/ul
>
)}
<
/div
>
)
)
}
}
...
...
src/container/Profile.js
View file @
cd9bb020
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Typography
,
AppBar
,
Tabs
,
Tab
,
TextField
,
Collapse
,
withStyles
,
Checkbox
,
InputAdornment
,
IconButton
}
from
'@material-ui/core'
;
import
{
Typography
,
AppBar
,
Tabs
,
Tab
,
TextField
,
Snackbar
,
Collapse
,
withStyles
,
Checkbox
,
InputAdornment
,
IconButton
}
from
'@material-ui/core'
;
import
Visibility
from
'@material-ui/icons/Visibility'
;
import
Visibility
from
'@material-ui/icons/Visibility'
;
import
VisibilityOff
from
'@material-ui/icons/VisibilityOff'
;
import
VisibilityOff
from
'@material-ui/icons/VisibilityOff'
;
import
HomePage
from
'./HomePage
'
;
import
MuiAlert
from
'@material-ui/lab/Alert
'
;
import
Images
from
'../assets/Images'
;
import
Images
from
'../assets/Images'
;
import
api
from
'../api'
;
import
api
from
'../api'
;
import
Constant
from
'../library/Constant'
;
import
Constant
from
'../library/Constant'
;
...
@@ -22,6 +22,9 @@ const CustomCheckbox = withStyles({
...
@@ -22,6 +22,9 @@ const CustomCheckbox = withStyles({
checked
:
{},
checked
:
{},
})((
props
)
=>
<
Checkbox
color
=
"default"
{...
props
}
/>
)
;
})((
props
)
=>
<
Checkbox
color
=
"default"
{...
props
}
/>
)
;
const
Alert
=
withStyles
({
})((
props
)
=>
<
MuiAlert
elevation
=
{
6
}
variant
=
"filled"
{...
props
}
/>
)
;
export
default
class
Profile
extends
Component
{
export
default
class
Profile
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -43,7 +46,10 @@ export default class Profile extends Component {
...
@@ -43,7 +46,10 @@ export default class Profile extends Component {
showPass2
:
false
,
showPass2
:
false
,
showPass3
:
false
,
showPass3
:
false
,
pictures
:
[],
pictures
:
[],
name
:
""
name
:
""
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
}
}
this
.
onDrop
=
this
.
onDrop
.
bind
(
this
);
this
.
onDrop
=
this
.
onDrop
.
bind
(
this
);
}
}
...
@@ -111,12 +117,20 @@ export default class Profile extends Component {
...
@@ -111,12 +117,20 @@ export default class Profile extends Component {
api
.
create
().
changePassword
(
body
).
then
(
response
=>
{
api
.
create
().
changePassword
(
body
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
})
this
.
setState
({
oldPassword
:
""
,
password
:
""
,
confirmPassword
:
""
})
this
.
setState
({
oldPassword
:
""
,
password
:
""
,
confirmPassword
:
""
})
localStorage
.
removeItem
(
Constant
.
TOKEN
)
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
window
.
location
.
reload
();
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
alert
(
response
.
data
.
message
)
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -136,11 +150,20 @@ export default class Profile extends Component {
...
@@ -136,11 +150,20 @@ export default class Profile extends Component {
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
let
userId
=
localStorage
.
getItem
(
Constant
.
USER
)
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
api
.
create
().
getDetailUser
(
userId
).
then
((
response
)
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
company
:
response
.
data
.
data
.
company
,
photo
:
response
.
data
.
data
.
photo
,
name
:
response
.
data
.
data
.
fullname
})
this
.
setState
({
company
:
response
.
data
.
data
.
company
,
photo
:
response
.
data
.
data
.
photo
,
name
:
response
.
data
.
data
.
fullname
})
console
.
log
(
response
)
console
.
log
(
response
)
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -148,10 +171,18 @@ export default class Profile extends Component {
...
@@ -148,10 +171,18 @@ export default class Profile extends Component {
api
.
create
().
getPerusahaanHierarki
().
then
((
response
)
=>
{
api
.
create
().
getPerusahaanHierarki
().
then
((
response
)
=>
{
// console.log(response);
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
data
.
status
==
'success'
)
{
if
(
response
.
data
.
status
==
'success'
)
{
this
.
setState
({
listCompany
:
response
.
data
.
data
})
this
.
setState
({
listCompany
:
response
.
data
.
data
})
console
.
log
(
response
.
data
.
data
)
console
.
log
(
response
.
data
.
data
)
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
...
@@ -169,6 +200,8 @@ export default class Profile extends Component {
...
@@ -169,6 +200,8 @@ export default class Profile extends Component {
padding
=
20
padding
=
20
}
}
return
(
return
(
<
div
>
{
item
.
children
.
length
>
0
&&
(
<
ul
>
<
ul
>
{
item
.
children
.
map
((
data
,
index
)
=>
{
{
item
.
children
.
map
((
data
,
index
)
=>
{
return
(
return
(
...
@@ -199,6 +232,8 @@ export default class Profile extends Component {
...
@@ -199,6 +232,8 @@ export default class Profile extends Component {
)
)
})}
})}
<
/ul
>
<
/ul
>
)}
<
/div
>
)
)
}
}
...
@@ -269,20 +304,37 @@ export default class Profile extends Component {
...
@@ -269,20 +304,37 @@ export default class Profile extends Component {
api
.
create
().
uploadFoto
(
formData
).
then
(
response
=>
{
api
.
create
().
uploadFoto
(
formData
).
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
){
if
(
response
.
data
.
status
===
"success"
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
setState
({
uploadVisible
:
false
},
()
=>
{
this
.
setState
({
uploadVisible
:
false
},
()
=>
{
alert
(
response
.
data
.
message
)
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'success'
}
)
this
.
getUser
()
this
.
getUser
()
window
.
location
.
reload
()
window
.
location
.
reload
()
})
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
})
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'error'
})
}
}
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
problem
,
tipeAlert
:
'error'
})
}
}
})
})
}
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
render
()
{
render
()
{
return
(
return
(
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
div
style
=
{{
height
:
this
.
props
.
height
,
backgroundColor
:
'#f8f8f8'
,
marginBottom
:
100
,
minHeight
:
1000
}}
>
<
Snackbar
open
=
{
this
.
state
.
alert
}
autoHideDuration
=
{
6000
}
onClose
=
{()
=>
this
.
closeAlert
()}
>
<
Alert
onClose
=
{()
=>
this
.
closeAlert
()}
severity
=
{
this
.
state
.
tipeAlert
}
>
{
this
.
state
.
messageAlert
}
<
/Alert
>
<
/Snackbar
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
203
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'flex-end'
,
padding
:
20
}}
>
<
div
className
=
{
"main-color"
}
style
=
{{
height
:
203
,
flex
:
1
,
display
:
'flex'
,
alignItems
:
'flex-end'
,
padding
:
20
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
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