Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
d639d17d
Commit
d639d17d
authored
Aug 10, 2016
by
Matthew Taylor
Committed by
GitHub
Aug 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #827 from mewtaylor/issue/gh-816
[Develop] Hotfix: Remove `phoneLength` validation
parents
f49d6e6a
6e3a18a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
13 deletions
+3
-13
src/components/forms/phone-input.jsx
src/components/forms/phone-input.jsx
+2
-4
src/components/forms/validations.jsx
src/components/forms/validations.jsx
+0
-8
src/components/registration/steps.jsx
src/components/registration/steps.jsx
+1
-1
No files found.
src/components/forms/phone-input.jsx
View file @
d639d17d
...
...
@@ -25,8 +25,7 @@ var PhoneInput = React.createClass({
getDefaultProps
:
function
()
{
return
{
validations
:
{
isPhone
:
true
,
phoneLength
:
true
isPhone
:
true
},
flagsImagePath
:
'
/images/flags.png
'
,
defaultCountry
:
'
us
'
...
...
@@ -65,8 +64,7 @@ var PhoneInput = React.createClass({
});
var
phoneValidationHOC
=
validationHOCFactory
({
isPhone
:
<
intl
.
FormattedMessage
id=
"teacherRegistration.validationPhoneNumber"
/>,
phoneLength
:
<
intl
.
FormattedMessage
id=
"teacherRegistration.validationPhoneNumber"
/>
isPhone
:
<
intl
.
FormattedMessage
id=
"teacherRegistration.validationPhoneNumber"
/>
});
module
.
exports
=
inputHOC
(
defaultValidationHOC
(
phoneValidationHOC
(
PhoneInput
)));
src/components/forms/validations.jsx
View file @
d639d17d
...
...
@@ -21,14 +21,6 @@ module.exports.validations = {
return
false
;
}
return
phoneNumberUtil
.
isValidNumber
(
parsed
);
},
phoneLength
:
function
(
values
,
value
)
{
if
(
typeof
value
===
'
undefined
'
)
return
true
;
if
(
value
&&
value
.
national_number
===
'
+
'
)
return
true
;
if
(
value
&&
value
.
national_number
.
length
===
value
.
country_code
.
format
.
length
)
{
return
true
;
}
return
false
;
}
};
...
...
src/components/registration/steps.jsx
View file @
d639d17d
...
...
@@ -416,7 +416,7 @@ module.exports = {
};
},
onValidSubmit
:
function
(
formData
,
reset
,
invalidate
)
{
if
(
formData
.
phone
.
national_number
.
length
!==
formData
.
phone
.
country_code
.
format
.
length
)
{
if
(
!
formData
.
phone
||
formData
.
phone
.
national_number
===
'
+
'
)
{
return
invalidate
({
'
phone
'
:
this
.
props
.
intl
.
formatMessage
({
id
:
'
teacherRegistration.validationPhoneNumber
'
})
});
...
...
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