mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
parent
2fc62cba13
commit
537104c56b
3 changed files with 14 additions and 4 deletions
|
@ -23,6 +23,7 @@ module.exports.validations = {
|
||||||
return phoneNumberUtil.isValidNumber(parsed);
|
return phoneNumberUtil.isValidNumber(parsed);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
module.exports.validations.notEqualsUsername = module.exports.validations.notEquals;
|
||||||
|
|
||||||
module.exports.validationHOCFactory = function (defaultValidationErrors) {
|
module.exports.validationHOCFactory = function (defaultValidationErrors) {
|
||||||
return function (Component) {
|
return function (Component) {
|
||||||
|
|
|
@ -226,6 +226,7 @@ module.exports = {
|
||||||
ChoosePasswordStep: intl.injectIntl(React.createClass({
|
ChoosePasswordStep: intl.injectIntl(React.createClass({
|
||||||
getDefaultProps: function () {
|
getDefaultProps: function () {
|
||||||
return {
|
return {
|
||||||
|
studentUsername: null,
|
||||||
showPassword: false,
|
showPassword: false,
|
||||||
waiting: false
|
waiting: false
|
||||||
};
|
};
|
||||||
|
@ -257,7 +258,7 @@ module.exports = {
|
||||||
validations={{
|
validations={{
|
||||||
minLength: 6,
|
minLength: 6,
|
||||||
notEquals: 'password',
|
notEquals: 'password',
|
||||||
notEqualsField: 'user.username'
|
notEqualsUsername: this.props.studentUsername
|
||||||
}}
|
}}
|
||||||
validationErrors={{
|
validationErrors={{
|
||||||
minLength: formatMessage({
|
minLength: formatMessage({
|
||||||
|
@ -266,7 +267,7 @@ module.exports = {
|
||||||
notEquals: formatMessage({
|
notEquals: formatMessage({
|
||||||
id: 'registration.validationPasswordNotEquals'
|
id: 'registration.validationPasswordNotEquals'
|
||||||
}),
|
}),
|
||||||
notEqualsField: formatMessage({
|
notEqualsUsername: formatMessage({
|
||||||
id: 'registration.validationPasswordNotUsername'
|
id: 'registration.validationPasswordNotUsername'
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
@ -879,7 +880,11 @@ 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;
|
||||||
|
|
|
@ -132,7 +132,11 @@ var StudentCompleteRegistration = intl.injectIntl(React.createClass({
|
||||||
{this.props.must_reset_password ?
|
{this.props.must_reset_password ?
|
||||||
<Steps.ChoosePasswordStep onNextStep={this.advanceStep}
|
<Steps.ChoosePasswordStep onNextStep={this.advanceStep}
|
||||||
showPassword={true}
|
showPassword={true}
|
||||||
waiting={this.state.waiting} />
|
waiting={this.state.waiting}
|
||||||
|
studentUsername={
|
||||||
|
this.state.formData.user &&
|
||||||
|
this.state.formData.user.username
|
||||||
|
} />
|
||||||
:
|
:
|
||||||
[]
|
[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue