Commit 99c1f3f0 authored by Ray Schamp's avatar Ray Schamp

Avoid adding click event properties to formData

Setting onClick to onNextStep directly caused click event data to be passed in handleAdvanceStep, which then merged it with the formData state in student registration. This caused issues.
parent 2df91125
...@@ -1332,45 +1332,58 @@ const IntlTeacherApprovalStep = injectIntl(TeacherApprovalStep); ...@@ -1332,45 +1332,58 @@ const IntlTeacherApprovalStep = injectIntl(TeacherApprovalStep);
/* /*
* CLASS INVITE NEW STUDENT STEP * CLASS INVITE NEW STUDENT STEP
*/ */
const ClassInviteNewStudentStep = props => ( class ClassInviteNewStudentStep extends React.Component {
<Slide className="registration-step class-invite-step"> constructor (props) {
{props.waiting ? [ super(props);
<Spinner key="spinner" /> bindAll(this, [
] : [ 'handleNextStep'
<Avatar ]);
className="invite-avatar" }
key="avatar" handleNextStep () {
src={props.classroom.educator.profile.images['50x50']} return this.props.onNextStep();
/>, }
<h2 key="username">{props.classroom.educator.username}</h2>, render () {
<p return (
className="description" <Slide className="registration-step class-invite-step">
key="description" {this.props.waiting ? [
> <Spinner key="spinner" />
{props.intl.formatMessage({id: 'registration.classroomInviteNewStudentStepDescription'})} ] : [
</p>, <Avatar
<Card key="card"> className="invite-avatar"
<div className="contents"> key="avatar"
<h3>{props.classroom.title}</h3> src={this.props.classroom.educator.profile.images['50x50']}
<img />,
className="class-image" <h2 key="username">{this.props.classroom.educator.username}</h2>,
src={props.classroom.images['250x150']} <p
className="description"
key="description"
>
{this.props.intl.formatMessage({id: 'registration.classroomInviteNewStudentStepDescription'})}
</p>,
<Card key="card">
<div className="contents">
<h3>{this.props.classroom.title}</h3>
<img
className="class-image"
src={this.props.classroom.images['250x150']}
/>
</div>
<NextStepButton
text={this.props.intl.formatMessage({id: 'general.getStarted'})}
waiting={this.props.waiting}
onClick={this.handleNextStep}
/>
</Card>,
<StepNavigation
active={this.props.activeStep}
key="step"
steps={this.props.totalSteps - 1}
/> />
</div> ]}
<NextStepButton </Slide>
text={props.intl.formatMessage({id: 'general.getStarted'})} );
waiting={props.waiting} }
onClick={props.onNextStep} }
/>
</Card>,
<StepNavigation
active={props.activeStep}
key="step"
steps={props.totalSteps - 1}
/>
]}
</Slide>
);
ClassInviteNewStudentStep.propTypes = { ClassInviteNewStudentStep.propTypes = {
activeStep: PropTypes.number, activeStep: PropTypes.number,
...@@ -1398,47 +1411,62 @@ const IntlClassInviteNewStudentStep = injectIntl(ClassInviteNewStudentStep); ...@@ -1398,47 +1411,62 @@ const IntlClassInviteNewStudentStep = injectIntl(ClassInviteNewStudentStep);
/* /*
* CLASS INVITE EXISTING STUDENT STEP * CLASS INVITE EXISTING STUDENT STEP
*/ */
const ClassInviteExistingStudentStep = props => ( class ClassInviteExistingStudentStep extends React.Component {
<Slide className="registration-step class-invite-step"> constructor (props) {
{props.waiting ? [ super(props);
<Spinner key="spinner" /> bindAll(this, [
] : [ 'handleNextStep'
<h2 key="username">{props.studentUsername}</h2>, ]);
<p }
className="description" handleNextStep () {
key="description" return this.props.onNextStep();
> }
{props.intl.formatMessage({id: 'registration.classroomInviteExistingStudentStepDescription'})} render () {
</p>, return (
<Card key="card"> <Slide className="registration-step class-invite-step">
<div className="contents"> {this.props.waiting ? [
<h3>{props.classroom.title}</h3> <Spinner key="spinner" />
<img ] : [
className="class-image" <h2 key="username">{this.props.studentUsername}</h2>,
src={props.classroom.images['250x150']} <p
className="description"
key="description"
>
{this.props.intl.formatMessage({
id: 'registration.classroomInviteExistingStudentStepDescription'
})}
</p>,
<Card key="card">
<div className="contents">
<h3>{this.props.classroom.title}</h3>
<img
className="class-image"
src={this.props.classroom.images['250x150']}
/>
<p>{this.props.intl.formatMessage({id: 'registration.invitedBy'})}</p>
<p><strong>{this.props.classroom.educator.username}</strong></p>
</div>
<NextStepButton
text={this.props.intl.formatMessage({id: 'general.getStarted'})}
waiting={this.props.waiting}
onClick={this.handleNextStep}
/>
</Card>,
<p key="logout">
<a onClick={this.props.onHandleLogOut}>
{this.props.intl.formatMessage({id: 'registration.notYou'})}
</a>
</p>,
<StepNavigation
active={this.props.activeStep}
key="step"
steps={this.props.totalSteps - 1}
/> />
<p>{props.intl.formatMessage({id: 'registration.invitedBy'})}</p> ]}
<p><strong>{props.classroom.educator.username}</strong></p> </Slide>
</div> );
<NextStepButton }
text={props.intl.formatMessage({id: 'general.getStarted'})} }
waiting={props.waiting}
onClick={props.onNextStep}
/>
</Card>,
<p key="logout">
<a onClick={props.onHandleLogOut}>
{props.intl.formatMessage({id: 'registration.notYou'})}
</a>
</p>,
<StepNavigation
active={props.activeStep}
key="step"
steps={props.totalSteps - 1}
/>
]}
</Slide>
);
ClassInviteExistingStudentStep.propTypes = { ClassInviteExistingStudentStep.propTypes = {
activeStep: PropTypes.number, activeStep: PropTypes.number,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment