Merge pull request #3977 from LLK/release/2020-05-14

[Master] Release 2020-05-14
This commit is contained in:
Eric Rosenbaum 2020-05-14 14:38:59 -04:00 committed by GitHub
commit 5d062c9955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 176 deletions

106
package-lock.json generated
View file

@ -3643,8 +3643,7 @@
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"buffer-xor": {
"version": "1.0.3",
@ -4266,7 +4265,6 @@
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
@ -4277,14 +4275,12 @@
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
"dev": true
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@ -4299,7 +4295,6 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.0"
}
@ -5669,12 +5664,12 @@
}
},
"eslint-plugin-cypress": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.2.1.tgz",
"integrity": "sha512-WkH81MEALKhnpeRo/wWHBHR883LdkS8aFzbGAGFxiwRwik2IKBZxb/JrxbiA6+SZskXGcmdEi6rwL7xmiqo9MA==",
"version": "2.10.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.10.3.tgz",
"integrity": "sha512-CvFeoCquShfO8gHNIKA1VpUTz78WtknMebLemBd1lRbcmJNjwpqCqpQYUG/XVja8GjdX/e2TJXYa+EUBxehtUg==",
"dev": true,
"requires": {
"globals": "^11.0.1"
"globals": "^11.12.0"
},
"dependencies": {
"globals": {
@ -12187,68 +12182,6 @@
"yakaa": "^1.0.1"
},
"dependencies": {
"concat-stream": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz",
"integrity": "sha1-87gKz54fSOOHXAaItBtsMWAu6hw=",
"requires": {
"inherits": "~2.0.1",
"readable-stream": "~2.0.0",
"typedarray": "~0.0.5"
},
"dependencies": {
"inherits": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
"integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE="
},
"readable-stream": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz",
"integrity": "sha1-okJvjc1FUcd6M/lu3yiGojyClmk=",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
},
"dependencies": {
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
},
"process-nextick-args": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz",
"integrity": "sha1-D5awAc6pCxJZLOVm7bl+wR5pvQU="
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
}
}
},
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
}
}
},
"https-proxy-agent": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-0.3.6.tgz",
@ -15383,9 +15316,9 @@
}
},
"redux-mock-store": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/redux-mock-store/-/redux-mock-store-1.5.3.tgz",
"integrity": "sha512-ryhkkb/4D4CUGpAV2ln1GOY/uh51aczjcRz9k2L2bPx/Xja3c5pSGJJPyR25GNVRXtKIExScdAgFdiXp68GmJA==",
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/redux-mock-store/-/redux-mock-store-1.5.4.tgz",
"integrity": "sha512-xmcA0O/tjCLXhh9Fuiq6pMrJCwFRaouA8436zcikdIpYWWCjU76CRk+i2bHx8EeiSiMGnB85/lZdU3wIJVXHTA==",
"dev": true,
"requires": {
"lodash.isplainobject": "^4.0.6"
@ -16257,15 +16190,15 @@
}
},
"scratch-gui": {
"version": "0.1.0-prerelease.20200506225657",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20200506225657.tgz",
"integrity": "sha512-MhDIsvdMw8See61hf355CATKMO4v1y8vt3DNBjRj0of0pXF8PyagaF2+m2vMwe1/PvJkNhXmRkWbb+RwArKuyQ==",
"version": "0.1.0-prerelease.20200513040928",
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20200513040928.tgz",
"integrity": "sha512-IUGYqOntEPG8m2cj07mfifSzXVkLbPHadFbEeJk4AjW/6jqO5UufB3rTHU0j9fw3xr/DUqs5o9Ugpe2MThVo+A==",
"dev": true
},
"scratch-l10n": {
"version": "3.8.20200505213509",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.8.20200505213509.tgz",
"integrity": "sha512-Vh4UQFlNuTcDgSySsR/wYzQ842IEEE8nrpqybKxd+LDVUw0fDOGFQ2aKyE8GyUWBnyDsnWQTmozU9yTmYfwKBw==",
"version": "3.9.20200512220101",
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.9.20200512220101.tgz",
"integrity": "sha512-CAUCdtecNvTIUfcUqp2OEg+pEETVvttHwObnmmV1WPXYjpubI9kHU5wHfmHSeiVj2LduoILrdHOafU1l/KAw0g==",
"dev": true,
"requires": {
"@babel/cli": "^7.1.2",
@ -18265,8 +18198,7 @@
"typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
"dev": true
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typedarray-to-buffer": {
"version": "3.1.5",

View file

@ -128,7 +128,7 @@
"redux-mock-store": "^1.2.3",
"redux-thunk": "2.0.1",
"sass-loader": "6.0.6",
"scratch-gui": "0.1.0-prerelease.20200506225657",
"scratch-gui": "0.1.0-prerelease.20200513040928",
"scratch-l10n": "latest",
"selenium-webdriver": "3.6.0",
"slick-carousel": "1.6.0",

View file

@ -453,7 +453,7 @@ class DemographicsStep extends React.Component {
handleChooseGender (name, gender) {
this.setState({otherDisabled: gender !== 'other'});
}
// look up country name using user's country code selection
// look up country name using user's country code selection ('us' -> 'United States')
getCountryName (values) {
if (values.countryCode) {
const countryInfo = countryData.lookupCountryInfo(values.countryCode);
@ -463,6 +463,12 @@ class DemographicsStep extends React.Component {
}
return null;
}
// look up country code from country label ('United States' -> 'us')
// if `countryName` is not found, including if it's null or undefined, then this function will return undefined.
getCountryCode (countryName) {
const country = countryData.countryInfo.find(countryItem => countryItem.name === countryName);
return country && country.code;
}
handleValidSubmit (formData) {
const countryName = this.getCountryName(formData);
if (countryName && formData.user) {
@ -573,7 +579,7 @@ class DemographicsStep extends React.Component {
validations={{
countryVal: values => this.countryValidator(values)
}}
value={countryOptions[0].value}
value={this.getCountryCode(this.props.countryName) || countryOptions[0].value}
/>
<Checkbox
className="demographics-checkbox-is-robot"
@ -598,6 +604,7 @@ class DemographicsStep extends React.Component {
DemographicsStep.propTypes = {
activeStep: PropTypes.number,
birthOffset: PropTypes.number,
countryName: PropTypes.string, // like 'United States', not 'US' or 'United States of America'
description: PropTypes.string,
intl: intlShape,
onNextStep: PropTypes.func,

View file

@ -8,7 +8,7 @@ const render = require('../../lib/render.jsx');
const HelpForm = require('../../components/helpform/helpform.jsx');
const HelpWidget = require('../../components/helpwidget/helpwidget.jsx');
const {CONTACT_US_POPUP} = require('../../lib/feature-flags.js');
const bowser = require('bowser');
const InformationPage = require('../../components/informationpage/informationpage.jsx');
require('./contact-us.scss');
@ -18,7 +18,8 @@ class ContactUs extends React.Component {
super(props);
this.state = {
subject: '',
body: ''
body: '',
showForm: false
};
const query = window.location.search;
let scratchId = '';
@ -34,50 +35,16 @@ class ContactUs extends React.Component {
} else if (query.indexOf('confirmation=') !== -1) {
this.state.subject = 'Problem with email confirmation';
}
// older iPads (iOS 10 or lower) cannot show help widget, show the form instead
if (bowser.osname === 'iOS' && parseInt(bowser.osversion, 10) < 11) {
this.state.showForm = true;
}
}
render () {
return (
<InformationPage
title={CONTACT_US_POPUP ?
this.props.intl.formatMessage({id: 'contactUs.qTitle'}) :
this.props.intl.formatMessage({id: 'contactUs.title'})}
title={this.props.intl.formatMessage({id: 'contactUs.qTitle'})}
>
{!CONTACT_US_POPUP && (
<div className="inner info-inner">
<section id="contact-us">
<span className="nav-spacer" />
<p><FormattedMessage
id="contactUs.intro"
values={{faqLink: (
<a href="/info/faq"><FormattedMessage id="contactUs.faqLinkText" /></a>
)}}
/></p>
<p><FormattedMessage id="contactUs.forumsInfo" /></p>
<ul>
<li><FormattedMessage
id="contactUs.questionsForum"
values={{questionsLink: (
<a href="/discuss/4/"><FormattedMessage id="contactUs.questionsLinkText" /></a>
)}}
/></li>
<li><FormattedMessage
id="contactUs.scriptsForum"
values={{scriptsLink: (
<a href="/discuss/7/"><FormattedMessage id="contactUs.scriptsLinkText" /></a>
)}}
/></li>
<li><FormattedMessage
id="contactUs.bugsForum"
values={{bugsLink: (
<a href="/discuss/3/"><FormattedMessage id="contactUs.bugsLinkText" /></a>
)}}
/></li>
</ul>
<p><FormattedMessage id="contactUs.formIntro" /></p>
</section>
</div>
)}
{CONTACT_US_POPUP && (
<div className="contact-us inner info-inner">
<section
className="helpwidget"
@ -121,6 +88,9 @@ class ContactUs extends React.Component {
<h3>
<FormattedMessage id="contactUs.needSupport" />
</h3>
{this.state.showForm ? (
<p><FormattedMessage id="contactUs.formIntro" /></p>
) : (
<p>
<FormattedMessage
id="contactUs.supportInfo"
@ -132,21 +102,23 @@ class ContactUs extends React.Component {
)}}
/>
</p>
)}
</section>
{!this.state.showForm && (
<HelpWidget
button
body={this.state.body}
subject={this.state.subject}
/>
</div>
)}
</div>
<nav>
<ol>
<li className="nav-header"><FormattedMessage id="contactUs.findHelp" /></li>
<li><a href="/info/faq"><FormattedMessage id="contactUs.faqLinkText" /></a></li>
</ol>
</nav>
{!CONTACT_US_POPUP && (
{this.state.showForm && (
<HelpForm
body={this.state.body}
subject={this.state.subject}

View file

@ -132,6 +132,8 @@ class StudentRegistration extends React.Component {
onNextStep={this.handleAdvanceStep}
/>
<Steps.DemographicsStep
countryName={this.state.classroom && this.state.classroom.educator &&
this.state.classroom.educator.profile && this.state.classroom.educator.profile.country}
description={this.props.intl.formatMessage({
id: 'registration.studentPersonalStepDescription'
})}