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
6d5bb4f8
Commit
6d5bb4f8
authored
Aug 12, 2016
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `maxLength` validations where needed
fixes #835
parent
5001d3a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
src/components/registration/steps.jsx
src/components/registration/steps.jsx
+88
-0
src/l10n.json
src/l10n.json
+1
-0
No files found.
src/components/registration/steps.jsx
View file @
6d5bb4f8
...
...
@@ -333,6 +333,14 @@ module.exports = {
<
div
className=
"gender-input"
>
<
Input
name=
"user.genderOther"
type=
"text"
validations=
{
{
maxLength
:
25
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
disabled=
{
this
.
state
.
otherDisabled
}
required=
{
!
this
.
state
.
otherDisabled
}
help=
{
null
}
/>
...
...
@@ -376,10 +384,26 @@ module.exports = {
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.firstName
'
})
}
type=
"text"
name=
"user.name.first"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.lastName
'
})
}
type=
"text"
name=
"user.name.last"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
NextStepButton
waiting=
{
this
.
props
.
waiting
}
text=
{
<
intl
.
FormattedMessage
id=
"registration.nextStep"
/>
}
/>
...
...
@@ -498,10 +522,26 @@ module.exports = {
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.organization
'
})
}
type=
"text"
name=
"organization.name"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.orgTitle
'
})
}
type=
"text"
name=
"organization.title"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
div
className=
"organization-type"
>
<
b
><
intl
.
FormattedMessage
id=
"teacherRegistration.orgType"
/></
b
>
...
...
@@ -517,6 +557,14 @@ module.exports = {
<
div
className=
"other-input"
>
<
Input
type=
"text"
name=
"organization.other"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
disabled=
{
this
.
state
.
otherDisabled
}
required=
"isFalse"
placeholder=
{
formatMessage
({
id
:
'
general.other
'
})
}
/>
...
...
@@ -528,6 +576,14 @@ module.exports = {
</
p
>
<
Input
type=
"url"
name=
"organization.url"
validations=
{
{
maxLength
:
200
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required=
"isFalse"
placeholder=
{
'
http://
'
}
/>
</
div
>
...
...
@@ -611,14 +667,38 @@ module.exports = {
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.addressLine1
'
})
}
type=
"text"
name=
"address.line1"
validations=
{
{
maxLength
:
100
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.addressLine2
'
})
}
type=
"text"
name=
"address.line2"
validations=
{
{
maxLength
:
100
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required=
"isFalse"
/>
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.city
'
})
}
type=
"text"
name=
"address.city"
validations=
{
{
maxLength
:
50
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
{
stateOptions
.
length
>
2
?
<
Select
label=
{
formatMessage
({
id
:
'
teacherRegistration.stateProvince
'
})
}
...
...
@@ -630,6 +710,14 @@ module.exports = {
<
Input
label=
{
formatMessage
({
id
:
'
teacherRegistration.zipCode
'
})
}
type=
"text"
name=
"address.zip"
validations=
{
{
maxLength
:
10
}
}
validationErrors=
{
{
maxLength
:
formatMessage
({
id
:
'
registration.validationMaxLength
'
})
}
}
required
/>
<
GeneralError
name=
"all"
/>
<
NextStepButton
waiting=
{
this
.
props
.
waiting
||
this
.
state
.
waiting
}
...
...
src/l10n.json
View file @
6d5bb4f8
...
...
@@ -139,6 +139,7 @@
"registration.studentUsernameFieldHelpText"
:
"For safety, don't use your real name!"
,
"registration.usernameStepTitle"
:
"Request a Teacher Account"
,
"registration.usernameStepTitleScratcher"
:
"Create a Scratch Account"
,
"registration.validationMaxLength"
:
"Sorry, that is too many characters for us."
,
"registration.validationPasswordLength"
:
"Passwords must be at least six characters"
,
"registration.validationPasswordNotEquals"
:
"Your password may not be
\"
password
\"
"
,
"registration.validationPasswordNotUsername"
:
"Your password may not be your username"
,
...
...
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