feat: VAN-935 - Launch rename register (#566)

This commit is contained in:
Shafqat Farhan
2022-04-26 14:13:35 +05:00
committed by GitHub
parent 38cbd4d0d8
commit eddce35a37
4 changed files with 6 additions and 39 deletions

View File

@@ -37,8 +37,8 @@ $accent-a-light: #c9f2f5;
width: 12rem;
}
.stateful-button-variation1-width {
width: 16.4rem;
.register-stateful-button-width {
min-width: 14.4rem;
}
.login-button-width {

View File

@@ -4,7 +4,6 @@ import { connect } from 'react-redux';
import Skeleton from 'react-loading-skeleton';
import { Helmet } from 'react-helmet';
import PropTypes, { string } from 'prop-types';
import classNames from 'classnames';
import { getConfig } from '@edx/frontend-platform';
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
@@ -76,8 +75,6 @@ class RegistrationPage extends React.Component {
optimizelyExperimentName: '',
readOnly: true,
validatePassword: false,
// TODO: Remove after VAN-876 experimentation is complete.
registerRenameExpVariation: '',
};
}
@@ -90,13 +87,6 @@ class RegistrationPage extends React.Component {
isActive: true,
});
if (payload.register_for_free === 'true') {
window.optimizely.push({
type: 'event',
eventName: 'van-876-authn-registration-page',
});
}
if (payload.save_for_later === 'true') {
sendTrackEvent('edx.bi.user.saveforlater.course.enroll.clicked', { category: 'save-for-later' });
}
@@ -174,15 +164,11 @@ class RegistrationPage extends React.Component {
}
getExperiments = () => {
const { experimentName, renameRegisterExperiment } = window;
const { experimentName } = window;
if (experimentName) {
this.setState({ optimizelyExperimentName: experimentName });
}
if (renameRegisterExperiment) {
this.setState({ registerRenameExpVariation: renameRegisterExperiment });
}
};
handleSubmit = (e) => {
@@ -523,7 +509,6 @@ class RegistrationPage extends React.Component {
setSurveyCookie('register');
setCookie(getConfig().REGISTER_CONVERSION_COOKIE_NAME, true);
setCookie('authn-returning-user');
const payload = { ...this.queryParams };
// Fire optimizely events
window.optimizely = window.optimizely || [];
@@ -534,13 +519,6 @@ class RegistrationPage extends React.Component {
value: this.state.totalRegistrationTime,
},
});
if (payload.register_for_free === 'true') {
window.optimizely.push({
type: 'event',
eventName: 'van-876-authn-register-for-free-conversion',
});
}
}
return (
@@ -673,16 +651,10 @@ class RegistrationPage extends React.Component {
<StatefulButton
type="submit"
variant="brand"
className={classNames(
'mt-4 mb-4',
{ 'stateful-button-variation1-width': this.state.registerRenameExpVariation === 'variation1' },
{ 'stateful-button-width': this.state.registerRenameExpVariation !== 'variation1' },
)}
className="register-stateful-button-width mt-4 mb-4"
state={submitState}
labels={{
default: this.state.registerRenameExpVariation === 'variation1' ? (
intl.formatMessage(messages['create.account.for.free.button'])
) : intl.formatMessage(messages['create.account.button']),
default: intl.formatMessage(messages['create.account.for.free.button']),
pending: '',
}}
onClick={this.handleSubmit}

View File

@@ -59,11 +59,6 @@ const messages = defineMessages({
description: 'Help text for email field on registration page',
},
// Form buttons
'create.account.button': {
id: 'create.account.button',
defaultMessage: 'Create an account',
description: 'Button label that appears on register page',
},
'create.account.for.free.button': {
id: 'create.account.for.free.button',
defaultMessage: 'Create an account for free',

View File

@@ -404,7 +404,7 @@ describe('RegistrationPage', () => {
it('should match default button state', () => {
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
expect(registrationPage.find('button[type="submit"] span').first().text()).toEqual('Create an account');
expect(registrationPage.find('button[type="submit"] span').first().text()).toEqual('Create an account for free');
});
it('should match pending button state', () => {