Merge pull request #257 from edx/aj/MICROBA-445

Adding a link to the legal copy for demographics
This commit is contained in:
Albert (AJ) St. Aubin
2020-07-09 13:06:22 -04:00
committed by GitHub
5 changed files with 84 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
LMS_BASE_URL='http://localhost:18000'
LOGIN_URL='http://localhost:18000/login'
LOGOUT_URL='http://localhost:18000/logout'
MARKETING_SITE_BASE_URL='http://localhost:18000'
MARKETING_SITE_BASE_URL='http://localhost:5335'
DEMOGRAPHICS_BASE_URL='http://localhost:18360'
NODE_ENV='development'
ORDER_HISTORY_URL='localhost:1996/orders'

View File

@@ -7,7 +7,7 @@ LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
LMS_BASE_URL='http://localhost:18000'
LOGIN_URL='http://localhost:18000/login'
LOGOUT_URL='http://localhost:18000/logout'
MARKETING_SITE_BASE_URL='http://localhost:18000'
MARKETING_SITE_BASE_URL='http://localhost:5335'
DEMOGRAPHICS_BASE_URL='http://localhost:18360'
NODE_ENV=null
ORDER_HISTORY_URL='localhost:1996/orders'

View File

@@ -10,6 +10,7 @@ import {
OTHER,
SELF_DESCRIBE,
} from '../data/constants';
import { getConfig } from '@edx/frontend-platform';
import {
FormattedMessage,
injectIntl,
@@ -33,7 +34,7 @@ import messages from './DemographicsSection.messages';
class DemographicsSection extends React.Component {
constructor(props, context) {
super(props, context);
this.alertRef = React.createRef();
}
@@ -128,7 +129,7 @@ class DemographicsSection extends React.Component {
renderDemographicsServiceIssueWarning() {
if (this.checkFormForDemographicsErrors()) {
return (
<div
<div
tabIndex="-1"
ref={this.alertRef}>
<Alert className="alert alert-danger" role="alert">
@@ -169,7 +170,12 @@ class DemographicsSection extends React.Component {
<h2 className="section-heading">
{this.props.intl.formatMessage(messages['account.settings.section.demographics.information'])}
</h2>
{this.renderDemographicsServiceIssueWarning()}
<div className="mb-2">
<a href={getConfig().MARKETING_SITE_BASE_URL + '/demographics'} target="_blank">
{this.props.intl.formatMessage(messages['account.settings.section.demographics.why'])}
</a>
{this.renderDemographicsServiceIssueWarning()}
</div>
<EditableField
name="demographics_gender"

View File

@@ -451,6 +451,11 @@ const messages = defineMessages({
defaultMessage: 'Prefer not to respond',
description: 'The label for the declined option.',
},
'account.settings.section.demographics.why': {
id: 'account.settings.section.demographics.why',
defaultMessage: 'Why does edX collect this information?',
description: 'Link text for a link to external legal text',
},
});
export default messages;

View File

@@ -10,6 +10,16 @@ exports[`DemographicsSection should render 1`] = `
>
Optional Information
</h2>
<div
className="mb-2"
>
<a
href="http://localhost:5335/demographics"
target="_blank"
>
Why does edX collect this information?
</a>
</div>
<div
className="pgn-transition-replace-group position-relative"
style={
@@ -590,16 +600,26 @@ exports[`DemographicsSection should render an Alert if an error occurs 1`] = `
Optional Information
</h2>
<div
tabIndex="-1"
className="mb-2"
>
<div
className="alert d-flex align-items-start alert alert-danger"
<a
href="http://localhost:5335/demographics"
target="_blank"
>
<div />
<div>
<span>
An error occurred attempting to retrieve or save your account information. Please try again later.
</span>
Why does edX collect this information?
</a>
<div
tabIndex="-1"
>
<div
className="alert d-flex align-items-start alert alert-danger"
>
<div />
<div>
<span>
An error occurred attempting to retrieve or save your account information. Please try again later.
</span>
</div>
</div>
</div>
</div>
@@ -1182,6 +1202,16 @@ exports[`DemographicsSection should render ethnicity correctly when multiple opt
>
Optional Information
</h2>
<div
className="mb-2"
>
<a
href="http://localhost:5335/demographics"
target="_blank"
>
Why does edX collect this information?
</a>
</div>
<div
className="pgn-transition-replace-group position-relative"
style={
@@ -1817,6 +1847,16 @@ exports[`DemographicsSection should render ethnicity text correctly 1`] = `
>
Optional Information
</h2>
<div
className="mb-2"
>
<a
href="http://localhost:5335/demographics"
target="_blank"
>
Why does edX collect this information?
</a>
</div>
<div
className="pgn-transition-replace-group position-relative"
style={
@@ -2452,6 +2492,16 @@ exports[`DemographicsSection should set user input correctly when user provides
>
Optional Information
</h2>
<div
className="mb-2"
>
<a
href="http://localhost:5335/demographics"
target="_blank"
>
Why does edX collect this information?
</a>
</div>
<div
className="pgn-transition-replace-group position-relative"
style={
@@ -3087,6 +3137,16 @@ exports[`DemographicsSection should set user input correctly when user provides
>
Optional Information
</h2>
<div
className="mb-2"
>
<a
href="http://localhost:5335/demographics"
target="_blank"
>
Why does edX collect this information?
</a>
</div>
<div
className="pgn-transition-replace-group position-relative"
style={