Merge pull request #540 from edx/waheed/VAN-762

feat: remove `primary/elementary` option from education
This commit is contained in:
Waheed Ahmed
2021-10-28 14:13:08 +05:00
committed by GitHub
6 changed files with 11 additions and 6 deletions

2
.env
View File

@@ -25,4 +25,4 @@ SITE_NAME=''
STUDIO_BASE_URL=''
SUPPORT_URL=''
USER_INFO_COOKIE_NAME=''
COLLECT_YEAR_OF_BIRTH='true'
ENABLE_COPPA_COMPLIANCE=''

View File

@@ -26,4 +26,4 @@ SITE_NAME=localhost
STUDIO_BASE_URL=''
SUPPORT_URL='http://localhost:18000/support'
USER_INFO_COOKIE_NAME='edx-user-info'
COLLECT_YEAR_OF_BIRTH='true'
ENABLE_COPPA_COMPLIANCE=''

View File

@@ -25,4 +25,4 @@ SITE_NAME=localhost
STUDIO_BASE_URL=''
SUPPORT_URL='http://localhost:18000/support'
USER_INFO_COOKIE_NAME='edx-user-info'
COLLECT_YEAR_OF_BIRTH='true'
ENABLE_COPPA_COMPLIANCE=''

View File

@@ -583,7 +583,7 @@ class AccountSettingsPage extends React.Component {
/>
{this.renderSecondaryEmailField(editableFieldProps)}
<ResetPassword email={this.props.formValues.email} />
{(getConfig().COLLECT_YEAR_OF_BIRTH === 'true')
{(!getConfig().ENABLE_COPPA_COMPLIANCE)
&& (
<EditableField
name="year_of_birth"

View File

@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { getConfig } from '@edx/frontend-platform';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import {
Button, Input, StatefulButton, ValidationFormGroup,
@@ -43,6 +44,10 @@ function EditableField(props) {
...others
} = props;
const id = `field-${name}`;
let inputOptions = options;
if (getConfig().ENABLE_COPPA_COMPLIANCE && name === 'level_of_education' && options) {
inputOptions = options.filter(option => option.value !== 'el');
}
const handleSubmit = (e) => {
e.preventDefault();
@@ -120,7 +125,7 @@ function EditableField(props) {
type={type}
value={value}
onChange={handleChange}
options={options}
options={inputOptions}
{...others}
/>
<>{others.children}</>

View File

@@ -63,7 +63,7 @@ initialize({
COACHING_ENABLED: (process.env.COACHING_ENABLED || false),
ENABLE_DEMOGRAPHICS_COLLECTION: (process.env.ENABLE_DEMOGRAPHICS_COLLECTION || false),
DEMOGRAPHICS_BASE_URL: process.env.DEMOGRAPHICS_BASE_URL,
COLLECT_YEAR_OF_BIRTH: (process.env.COLLECT_YEAR_OF_BIRTH || true),
ENABLE_COPPA_COMPLIANCE: (process.env.ENABLE_COPPA_COMPLIANCE || false),
}, 'App loadConfig override handler');
},
},