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
b09304c3
Commit
b09304c3
authored
Aug 11, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset update
parent
cc4f8884
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
index.js
src/api/index.js
+2
-0
ForgotPassword.js
src/container/ForgotPassword.js
+2
-2
ResetPassword.js
src/container/ResetPassword.js
+30
-7
No files found.
src/api/index.js
View file @
b09304c3
...
...
@@ -63,6 +63,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
//Auth
const
login
=
(
body
)
=>
api
.
post
(
'auth/login'
,
body
)
const
resetPassword
=
(
body
)
=>
api
.
post
(
'auth/reset_password'
,
body
)
const
verification
=
(
body
)
=>
api
.
post
(
'email/reset_password'
,
body
)
//Role
...
...
@@ -91,6 +92,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
getRoot
,
login
,
verification
,
resetPassword
,
getRole
,
getDetailRole
,
addRole
,
...
...
src/container/ForgotPassword.js
View file @
b09304c3
...
...
@@ -26,7 +26,7 @@ class ForgotPassword extends Component {
validateEmail
()
{
if
(
this
.
state
.
email
.
trim
()
==
""
)
{
this
.
setState
({
errorEmail
:
true
,
msgEmail
:
'Email harus diisi!'
})
}
else
{
}
else
{
this
.
verification
()
}
}
...
...
@@ -56,7 +56,7 @@ class ForgotPassword extends Component {
<
TextField
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
id
=
"email"
type
=
{
"
text
"
}
type
=
{
"
email
"
}
name
=
{
"email"
}
value
=
{
this
.
state
.
email
}
onChange
=
{(
email
)
=>
{
...
...
src/container/ResetPassword.js
View file @
b09304c3
...
...
@@ -3,6 +3,7 @@ import Images from '../assets/Images';
import
{
TextField
,
InputAdornment
,
Button
,
Typography
,
IconButton
}
from
'@material-ui/core'
;
import
Visibility
from
'@material-ui/icons/Visibility'
;
import
VisibilityOff
from
'@material-ui/icons/VisibilityOff'
;
import
api
from
'../api'
;
class
ResetPassword
extends
Component
{
...
...
@@ -13,6 +14,10 @@ class ResetPassword extends Component {
confirmPassword
:
''
,
showPass
:
false
,
showPass2
:
false
,
errorPassword
:
false
,
errorConfirmPassword
:
false
,
msgPassword
:
''
,
msgConfirmPassword
:
''
,
userId
:
0
}
}
...
...
@@ -21,6 +26,7 @@ class ResetPassword extends Component {
console
.
log
(
this
.
props
.
match
.
params
.
id
)
let
userId
=
this
.
props
.
match
.
params
.
id
this
.
setState
({
userId
})
// console.log(this.props)
}
confirmPassword
()
{
...
...
@@ -29,13 +35,26 @@ class ResetPassword extends Component {
"confirmPassword"
:
this
.
state
.
confirmPassword
,
"userId"
:
this
.
state
.
userId
}
api
.
create
().
confirmPassword
(
payload
).
then
((
response
)
=>
{
if
(
response
.
data
.
status
===
'success'
)
{
alert
(
'success'
)
this
.
props
.
history
.
push
(
'/login'
)
}
else
{
alert
(
response
.
data
.
message
)
}
})
}
handleChange
(
e
)
{
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
if
(
e
.
target
.
name
==
"password"
)
{
this
.
setState
({
errorPassword
:
false
,
msgPassword
:
''
})
}
else
if
(
e
.
target
.
name
)
{
this
.
setState
({
errorConfirmPassword
:
false
,
msgConfirmPassword
:
''
})
}
}
render
()
{
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#51c6ea'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
...
...
@@ -48,9 +67,11 @@ class ResetPassword extends Component {
type
=
{
this
.
state
.
showPass
?
'text'
:
'password'
}
name
=
{
"password"
}
value
=
{
this
.
state
.
password
}
onChange
=
{(
password
)
=>
this
.
handleChange
(
password
)
}
onChange
=
{(
password
)
=>
{
this
.
handleChange
(
password
)
}}
variant
=
"outlined"
error
=
{
false
}
error
=
{
this
.
state
.
errorPassword
}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
32
}}
helperText
=
{
<
Typography
style
=
{{
fontSize
:
9
,
marginTop
:
4
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Terdiri
8
karakter
dengan
kombinasi
angka
.
<
/Typography>
}
InputProps
=
{{
...
...
@@ -73,10 +94,12 @@ class ResetPassword extends Component {
type
=
{
this
.
state
.
showPass2
?
'text'
:
'password'
}
name
=
{
"confirmPassword"
}
value
=
{
this
.
state
.
confirmPassword
}
onChange
=
{(
confirmPassword
)
=>
this
.
handleChange
(
confirmPassword
)
}
onChange
=
{(
confirmPassword
)
=>
{
this
.
handleChange
(
confirmPassword
)
}}
variant
=
"outlined"
error
=
{
false
}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
3
8
}}
error
=
{
this
.
state
.
errorConfirmPassword
}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
3
0
}}
helperText
=
{
<
Typography
style
=
{{
fontSize
:
9
,
marginTop
:
4
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Terdiri
8
karakter
dengan
kombinasi
angka
.
<
/Typography>
}
InputProps
=
{{
endAdornment
:
<
InputAdornment
position
=
"end"
>
...
...
@@ -92,7 +115,7 @@ class ResetPassword extends Component {
}}
/
>
<
Button
variant
=
"contained"
style
=
{{
marginTop
:
50
,
width
:
250
,
height
:
30
,
borderRadius
:
4
,
backgroundColor
:
'#51c6ea'
}}
>
<
Button
name
=
"submit"
variant
=
"contained"
disabled
=
{
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
true
:
false
}
onClick
=
{()
=>
this
.
confirmPassword
()}
style
=
{{
marginTop
:
30
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
,
color
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#4b4b4b'
:
'#fff'
,
backgroundColor
:
this
.
state
.
password
.
trim
()
==
''
&&
this
.
state
.
confirmPassword
.
trim
()
==
''
?
'#d8d8d8'
:
'#51c6ea'
}}
>
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Lanjut
<
/Typography
>
<
/Button
>
<
/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