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
e32ad7fa
Commit
e32ad7fa
authored
Aug 26, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
standarisasi validasi
parent
b98b27a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
CreateUnitBisnis.js
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
+6
-6
Profile.js
src/container/Profile.js
+3
-3
No files found.
src/container/MasterData/formUnitBisnis/CreateUnitBisnis.js
View file @
e32ad7fa
...
@@ -112,11 +112,11 @@ export default class CreateUnitBisnis extends Component {
...
@@ -112,11 +112,11 @@ export default class CreateUnitBisnis extends Component {
validasi
()
{
validasi
()
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business unit
is required
.'
})
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business unit
Cannot be Empty
.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
}
else
if
(
R
.
isEmpty
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date
is required
.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date
Cannot be Empty
.'
})
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
)
||
this
.
state
.
endDate
===
null
)
{
}
else
if
(
R
.
isEmpty
(
this
.
state
.
endDate
)
||
this
.
state
.
endDate
===
null
)
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date
is required
.'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date
Cannot be Empty
.'
})
}
else
{
}
else
{
let
payload
=
{
let
payload
=
{
"business_unit_id"
:
this
.
state
.
id
,
"business_unit_id"
:
this
.
state
.
id
,
...
@@ -130,11 +130,11 @@ export default class CreateUnitBisnis extends Component {
...
@@ -130,11 +130,11 @@ export default class CreateUnitBisnis extends Component {
validasiCreate
()
{
validasiCreate
()
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
if
(
R
.
isEmpty
(
this
.
state
.
name
))
{
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business unit
is required
.'
})
this
.
setState
({
errorName
:
true
,
msgErrorName
:
'Business unit
Cannot be Empty
.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date
is required
.'
})
this
.
setState
({
errorStartDate
:
true
,
msgErrorStartDate
:
'Start date
Cannot be Empty
.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date
is required
.'
})
this
.
setState
({
errorEndDate
:
true
,
msgErrorEndDate
:
'End date
Cannot be Empty
.'
})
}
else
{
}
else
{
let
payload
=
{
let
payload
=
{
"business_unit_name"
:
this
.
state
.
name
,
"business_unit_name"
:
this
.
state
.
name
,
...
...
src/container/Profile.js
View file @
e32ad7fa
...
@@ -78,7 +78,7 @@ export default class Profile extends Component {
...
@@ -78,7 +78,7 @@ export default class Profile extends Component {
validasi
()
{
validasi
()
{
if
(
this
.
state
.
oldPassword
==
""
)
{
if
(
this
.
state
.
oldPassword
==
""
)
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password
is required
.'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password
Cannot be Empty
.'
})
}
else
if
(
this
.
state
.
oldPassword
.
length
<
8
)
{
}
else
if
(
this
.
state
.
oldPassword
.
length
<
8
)
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password minimum 8 characters.'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password minimum 8 characters.'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
oldPassword
))
{
}
else
if
(
this
.
isEmail
(
this
.
state
.
oldPassword
))
{
...
@@ -86,7 +86,7 @@ export default class Profile extends Component {
...
@@ -86,7 +86,7 @@ export default class Profile extends Component {
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
oldPassword
))
{
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
oldPassword
))
{
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password must be a combination of characters, letters and numbers.'
})
this
.
setState
({
errorOldPassword
:
true
,
msgOldPassword
:
'Old password must be a combination of characters, letters and numbers.'
})
}
else
if
(
this
.
state
.
password
.
trim
()
==
""
)
{
}
else
if
(
this
.
state
.
password
.
trim
()
==
""
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
is required
.'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password
Cannot be Empty
.'
})
}
else
if
(
this
.
state
.
password
.
length
<
8
)
{
}
else
if
(
this
.
state
.
password
.
length
<
8
)
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password minimum 8 characters.'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password minimum 8 characters.'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
password
))
{
}
else
if
(
this
.
isEmail
(
this
.
state
.
password
))
{
...
@@ -94,7 +94,7 @@ export default class Profile extends Component {
...
@@ -94,7 +94,7 @@ export default class Profile extends Component {
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
}
else
if
(
!
this
.
isRegex
(
this
.
state
.
password
))
{
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password must be a combination of characters, letters and numbers.'
})
this
.
setState
({
errorPassword
:
true
,
msgPassword
:
'Password must be a combination of characters, letters and numbers.'
})
}
else
if
(
this
.
state
.
confirmPassword
.
trim
()
==
""
)
{
}
else
if
(
this
.
state
.
confirmPassword
.
trim
()
==
""
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation
is required
.'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation
Cannot be Empty
.'
})
}
else
if
(
this
.
state
.
confirmPassword
.
length
<
8
)
{
}
else
if
(
this
.
state
.
confirmPassword
.
length
<
8
)
{
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation of at least 8 characters.'
})
this
.
setState
({
errorConfirmPassword
:
true
,
msgConfirmPassword
:
'Password confirmation of at least 8 characters.'
})
}
else
if
(
this
.
isEmail
(
this
.
state
.
confirmPassword
))
{
}
else
if
(
this
.
isEmail
(
this
.
state
.
confirmPassword
))
{
...
...
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