Fixes ESLint rule and updates variable names

This commit is contained in:
Vlad
2018-04-12 20:00:36 -04:00
parent cb648da677
commit 40526dd083
3 changed files with 9 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ const getAutomaticEmailsRoutes = () => {
name: automaticEmail.slug,
component: AutomaticEmailEventsList,
data: {
automaticEmail,
email: automaticEmail,
},
}));
};

View File

@@ -62,6 +62,8 @@ define(
<div>
<a className="button button-primary"
onClick={this.setupNewsletter.bind(null, automaticEmail.slug)}
role="button"
tabIndex={0}
>
{ MailPoet.I18n.t('setUp') }
</a>

View File

@@ -6,20 +6,20 @@ import _ from 'underscore';
class AutomaticEmailEventsList extends React.Component {
constructor(props) {
super(props);
this.automaticEmail = this.props.route.data.automaticEmail;
this.automaticEmailEvents = this.automaticEmail.events;
this.email = this.props.route.data.email;
this.emailEvents = this.email.events;
this.eventsConfigurator = this.eventsConfigurator.bind(this);
}
eventsConfigurator(eventSlug) {
this.props.router.push(`new/${this.automaticEmail.slug}/${eventSlug}/conditions`);
this.props.router.push(`new/${this.email.slug}/${eventSlug}/conditions`);
}
displayEvents() {
const events = _.map(this.automaticEmailEvents, (event, index) => {
const events = _.map(this.emailEvents, (event, index) => {
let action;
if (this.automaticEmail.premium) {
if (this.email.premium) {
action = (
<a href="?page=mailpoet-premium"
target="_blank"
@@ -75,7 +75,7 @@ class AutomaticEmailEventsList extends React.Component {
render() {
const heading = MailPoet.I18n.t('selectAutomaticEmailsEventsHeading')
.replace('%1s', this.automaticEmail.title);
.replace('%1s', this.email.title);
return (
<div>