Fix linting

This commit is contained in:
seotts 2020-04-02 10:43:45 -04:00
parent ce4c0f09ec
commit 8933705c76
2 changed files with 10 additions and 13 deletions

View file

@ -2,7 +2,6 @@ const bindAll = require('lodash.bindall');
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
const React = require('react'); const React = require('react');
const connect = require('react-redux').connect; const connect = require('react-redux').connect;
const FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage;
const FormattedMessage = require('react-intl').FormattedMessage; const FormattedMessage = require('react-intl').FormattedMessage;
const injectIntl = require('react-intl').injectIntl; const injectIntl = require('react-intl').injectIntl;
const intlShape = require('react-intl').intlShape; const intlShape = require('react-intl').intlShape;
@ -45,7 +44,8 @@ class ReportModal extends React.Component {
}; };
} }
handleSetCategory (formData) { handleSetCategory (formData) {
const category = this.props.reportOptions.find(o => o.value === formData.category) || this.props.reportOptions[0]; const category = this.props.reportOptions.find(o => o.value === formData.category) ||
this.props.reportOptions[0];
return this.setState({ return this.setState({
categoryValue: formData.category, categoryValue: formData.category,
@ -53,9 +53,11 @@ class ReportModal extends React.Component {
}); });
} }
handleSetSubcategory (formData) { handleSetSubcategory (formData) {
const category = this.props.reportOptions.find(o => o.value === this.state.categoryValue) || this.props.reportOptions[0]; const category = this.props.reportOptions.find(o => o.value === this.state.categoryValue) ||
this.props.reportOptions[0];
const subcategory = category.subcategories.find(o => o.value === formData.subcategory) || category.subcategories[0]; const subcategory = category.subcategories.find(o => o.value === formData.subcategory) ||
category.subcategories[0];
return this.setState({ return this.setState({
subcategoryValue: subcategory.value, subcategoryValue: subcategory.value,
@ -87,15 +89,10 @@ class ReportModal extends React.Component {
if (category.subcategories) { if (category.subcategories) {
finalCategory = category.subcategories.find(o => o.value === this.state.subcategoryValue) || category.subcategories[0]; finalCategory = category.subcategories.find(o => o.value === this.state.subcategoryValue) ||
category.subcategories[0];
} }
const promptList = finalCategory.list && finalCategory.list.map((listItem, index) =>
<li key={index}>
<FormattedMessage {...listItem} />
</li>
);
// Confirmation step is shown if a report has been submitted, even if state is reset by closing the modal. // Confirmation step is shown if a report has been submitted, even if state is reset by closing the modal.
// This prevents multiple report submission within the same session because submission is stored in redux. // This prevents multiple report submission within the same session because submission is stored in redux.
const step = isConfirmed ? STEPS.confirmation : this.state.step; const step = isConfirmed ? STEPS.confirmation : this.state.step;

View file

@ -291,7 +291,7 @@
"report.promptFaceReveal": "Scratch allows people to use pictures of their face in creative projects like games, stories, or animations. However, projects that are just a picture of their face, or which focus entirely on their physical appearance, aren't allowed on Scratch. If this is a 'face reveal', or the project focuses on the person's appearance, please click report.", "report.promptFaceReveal": "Scratch allows people to use pictures of their face in creative projects like games, stories, or animations. However, projects that are just a picture of their face, or which focus entirely on their physical appearance, aren't allowed on Scratch. If this is a 'face reveal', or the project focuses on the person's appearance, please click report.",
"report.promptNoRemixingAllowed": "Please let us know where the project says it is not okay to remix — such as in the Notes & Credits, project title, etc. ", "report.promptNoRemixingAllowed": "Please let us know where the project says it is not okay to remix — such as in the Notes & Credits, project title, etc. ",
"report.promptCreatorsSafety": "It's important that everyone on Scratch remains safe online and in real life. Please let us know why you are worried about the safety of this user.", "report.promptCreatorsSafety": "It's important that everyone on Scratch remains safe online and in real life. Please let us know why you are worried about the safety of this user.",
"report.promptSomethingElse": "We encourage you to double check if your report fits any of the other available categories. If you strongly feel it does not, please explain why this project breaks the {communityGuidelinesLink}.", "report.promptSomethingElse": "We encourage you to double check if your report fits any of the other available categories. If you strongly feel it does not, please explain why this project breaks the {CommunityGuidelinesLink}.",
"report.tooLongError": "That's too long! Please find a way to shorten your text.", "report.tooLongError": "That's too long! Please find a way to shorten your text.",
"report.tooShortError": "That's too short. Please describe in detail what's inappropriate or disrespectful about the project.", "report.tooShortError": "That's too short. Please describe in detail what's inappropriate or disrespectful about the project.",
"report.send": "Send", "report.send": "Send",