Skip to content

Commit 3635476

Browse files
feat: Remove simplify registration experiment code (#1194)
1 parent f53add8 commit 3635476

20 files changed

+122
-611
lines changed

src/common-components/messages.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ const messages = defineMessages({
132132
defaultMessage: 'Company or school credentials',
133133
description: 'Company or school login link text.',
134134
},
135-
// simplify registration experiment messages
136-
'tab.back.btn.text': {
137-
id: 'tab.back.btn.text',
138-
defaultMessage: 'Back',
139-
description: 'Tab back button text',
140-
},
141135
});
142136

143137
export default messages;

src/config/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const configuration = {
3434
ZENDESK_LOGO_URL: process.env.ZENDESK_LOGO_URL,
3535
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID || '',
3636
ALGOLIA_SEARCH_API_KEY: process.env.ALGOLIA_SEARCH_API_KEY || '',
37-
// Simplify Registration Experiment
38-
SIMPLIFY_REGISTRATION_EXPERIMENT_ID: process.env.SIMPLIFY_REGISTRATION_EXPERIMENT_ID || '',
3937
};
4038

4139
export default configuration;

src/logistration/Logistration.jsx

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import React, { useEffect, useState } from 'react';
2-
import { connect, useDispatch, useSelector } from 'react-redux';
2+
import { connect } from 'react-redux';
33

44
import { getConfig } from '@edx/frontend-platform';
55
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
66
import { getAuthService } from '@edx/frontend-platform/auth';
77
import { useIntl } from '@edx/frontend-platform/i18n';
88
import {
9-
Icon, IconButton,
9+
Icon,
1010
Tab,
1111
Tabs,
1212
} from '@openedx/paragon';
13-
import { ArrowBackIos, ChevronLeft } from '@openedx/paragon/icons';
13+
import { ChevronLeft } from '@openedx/paragon/icons';
1414
import PropTypes from 'prop-types';
1515
import { Navigate, useNavigate } from 'react-router-dom';
1616

@@ -27,8 +27,7 @@ import {
2727
import { LoginPage } from '../login';
2828
import { backupLoginForm } from '../login/data/actions';
2929
import { RegistrationPage } from '../register';
30-
import { backupRegistrationForm, setSimplifyRegExperimentData } from '../register/data/actions';
31-
import { FIRST_STEP, SECOND_STEP } from '../register/data/optimizelyExperiment/helper';
30+
import { backupRegistrationForm } from '../register/data/actions';
3231

3332
const Logistration = (props) => {
3433
const { selectedPage, tpaProviders } = props;
@@ -43,9 +42,6 @@ const Logistration = (props) => {
4342
const disablePublicAccountCreation = getConfig().ALLOW_PUBLIC_ACCOUNT_CREATION === false;
4443
const hideRegistrationLink = getConfig().SHOW_REGISTRATION_LINKS === false;
4544

46-
const dispatch = useDispatch();
47-
const { simplifyRegExpVariation, simplifiedRegisterPageStep } = useSelector(state => state.register);
48-
4945
useEffect(() => {
5046
const authService = getAuthService();
5147
if (authService) {
@@ -100,38 +96,6 @@ const Logistration = (props) => {
10096
return !!provider;
10197
};
10298

103-
/**
104-
* Temporary function created to resolve the complexity in tabs conditioning for simplify
105-
* registration experiment
106-
*/
107-
const getTabs = () => {
108-
if (simplifiedRegisterPageStep === SECOND_STEP) {
109-
return (
110-
<div>
111-
<IconButton
112-
key="primary"
113-
src={ArrowBackIos}
114-
iconAs={Icon}
115-
alt="Back"
116-
onClick={() => {
117-
dispatch(setSimplifyRegExperimentData(simplifyRegExpVariation, FIRST_STEP));
118-
}}
119-
variant="primary"
120-
size="inline"
121-
className="mr-1"
122-
/>
123-
{formatMessage(messages['tab.back.btn.text'])}
124-
</div>
125-
);
126-
}
127-
return (
128-
<Tabs defaultActiveKey={selectedPage} id="controlled-tab" onSelect={(tabKey) => handleOnSelect(tabKey, selectedPage)}>
129-
<Tab title={formatMessage(messages['logistration.register'])} eventKey={REGISTER_PAGE} />
130-
<Tab title={formatMessage(messages['logistration.sign.in'])} eventKey={LOGIN_PAGE} />
131-
</Tabs>
132-
);
133-
};
134-
13599
return (
136100
<BaseContainer>
137101
<div>
@@ -159,7 +123,12 @@ const Logistration = (props) => {
159123
<Tab title={tabTitle} eventKey={selectedPage === LOGIN_PAGE ? LOGIN_PAGE : REGISTER_PAGE} />
160124
</Tabs>
161125
)
162-
: (!isValidTpaHint() && !hideRegistrationLink && getTabs())}
126+
: (!isValidTpaHint() && !hideRegistrationLink && (
127+
<Tabs defaultActiveKey={selectedPage} id="controlled-tab" onSelect={(tabKey) => handleOnSelect(tabKey, selectedPage)}>
128+
<Tab title={formatMessage(messages['logistration.register'])} eventKey={REGISTER_PAGE} />
129+
<Tab title={formatMessage(messages['logistration.sign.in'])} eventKey={LOGIN_PAGE} />
130+
</Tabs>
131+
))}
163132
{ key && (
164133
<Navigate to={updatePathWithQueryParams(key)} replace />
165134
)}

src/logistration/Logistration.test.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ import {
1515
} from '../data/constants';
1616
import { backupLoginForm } from '../login/data/actions';
1717
import { backupRegistrationForm } from '../register/data/actions';
18-
import useSimplifyRegistrationExperimentVariation
19-
from '../register/data/optimizelyExperiment/useSimplifyRegistrationExperimentVariation';
2018

2119
jest.mock('@edx/frontend-platform/analytics', () => ({
2220
sendPageEvent: jest.fn(),
2321
sendTrackEvent: jest.fn(),
2422
}));
2523
jest.mock('@edx/frontend-platform/auth');
26-
jest.mock('../register/data/optimizelyExperiment/useSimplifyRegistrationExperimentVariation', () => jest.fn());
2724

2825
const mockStore = configureStore();
2926
const IntlLogistration = injectIntl(Logistration);
@@ -86,7 +83,6 @@ describe('Logistration', () => {
8683
username: 'test-user',
8784
})),
8885
}));
89-
useSimplifyRegistrationExperimentVariation.mockReturnValue('default-register-page');
9086

9187
configure({
9288
loggingService: { logError: jest.fn() },

src/register/RegistrationFields/UsernameField/UsernameField.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const UsernameField = (props) => {
9191
event.preventDefault();
9292
handleErrorChange('username', ''); // clear error
9393
handleChange({ target: { name: 'username', value: suggestion } }); // to set suggestion as value
94-
dispatch(clearUsernameSuggestions(true));
94+
dispatch(clearUsernameSuggestions());
9595
};
9696

9797
const handleUsernameSuggestionClose = () => {

0 commit comments

Comments
 (0)