Fix eslint rules

[MAILPOET-1348]
This commit is contained in:
Pavel Dohnal
2018-04-18 15:31:03 +01:00
parent d638273f47
commit c20ff20f5c
2 changed files with 10 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import TemplateBox from 'newsletters/templates/template_box.jsx';
import ImportTemplate from 'newsletters/templates/import_template.jsx'; import ImportTemplate from 'newsletters/templates/import_template.jsx';
import Hooks from 'wp-js-hooks'; import Hooks from 'wp-js-hooks';
import _ from 'underscore'; import _ from 'underscore';
import PropTypes from 'prop-types';
const getEditorUrl = id => `admin.php?page=mailpoet-newsletter-editor&id=${id}`; const getEditorUrl = id => `admin.php?page=mailpoet-newsletter-editor&id=${id}`;
@@ -217,7 +218,7 @@ class NewsletterTemplates extends React.Component {
} else { } else {
templates = templates.map((template, index) => ( templates = templates.map((template, index) => (
<TemplateBox <TemplateBox
key={index} key={template.id}
index={index} index={index}
newsletterId={this.props.params.id} newsletterId={this.props.params.id}
beforeDelete={() => this.setState({ loading: true })} beforeDelete={() => this.setState({ loading: true })}
@@ -257,4 +258,10 @@ class NewsletterTemplates extends React.Component {
} }
} }
NewsletterTemplates.propTypes = {
params: PropTypes.shape({
id: PropTypes.string.isRequired,
}).isRequired,
};
export default NewsletterTemplates; export default NewsletterTemplates;

View File

@@ -20,8 +20,8 @@ Tabs.propTypes = {
selected: PropTypes.string.isRequired, selected: PropTypes.string.isRequired,
select: PropTypes.func.isRequired, select: PropTypes.func.isRequired,
tabs: PropTypes.arrayOf(PropTypes.shape({ tabs: PropTypes.arrayOf(PropTypes.shape({
label: PropTypes.func.isRequired, label: PropTypes.string.isRequired,
name: PropTypes.func.isRequired, name: PropTypes.string.isRequired,
}).isRequired).isRequired, }).isRequired).isRequired,
}; };