From de8ac6c56a956ff7107defebcc1e41c4264da43e Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 21 Jun 2016 18:45:41 -0400 Subject: [PATCH 1/2] Only pass necessary props to steps Rather than lazily including all form progress to every step, just give each step what it needs. --- src/views/teacherregistration/steps.jsx | 18 +++++------ .../teacherregistration.jsx | 32 +++++++++++++------ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/views/teacherregistration/steps.jsx b/src/views/teacherregistration/steps.jsx index 341d6a749..030e56b24 100644 --- a/src/views/teacherregistration/steps.jsx +++ b/src/views/teacherregistration/steps.jsx @@ -5,7 +5,6 @@ var countryData = require('../../lib/country-data'); var intl = require('../../lib/intl.jsx'); var log = require('../../lib/log'); var smartyStreets = require('../../lib/smarty-streets'); -var urlParams = require('../../lib/url-params'); var Button = require('../../components/forms/button.jsx'); var Card = require('../../components/card/card.jsx'); @@ -286,10 +285,7 @@ module.exports = {
@@ -602,7 +600,7 @@ module.exports = {


- {this.props.formData.user && this.props.formData.user.email} + {this.props.email}

diff --git a/src/views/teacherregistration/teacherregistration.jsx b/src/views/teacherregistration/teacherregistration.jsx index 8ea60998e..89b51d930 100644 --- a/src/views/teacherregistration/teacherregistration.jsx +++ b/src/views/teacherregistration/teacherregistration.jsx @@ -79,15 +79,29 @@ var TeacherRegistration = React.createClass({ : - - - - - - - - - + + + + + + + + + } From 93ed60cd0d5d8dfc6705b8883108bbb1959e3d6a Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 22 Jun 2016 13:35:38 -0400 Subject: [PATCH 2/2] Add teacher waiting room view --- .../registration}/steps.jsx | 47 +++++++++++-------- src/l10n.json | 12 ++++- src/routes.json | 8 +++- src/views/teacherregistration/l10n.json | 10 +--- .../teacherregistration.jsx | 4 +- .../teacherwaitingroom/teacherwaitingroom.jsx | 35 ++++++++++++++ .../teacherwaitingroom.scss | 5 ++ 7 files changed, 89 insertions(+), 32 deletions(-) rename src/{views/teacherregistration => components/registration}/steps.jsx (94%) create mode 100644 src/views/teacherwaitingroom/teacherwaitingroom.jsx create mode 100644 src/views/teacherwaitingroom/teacherwaitingroom.scss diff --git a/src/views/teacherregistration/steps.jsx b/src/components/registration/steps.jsx similarity index 94% rename from src/views/teacherregistration/steps.jsx rename to src/components/registration/steps.jsx index 030e56b24..79b8bc5ae 100644 --- a/src/views/teacherregistration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -581,38 +581,47 @@ module.exports = { ); } })), - LastStep: intl.injectIntl(React.createClass({ + TeacherApprovalStep: intl.injectIntl(React.createClass({ getDefaultProps: function () { return { - email: null + email: null, + invited: false }; }, render: function () { return (

- +

- +

- -

-

-
- {this.props.email} -

-
- -

-

- -

-
+ {this.props.confirmed || !this.props.email ? + [] + : + ( +

+

+
+ {this.props.email} +

+
) + } + {this.props.invited ? + +

+

+ +

+
+ : + [] + } -

+

- +

diff --git a/src/l10n.json b/src/l10n.json index f0db5bb41..f01d798af 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -102,5 +102,15 @@ "parents.FaqAgeRangeA": "While Scratch is primarily designed for 8 to 16 year olds, it is also used by people of all ages, including younger children with their parents.", "parents.FaqAgeRangeQ": "What is the age range for Scratch?", "parents.FaqResourcesQ": "What resources are available for learning Scratch?", - "parents.introDescription": "Scratch is a programming language and an online community where children can program and share interactive media such as stories, games, and animation with people from all over the world. As children create with Scratch, they learn to think creatively, work collaboratively, and reason systematically. Scratch is designed and maintained by the Lifelong Kindergarten group at the MIT Media Lab." + "parents.introDescription": "Scratch is a programming language and an online community where children can program and share interactive media such as stories, games, and animation with people from all over the world. As children create with Scratch, they learn to think creatively, work collaboratively, and reason systematically. Scratch is designed and maintained by the Lifelong Kindergarten group at the MIT Media Lab.", + + "registration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account", + "registration.lastStepDescription": "We are currently processing your application. ", + "registration.confirmYourEmail": "Confirm Your Email", + "registration.confirmYourEmailDescription": "If you haven't already, please click the link in the confirmation email sent to:", + "registration.waitForApproval": "Wait for Approval", + "registration.waitForApprovalDescription": "Your information is being reviewed. Please be patient, the approval process can take up to 24 hours. You will receive an email with your login information once your account has been created.", + "registration.checkOutResources": "Get Started with Resources", + "registration.checkOutResourcesDescription": "Explore materials for educators and facilitators written by the Scratch Team, including tips, tutorials, and guides." + } diff --git a/src/routes.json b/src/routes.json index 4d5bae599..21494386d 100644 --- a/src/routes.json +++ b/src/routes.json @@ -69,10 +69,16 @@ }, { "name": "teacherregistration", - "pattern": "^/register-teacher/?$", + "pattern": "^/educators/register$", "view": "teacherregistration/teacherregistration", "title": "Teacher Registration" }, + { + "name": "teacherwaitingroom", + "pattern": "^/educators/waiting", + "view": "teacherwaitingroom/teacherwaitingroom", + "title": "Thank you for requesting a Scratch Teacher Account" + }, { "name": "wedo2", "pattern": "^/wedo/?$", diff --git a/src/views/teacherregistration/l10n.json b/src/views/teacherregistration/l10n.json index 1212b8499..810b80302 100644 --- a/src/views/teacherregistration/l10n.json +++ b/src/views/teacherregistration/l10n.json @@ -49,13 +49,5 @@ "teacherRegistration.howUseScratch": "How do you plan to use Scratch at your organization?", "teacherRegistration.emailStepTitle": "Email Address", "teacherRegistration.emailStepDescription": "We will send you a confirmation email that will allow you to access your Scratch Teacher Account.", - "teacherRegistration.validationEmailMatch": "The emails do not match", - "teacherRegistration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account", - "teacherRegistration.lastStepDescription": "We are currently processing your application. ", - "teacherRegistration.confirmYourEmail": "Confirm Your Email", - "teacherRegistration.confirmYourEmailDescription": "If you haven't already, please click the link in the confirmation email sent to:", - "teacherRegistration.waitForApproval": "Wait for Approval", - "teacherRegistration.waitForApprovalDescription": "Your information is being reviewed. Please be patient, the approval process can take up to 24 hours. You will receive an email with your login information once your account has been created.", - "teacherRegistration.checkOutResources": "Get Started with Resources", - "teacherRegistration.checkOutResourcesDescription": "Explore materials for educators and facilitators written by the Scratch Team, including tips, tutorials, and guides." + "teacherRegistration.validationEmailMatch": "The emails do not match" } diff --git a/src/views/teacherregistration/teacherregistration.jsx b/src/views/teacherregistration/teacherregistration.jsx index 89b51d930..4c012bc9b 100644 --- a/src/views/teacherregistration/teacherregistration.jsx +++ b/src/views/teacherregistration/teacherregistration.jsx @@ -6,7 +6,7 @@ var api = require('../../lib/api'); var Deck = require('../../components/deck/deck.jsx'); var Progression = require('../../components/progression/progression.jsx'); -var Steps = require('./steps.jsx'); +var Steps = require('../../components/registration/steps.jsx'); require('./teacherregistration.scss'); @@ -101,7 +101,7 @@ var TeacherRegistration = React.createClass({ waiting={this.state.waiting} /> - + } diff --git a/src/views/teacherwaitingroom/teacherwaitingroom.jsx b/src/views/teacherwaitingroom/teacherwaitingroom.jsx new file mode 100644 index 000000000..fd1872b47 --- /dev/null +++ b/src/views/teacherwaitingroom/teacherwaitingroom.jsx @@ -0,0 +1,35 @@ +var classNames = require('classnames'); +var connect = require('react-redux').connect; +var React = require('react'); +var render = require('../../lib/render.jsx'); + +var Deck = require ('../../components/deck/deck.jsx'); +var TeacherApprovalStep = require('../../components/registration/steps.jsx').TeacherApprovalStep; + +require('./teacherwaitingroom.scss'); + +var TeacherWaitingRoom = React.createClass({ + displayName: 'TeacherWaitingRoom', + render: function () { + var permissions = this.props.session.permissions || {}; + var user = this.props.session.user || {}; + return ( + + + + ); + } +}); + +var mapStateToProps = function (state) { + return { + session: state.session.session + }; +}; + +var ConnectedTeacherWaitingRoom = connect(mapStateToProps)(TeacherWaitingRoom); + +render(, document.getElementById('app')); diff --git a/src/views/teacherwaitingroom/teacherwaitingroom.scss b/src/views/teacherwaitingroom/teacherwaitingroom.scss new file mode 100644 index 000000000..51167b50c --- /dev/null +++ b/src/views/teacherwaitingroom/teacherwaitingroom.scss @@ -0,0 +1,5 @@ +@import "../../colors"; + +.teacher-waitingroom { + background-color: $ui-purple; +}