mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
Update from feedback
use props for username rather than constructed form data, and `studentUsername -> username`. Thanks @rschamp!
This commit is contained in:
parent
cbf76ec636
commit
f8de61f067
2 changed files with 4 additions and 11 deletions
|
@ -226,7 +226,7 @@ module.exports = {
|
||||||
ChoosePasswordStep: intl.injectIntl(React.createClass({
|
ChoosePasswordStep: intl.injectIntl(React.createClass({
|
||||||
getDefaultProps: function () {
|
getDefaultProps: function () {
|
||||||
return {
|
return {
|
||||||
studentUsername: null,
|
username: null,
|
||||||
showPassword: false,
|
showPassword: false,
|
||||||
waiting: false
|
waiting: false
|
||||||
};
|
};
|
||||||
|
@ -258,7 +258,7 @@ module.exports = {
|
||||||
validations={{
|
validations={{
|
||||||
minLength: 6,
|
minLength: 6,
|
||||||
notEquals: 'password',
|
notEquals: 'password',
|
||||||
notEqualsUsername: this.props.studentUsername
|
notEqualsUsername: this.props.username
|
||||||
}}
|
}}
|
||||||
validationErrors={{
|
validationErrors={{
|
||||||
minLength: formatMessage({
|
minLength: formatMessage({
|
||||||
|
@ -880,11 +880,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onNextStep: function () {
|
onNextStep: function () {
|
||||||
this.props.onNextStep({
|
this.props.onNextStep();
|
||||||
user: {
|
|
||||||
username: this.props.studentUsername
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
var formatMessage = this.props.intl.formatMessage;
|
var formatMessage = this.props.intl.formatMessage;
|
||||||
|
|
|
@ -133,10 +133,7 @@ var StudentCompleteRegistration = intl.injectIntl(React.createClass({
|
||||||
<Steps.ChoosePasswordStep onNextStep={this.advanceStep}
|
<Steps.ChoosePasswordStep onNextStep={this.advanceStep}
|
||||||
showPassword={true}
|
showPassword={true}
|
||||||
waiting={this.state.waiting}
|
waiting={this.state.waiting}
|
||||||
studentUsername={
|
username={this.props.studentUsername} />
|
||||||
this.state.formData.user &&
|
|
||||||
this.state.formData.user.username
|
|
||||||
} />
|
|
||||||
:
|
:
|
||||||
[]
|
[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue