feat: [VAN-751] Put user's year of birth behind the feature flag

This commit is contained in:
attiyaIshaque
2021-10-14 16:45:19 +05:00
parent eff28d8b47
commit 65a6bc5002
5 changed files with 16 additions and 9 deletions

1
.env
View File

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

View File

@@ -26,3 +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'

View File

@@ -25,3 +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'

View File

@@ -583,15 +583,18 @@ class AccountSettingsPage extends React.Component {
/>
{this.renderSecondaryEmailField(editableFieldProps)}
<ResetPassword email={this.props.formValues.email} />
<EditableField
name="year_of_birth"
type="select"
label={this.props.intl.formatMessage(messages['account.settings.field.dob'])}
emptyLabel={this.props.intl.formatMessage(messages['account.settings.field.dob.empty'])}
value={this.props.formValues.year_of_birth}
options={yearOfBirthOptions}
{...editableFieldProps}
/>
{(getConfig().COLLECT_YEAR_OF_BIRTH === 'true')
&& (
<EditableField
name="year_of_birth"
type="select"
label={this.props.intl.formatMessage(messages['account.settings.field.dob'])}
emptyLabel={this.props.intl.formatMessage(messages['account.settings.field.dob.empty'])}
value={this.props.formValues.year_of_birth}
options={yearOfBirthOptions}
{...editableFieldProps}
/>
)}
<EditableField
name="country"
type="select"

View File

@@ -63,6 +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),
}, 'App loadConfig override handler');
},
},