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
6f9c16a7
Commit
6f9c16a7
authored
Jul 05, 2016
by
Ray Schamp
Committed by
GitHub
Jul 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #667 from rschamp/bugfix/647
Add style to general error messages
parents
0d239647
d990dee7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
src/components/forms/form.jsx
src/components/forms/form.jsx
+7
-3
src/components/forms/general-error.jsx
src/components/forms/general-error.jsx
+3
-1
src/components/forms/general-error.scss
src/components/forms/general-error.scss
+9
-0
src/components/registration/steps.jsx
src/components/registration/steps.jsx
+4
-0
No files found.
src/components/forms/form.jsx
View file @
6f9c16a7
...
...
@@ -2,7 +2,6 @@ var classNames = require('classnames');
var
Formsy
=
require
(
'
formsy-react
'
);
var
omit
=
require
(
'
lodash.omit
'
);
var
React
=
require
(
'
react
'
);
var
GeneralError
=
require
(
'
./general-error.jsx
'
);
var
validations
=
require
(
'
./validations.jsx
'
).
validations
;
for
(
var
validation
in
validations
)
{
...
...
@@ -32,8 +31,13 @@ var Form = React.createClass({
);
return
(
<
Formsy
.
Form
{
...
this
.
props
}
className=
{
classes
}
ref=
"formsy"
onChange=
{
this
.
onChange
}
>
<
GeneralError
name=
"all"
value=
{
this
.
state
.
allValues
}
/>
{
this
.
props
.
children
}
{
React
.
Children
.
map
(
this
.
props
.
children
,
function
(
child
)
{
if
(
child
.
props
.
name
===
'
all
'
)
{
return
React
.
cloneElement
(
child
,
{
value
:
this
.
state
.
allValues
});
}
else
{
return
child
;
}
}.
bind
(
this
))
}
</
Formsy
.
Form
>
);
}
...
...
src/components/forms/general-error.jsx
View file @
6f9c16a7
var
Formsy
=
require
(
'
formsy-react
'
);
var
React
=
require
(
'
react
'
);
require
(
'
./general-error.scss
'
);
/*
* A special formsy-react component that only outputs
* error messages. If you want to display errors that
...
...
@@ -12,7 +14,7 @@ module.exports = Formsy.HOC(React.createClass({
render
:
function
()
{
if
(
!
this
.
props
.
showError
())
return
null
;
return
(
<
p
className=
"error"
>
<
p
className=
"
general-
error"
>
{
this
.
props
.
getErrorMessage
()
}
</
p
>
);
...
...
src/components/forms/general-error.scss
0 → 100644
View file @
6f9c16a7
@import
"../../colors"
;
.general-error
{
border
:
1px
solid
$active-gray
;
border-radius
:
4px
;
background-color
:
$ui-orange
;
padding
:
1rem
;
color
:
$type-white
;
}
src/components/registration/steps.jsx
View file @
6f9c16a7
...
...
@@ -12,6 +12,7 @@ var CharCount = require('../../components/forms/charcount.jsx');
var
Checkbox
=
require
(
'
../../components/forms/checkbox.jsx
'
);
var
CheckboxGroup
=
require
(
'
../../components/forms/checkbox-group.jsx
'
);
var
Form
=
require
(
'
../../components/forms/form.jsx
'
);
var
GeneralError
=
require
(
'
../../components/forms/general-error.jsx
'
);
var
Input
=
require
(
'
../../components/forms/input.jsx
'
);
var
PhoneInput
=
require
(
'
../../components/forms/phone-input.jsx
'
);
var
RadioGroup
=
require
(
'
../../components/forms/radio-group.jsx
'
);
...
...
@@ -148,6 +149,7 @@ module.exports = {
onChange=
{
this
.
onChangeShowPassword
}
help=
{
null
}
name=
"showPassword"
/>
<
GeneralError
name=
"all"
/>
<
NextStepButton
waiting=
{
this
.
props
.
waiting
||
this
.
state
.
waiting
}
text=
{
<
intl
.
FormattedMessage
id=
"teacherRegistration.nextStep"
/>
}
/>
</
Form
>
...
...
@@ -508,6 +510,7 @@ module.exports = {
type=
"text"
name=
"address.zip"
required
/>
<
GeneralError
name=
"all"
/>
<
NextStepButton
waiting=
{
this
.
props
.
waiting
||
this
.
state
.
waiting
}
text=
{
<
intl
.
FormattedMessage
id=
"teacherRegistration.nextStep"
/>
}
/>
</
Form
>
...
...
@@ -631,6 +634,7 @@ module.exports = {
equalsField
:
formatMessage
({
id
:
'
general.validationEmailMatch
'
})
}
}
required
/>
<
GeneralError
name=
"all"
/>
<
NextStepButton
waiting=
{
this
.
props
.
waiting
}
text=
{
<
intl
.
FormattedMessage
id=
"teacherRegistration.nextStep"
/>
}
/>
</
Form
>
...
...
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