Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
68bbae6d
Commit
68bbae6d
authored
Mar 28, 2018
by
Gijs Hendriksen
Browse files
Show previous answers to registration fields when updating registrations
parent
a6795f44
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/ui/screens/events/Registration.js
View file @
68bbae6d
...
...
@@ -25,19 +25,25 @@ class Registration extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
componentWillReceiveProps
=
(
props
)
=>
{
const
update
=
{};
const
keys
=
Object
.
keys
(
props
.
fields
);
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
+=
1
)
{
const
field
=
props
.
fields
[
keys
[
i
]];
if
(
field
.
type
===
'
boolean
'
)
{
this
.
st
ate
[
keys
[
i
]]
=
Boolean
(
field
.
value
);
upd
ate
[
keys
[
i
]]
=
Boolean
(
field
.
value
);
}
else
if
(
field
.
type
===
'
integer
'
||
field
.
type
===
'
text
'
)
{
this
.
st
ate
[
keys
[
i
]]
=
field
.
value
===
null
?
''
:
String
(
field
.
value
);
upd
ate
[
keys
[
i
]]
=
field
.
value
===
null
?
''
:
String
(
field
.
value
);
}
else
{
this
.
st
ate
[
keys
[
i
]]
=
field
.
value
;
upd
ate
[
keys
[
i
]]
=
field
.
value
;
}
}
}
this
.
setState
(
update
);
};
getFieldValidity
=
(
key
)
=>
{
const
field
=
this
.
props
.
fields
[
key
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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