Unverified Commit 2bf0071b authored by Benjamin Wheeler's avatar Benjamin Wheeler Committed by GitHub

Merge pull request #4097 from LLK/hotfix/remove-opt-in

[Develop] remove email opt-in from join flow
parents 8bdbe7ea 924c862b
......@@ -9,7 +9,6 @@ const FormattedMessage = require('react-intl').FormattedMessage;
const validate = require('../../lib/validate');
const JoinFlowStep = require('./join-flow-step.jsx');
const FormikInput = require('../../components/formik-forms/formik-input.jsx');
const FormikCheckbox = require('../../components/formik-forms/formik-checkbox.jsx');
const InfoButton = require('../info-button/info-button.jsx');
const Captcha = require('../../components/captcha/captcha.jsx');
require('./join-flow-steps.scss');
......@@ -100,8 +99,7 @@ class EmailStep extends React.Component {
return (
<Formik
initialValues={{
email: '',
subscribe: false
email: ''
}}
validate={this.validateForm}
validateOnBlur={false}
......@@ -186,13 +184,6 @@ class EmailStep extends React.Component {
message={this.props.intl.formatMessage({id: 'registration.emailStepInfo'})}
/>
</div>
<div className="join-flow-email-checkbox-row">
<FormikCheckbox
id="subscribeCheckbox"
label={this.props.intl.formatMessage({id: 'registration.receiveEmails'})}
name="subscribe"
/>
</div>
<Captcha
ref={this.setCaptchaRef}
onCaptchaError={this.props.onCaptchaError}
......
......@@ -194,7 +194,6 @@ class JoinFlow extends React.Component {
'g-recaptcha-response': formData['g-recaptcha-response'],
'gender': formData.gender,
'country': formData.country,
'subscribe': true,
'is_robot': formData.yesno
// no need to include csrfmiddlewaretoken; will be provided in
// X-CSRFToken header, which scratchr2 looks for in
......
......@@ -184,7 +184,7 @@
"registration.genderOptionAnother": "Another gender:",
"registration.genderOptionPreferNotToSay": "Prefer not to say",
"registration.emailStepTitle": "What's your email?",
"registration.emailStepInfo": "This will help if you forget your password, or if you want to receive email updates. This information will not be made public on your account.",
"registration.emailStepInfo": "This will help if you forget your password. This information will not be made public on your account.",
"registration.goToClass": "Go to Class",
"registration.invitedBy": "invited by",
"registration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account",
......@@ -201,7 +201,6 @@
"registration.personalStepDescription": "Your individual responses will not be displayed publicly, and will be kept confidential and secure",
"registration.private": "We will keep this information private.",
"registration.problemsAre": "The problems are:",
"registration.receiveEmails": "I'd like to receive emails from the Scratch Team about project ideas, events, and more.",
"registration.selectCountry": "Select country",
"registration.startOverInstruction": "Click \"Start over.\"",
"registration.studentPersonalStepDescription": "This information will not appear on the Scratch website.",
......
......@@ -3,7 +3,6 @@ const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
const {mountWithIntl} = require('../../helpers/intl-helpers.jsx');
const JoinFlowStep = require('../../../src/components/join-flow/join-flow-step.jsx');
const FormikInput = require('../../../src/components/formik-forms/formik-input.jsx');
const FormikCheckbox = require('../../../src/components/formik-forms/formik-checkbox.jsx');
const requestSuccessResponse = {
requestSucceeded: true,
......@@ -49,7 +48,6 @@ describe('EmailStep test', () => {
{...defaultProps()}
/>);
const emailStepWrapper = intlWrapper.dive();
expect(emailStepWrapper.props().initialValues.subscribe).toBe(false);
expect(emailStepWrapper.props().initialValues.email).toBe('');
expect(emailStepWrapper.props().validateOnBlur).toBe(false);
expect(emailStepWrapper.props().validateOnChange).toBe(false);
......@@ -94,23 +92,6 @@ describe('EmailStep test', () => {
expect(emailInputWrapper.props().validate).toEqual(emailStepWrapper.instance().validateEmail);
});
test('props sent to FormikCheckbox for subscribe', () => {
const intlWrapper = shallowWithIntl(<EmailStep
{...defaultProps()}
/>);
// Dive to get past the intl wrapper
const emailStepWrapper = intlWrapper.dive();
// Dive to get past the anonymous component.
const joinFlowWrapper = emailStepWrapper.dive().find(JoinFlowStep);
expect(joinFlowWrapper).toHaveLength(1);
const checkboxWrapper = joinFlowWrapper.find(FormikCheckbox).first();
expect(checkboxWrapper).toHaveLength(1);
expect(checkboxWrapper.first().props().id).toEqual('subscribeCheckbox');
expect(checkboxWrapper.first().props().label).toEqual('registration.receiveEmails');
expect(checkboxWrapper.first().props().name).toEqual('subscribe');
});
test('handleValidSubmit passes formData to next step', () => {
const formikBag = {
setSubmitting: jest.fn()
......
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