Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Sheehan
14c1f5b944 feat: beginnings of the recruit me some money exploits 2021-08-11 10:48:16 -04:00
4 changed files with 57 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ initialize({
DISABLE_ENTERPRISE_LOGIN: process.env.DISABLE_ENTERPRISE_LOGIN || '',
INFO_EMAIL: process.env.INFO_EMAIL || '',
REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME || null,
ENABLE_PROGRESSIVE_PROFILING: process.env.ENABLE_PROGRESSIVE_PROFILING || false,
ENABLE_PROGRESSIVE_PROFILING: true,
});
},
},

View File

@@ -29,6 +29,8 @@ export const EDUCATION_LEVELS = [
'other',
];
export const REGISTRATION_REASONS = ['', 'job', 'learn', 'boss'];
export const GENDER_OPTIONS = ['', 'f', 'm', 'o'];
// Other constants

View File

@@ -30,7 +30,7 @@ import messages from './messages';
import { RedirectLogistration } from '../common-components';
import { DEFAULT_REDIRECT_URL, DEFAULT_STATE } from '../data/constants';
import { EDUCATION_LEVELS, GENDER_OPTIONS, YEAR_OF_BIRTH_OPTIONS } from '../register/data/constants';
import { EDUCATION_LEVELS, GENDER_OPTIONS, YEAR_OF_BIRTH_OPTIONS, REGISTRATION_REASONS } from '../register/data/constants';
import WelcomePageModal from './WelcomePageModal';
import BaseComponent from '../base-component';
@@ -39,7 +39,8 @@ const WelcomePage = (props) => {
const [ready, setReady] = useState(false);
const [registrationResult, setRegistrationResult] = useState({ redirectUrl: '' });
const [values, setValues] = useState({ levelOfEducation: '', yearOfBirth: '', gender: '' });
const [values, setValues] = useState({ levelOfEducation: '', yearOfBirth: '', gender: '', reason: '' });
const [openCareerDialog, setOpenCareerDialog] = useState(false);
const [openDialog, setOpenDialog] = useState(false);
const DASHBOARD_URL = getConfig().LMS_BASE_URL.concat(DEFAULT_REDIRECT_URL);
@@ -83,12 +84,19 @@ const WelcomePage = (props) => {
{intl.formatMessage(messages[`gender.options.${key || 'label'}`])}
</option>
)),
reason: REGISTRATION_REASONS.map(key => (
<option className="data-hj-suppress" key={key} value={key}>
{intl.formatMessage(messages[`reason.options.${key || 'label'}`])}
</option>
)),
};
return options[fieldName];
};
const handleSubmit = (e) => {
// console.log("HAHAHAHAHAHA");
console.log(values.reason);
e.preventDefault();
const payload = {};
const authenticatedUser = getAuthenticatedUser();
@@ -147,6 +155,8 @@ const WelcomePage = (props) => {
</Alert>
) : null}
<Form>
<Form.Group controlId="levelOfEducation">
<Form.Control
as="select"
@@ -159,6 +169,9 @@ const WelcomePage = (props) => {
{getOptions('levelOfEducation')}
</Form.Control>
</Form.Group>
<Form.Group controlId="yearOfBirth">
<Form.Control
as="select"
@@ -172,6 +185,9 @@ const WelcomePage = (props) => {
{getOptions('yearOfBirth')}
</Form.Control>
</Form.Group>
<Form.Group controlId="gender" className="mb-3">
<Form.Control
as="select"
@@ -184,6 +200,22 @@ const WelcomePage = (props) => {
{getOptions('gender')}
</Form.Control>
</Form.Group>
<Form.Group controlId="purposeOfAccountCreation" className="mb-3">
<Form.Control
as="select"
name="reason"
value={values.reason}
onChange={(e) => onChangeHandler(e)}
trailingElement={<Icon src={ExpandMore} />}
floatingLabel={intl.formatMessage(messages['reason.options.label'])}
>
{getOptions('reason')}
</Form.Control>
</Form.Group>
<span className="progressive-profiling-support">
<Hyperlink
isInline

View File

@@ -31,6 +31,26 @@ const messages = defineMessages({
defaultMessage: 'Other/Prefer not to say',
description: 'The label for catch-all gender option.',
},
'reason.options.label': {
id: 'reason.options.label',
defaultMessage: 'Purpose (optional)',
description: 'Placeholder for the reasons options dropdown',
},
'reason.options.job': {
id: 'reason.options.job',
defaultMessage: 'Finding a job',
description: 'edX grants unlimited opportunities to expand and grow one\' career',
},
'reason.options.learn': {
id: 'reason.options.learn',
defaultMessage: 'Learning tons of shit',
description: 'edX ever increasing catalog of a wide array of courses allows one to explore new ares of knowledge and challenge their perception of the world.',
},
'reason.options.boss': {
id: 'reason.options.boss',
defaultMessage: 'My boss made me',
description: 'edX allows businesses and institutions to empower their employees on a mass scale, offering opportunities to learn to countless learners.',
},
'education.levels.label': {
id: 'education.levels.label',
defaultMessage: 'Highest level of education completed (optional)',