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:
Adeel Ehsan
2021-10-28 15:07:17 +05:00
committed by GitHub
8 changed files with 17 additions and 8 deletions

2
.env
View File

@@ -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=''

View File

@@ -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=''

View File

@@ -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=''

View File

@@ -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 || '',
});
},
},

View File

@@ -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>
)),

View File

@@ -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

View File

@@ -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

View File

@@ -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();