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, name: automaticEmail.slug,
component: AutomaticEmailEventsList, component: AutomaticEmailEventsList,
data: { data: {
automaticEmail, email: automaticEmail,
}, },
})); }));
}; };

View File

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

View File

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