Merge pull request #459 from edx/aehsan/760/remove_education_level_using_coppa
Remove el education level based on coppa flag
This commit is contained in:
2
.env
2
.env
@@ -25,4 +25,4 @@ DISABLE_ENTERPRISE_LOGIN=''
|
||||
REGISTER_CONVERSION_COOKIE_NAME=null
|
||||
ENABLE_PROGRESSIVE_PROFILING=''
|
||||
MARKETING_EMAILS_OPT_IN='false'
|
||||
COLLECT_YEAR_OF_BIRTH='true'
|
||||
ENABLE_COPPA_COMPLIANCE=''
|
||||
|
||||
@@ -30,4 +30,4 @@ WELCOME_PAGE_SUPPORT_LINK='http://localhost:1999/welcome'
|
||||
INFO_EMAIL='info@edx.org'
|
||||
DISABLE_ENTERPRISE_LOGIN=''
|
||||
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
||||
COLLECT_YEAR_OF_BIRTH='true'
|
||||
ENABLE_COPPA_COMPLIANCE=''
|
||||
|
||||
@@ -23,4 +23,4 @@ WELCOME_PAGE_SUPPORT_LINK='http://localhost:1999/welcome'
|
||||
DISABLE_ENTERPRISE_LOGIN=''
|
||||
REGISTER_CONVERSION_COOKIE_NAME='openedx-user-register-conversion'
|
||||
MARKETING_EMAILS_OPT_IN='false'
|
||||
COLLECT_YEAR_OF_BIRTH='true'
|
||||
ENABLE_COPPA_COMPLIANCE=''
|
||||
|
||||
@@ -40,7 +40,7 @@ initialize({
|
||||
REGISTER_CONVERSION_COOKIE_NAME: process.env.REGISTER_CONVERSION_COOKIE_NAME || null,
|
||||
ENABLE_PROGRESSIVE_PROFILING: process.env.ENABLE_PROGRESSIVE_PROFILING || false,
|
||||
MARKETING_EMAILS_OPT_IN: process.env.MARKETING_EMAILS_OPT_IN || 'false',
|
||||
COLLECT_YEAR_OF_BIRTH: process.env.COLLECT_YEAR_OF_BIRTH || 'true',
|
||||
ENABLE_COPPA_COMPLIANCE: process.env.ENABLE_COPPA_COMPLIANCE || '',
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { Form, Icon } from '@edx/paragon';
|
||||
import { ExpandMore } from '@edx/paragon/icons';
|
||||
|
||||
@@ -13,7 +14,12 @@ const OptionalFields = (props) => {
|
||||
intl, optionalFields, onChangeHandler, values,
|
||||
} = props;
|
||||
|
||||
if (getConfig().ENABLE_COPPA_COMPLIANCE && EDUCATION_LEVELS) {
|
||||
const index = EDUCATION_LEVELS.indexOf('el');
|
||||
EDUCATION_LEVELS.splice(index, 1);
|
||||
}
|
||||
const getOptions = () => ({
|
||||
|
||||
yearOfBirthOptions: YEAR_OF_BIRTH_OPTIONS.map(({ value, label }) => (
|
||||
<option className="data-hj-suppress" key={value} value={value}>{label}</option>
|
||||
)),
|
||||
|
||||
@@ -400,6 +400,7 @@ class RegistrationPage extends React.Component {
|
||||
} else {
|
||||
errors.name = '';
|
||||
}
|
||||
|
||||
if (!this.state.username.trim() && this.state.optimizelyExperimentName === 'suggestUsernameUsingFullname') {
|
||||
this.props.fetchRealtimeValidations(payload);
|
||||
// Fire optimizely events
|
||||
|
||||
@@ -68,6 +68,11 @@ const WelcomePage = (props) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (getConfig().ENABLE_COPPA_COMPLIANCE && EDUCATION_LEVELS) {
|
||||
const index = EDUCATION_LEVELS.indexOf('el');
|
||||
EDUCATION_LEVELS.splice(index, 1);
|
||||
}
|
||||
|
||||
const getOptions = (fieldName) => {
|
||||
const options = {
|
||||
yearOfBirth: YEAR_OF_BIRTH_OPTIONS.map(({ value, label }) => (
|
||||
@@ -170,7 +175,7 @@ const WelcomePage = (props) => {
|
||||
{getOptions('levelOfEducation')}
|
||||
</Form.Control>
|
||||
</Form.Group>
|
||||
{(getConfig().COLLECT_YEAR_OF_BIRTH === 'true')
|
||||
{(!getConfig().ENABLE_COPPA_COMPLIANCE)
|
||||
&& (
|
||||
<Form.Group controlId="yearOfBirth">
|
||||
<Form.Control
|
||||
|
||||
@@ -77,9 +77,6 @@ describe('WelcomePageTests', () => {
|
||||
level_of_education: 'other',
|
||||
gender: 'm',
|
||||
};
|
||||
mergeConfig({
|
||||
COLLECT_YEAR_OF_BIRTH: 'true',
|
||||
});
|
||||
store.dispatch = jest.fn(store.dispatch);
|
||||
const welcomePage = await getWelcomePage();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user