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
Show 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/')
...
@@ -63,6 +63,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
//Auth
//Auth
const
login
=
(
body
)
=>
api
.
post
(
'auth/login'
,
body
)
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
)
const
verification
=
(
body
)
=>
api
.
post
(
'email/reset_password'
,
body
)
//Role
//Role
...
@@ -91,6 +92,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
...
@@ -91,6 +92,7 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
getRoot
,
getRoot
,
login
,
login
,
verification
,
verification
,
resetPassword
,
getRole
,
getRole
,
getDetailRole
,
getDetailRole
,
addRole
,
addRole
,
...
...
src/container/ForgotPassword.js
View file @
b09304c3
...
@@ -56,7 +56,7 @@ class ForgotPassword extends Component {
...
@@ -56,7 +56,7 @@ class ForgotPassword extends Component {
<
TextField
<
TextField
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
label
=
{
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Email
*<
/Typography>
}
id
=
"email"
id
=
"email"
type
=
{
"
text
"
}
type
=
{
"
email
"
}
name
=
{
"email"
}
name
=
{
"email"
}
value
=
{
this
.
state
.
email
}
value
=
{
this
.
state
.
email
}
onChange
=
{(
email
)
=>
{
onChange
=
{(
email
)
=>
{
...
...
src/container/ResetPassword.js
View file @
b09304c3
...
@@ -3,6 +3,7 @@ import Images from '../assets/Images';
...
@@ -3,6 +3,7 @@ import Images from '../assets/Images';
import
{
TextField
,
InputAdornment
,
Button
,
Typography
,
IconButton
}
from
'@material-ui/core'
;
import
{
TextField
,
InputAdornment
,
Button
,
Typography
,
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
api
from
'../api'
;
class
ResetPassword
extends
Component
{
class
ResetPassword
extends
Component
{
...
@@ -13,6 +14,10 @@ class ResetPassword extends Component {
...
@@ -13,6 +14,10 @@ class ResetPassword extends Component {
confirmPassword
:
''
,
confirmPassword
:
''
,
showPass
:
false
,
showPass
:
false
,
showPass2
:
false
,
showPass2
:
false
,
errorPassword
:
false
,
errorConfirmPassword
:
false
,
msgPassword
:
''
,
msgConfirmPassword
:
''
,
userId
:
0
userId
:
0
}
}
}
}
...
@@ -21,6 +26,7 @@ class ResetPassword extends Component {
...
@@ -21,6 +26,7 @@ class ResetPassword extends Component {
console
.
log
(
this
.
props
.
match
.
params
.
id
)
console
.
log
(
this
.
props
.
match
.
params
.
id
)
let
userId
=
this
.
props
.
match
.
params
.
id
let
userId
=
this
.
props
.
match
.
params
.
id
this
.
setState
({
userId
})
this
.
setState
({
userId
})
// console.log(this.props)
}
}
confirmPassword
()
{
confirmPassword
()
{
...
@@ -29,13 +35,26 @@ class ResetPassword extends Component {
...
@@ -29,13 +35,26 @@ class ResetPassword extends Component {
"confirmPassword"
:
this
.
state
.
confirmPassword
,
"confirmPassword"
:
this
.
state
.
confirmPassword
,
"userId"
:
this
.
state
.
userId
"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
)
{
handleChange
(
e
)
{
let
data
=
this
.
state
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
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
()
{
render
()
{
return
(
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#51c6ea'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#51c6ea'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
...
@@ -48,9 +67,11 @@ class ResetPassword extends Component {
...
@@ -48,9 +67,11 @@ class ResetPassword extends Component {
type
=
{
this
.
state
.
showPass
?
'text'
:
'password'
}
type
=
{
this
.
state
.
showPass
?
'text'
:
'password'
}
name
=
{
"password"
}
name
=
{
"password"
}
value
=
{
this
.
state
.
password
}
value
=
{
this
.
state
.
password
}
onChange
=
{(
password
)
=>
this
.
handleChange
(
password
)
}
onChange
=
{(
password
)
=>
{
this
.
handleChange
(
password
)
}}
variant
=
"outlined"
variant
=
"outlined"
error
=
{
false
}
error
=
{
this
.
state
.
errorPassword
}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
32
}}
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>
}
helperText
=
{
<
Typography
style
=
{{
fontSize
:
9
,
marginTop
:
4
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Terdiri
8
karakter
dengan
kombinasi
angka
.
<
/Typography>
}
InputProps
=
{{
InputProps
=
{{
...
@@ -73,10 +94,12 @@ class ResetPassword extends Component {
...
@@ -73,10 +94,12 @@ class ResetPassword extends Component {
type
=
{
this
.
state
.
showPass2
?
'text'
:
'password'
}
type
=
{
this
.
state
.
showPass2
?
'text'
:
'password'
}
name
=
{
"confirmPassword"
}
name
=
{
"confirmPassword"
}
value
=
{
this
.
state
.
confirmPassword
}
value
=
{
this
.
state
.
confirmPassword
}
onChange
=
{(
confirmPassword
)
=>
this
.
handleChange
(
confirmPassword
)
}
onChange
=
{(
confirmPassword
)
=>
{
this
.
handleChange
(
confirmPassword
)
}}
variant
=
"outlined"
variant
=
"outlined"
error
=
{
false
}
error
=
{
this
.
state
.
errorConfirmPassword
}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
3
8
}}
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>
}
helperText
=
{
<
Typography
style
=
{{
fontSize
:
9
,
marginTop
:
4
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Terdiri
8
karakter
dengan
kombinasi
angka
.
<
/Typography>
}
InputProps
=
{{
InputProps
=
{{
endAdornment
:
<
InputAdornment
position
=
"end"
>
endAdornment
:
<
InputAdornment
position
=
"end"
>
...
@@ -92,7 +115,7 @@ class ResetPassword extends Component {
...
@@ -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
>
<
Typography
style
=
{{
fontSize
:
12
,
fontFamily
:
'Nunito Sans, sans-serif'
}}
>
Lanjut
<
/Typography
>
<
/Button
>
<
/Button
>
<
/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