Fix linting

This commit is contained in:
seotts 2020-04-02 10:43:45 -04:00
parent ccb5fa444c
commit 8f936229ce
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 React = require('react');
const connect = require('react-redux').connect;
const FormattedHTMLMessage = require('react-intl').FormattedHTMLMessage;
const FormattedMessage = require('react-intl').FormattedMessage;
const injectIntl = require('react-intl').injectIntl;
const intlShape = require('react-intl').intlShape;
@ -45,7 +44,8 @@ class ReportModal extends React.Component {
};
}
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({
categoryValue: formData.category,
@ -53,9 +53,11 @@ class ReportModal extends React.Component {
});
}
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({
subcategoryValue: subcategory.value,
@ -87,15 +89,10 @@ class ReportModal extends React.Component {
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.
// This prevents multiple report submission within the same session because submission is stored in redux.
const step = isConfirmed ? STEPS.confirmation : this.state.step;
@ -231,7 +228,7 @@ class ReportModal extends React.Component {
submitEnabled
nextLabel={{id: 'general.close'}}
onNext={onRequestClose}
>
>
<div className="instructions">
<div className="instructions-header">
<FormattedMessage {...finalCategory.label} />

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.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.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.tooShortError": "That's too short. Please describe in detail what's inappropriate or disrespectful about the project.",
"report.send": "Send",