Fix ES6 react/jsx-curly-spacing eslint rule [MAILPOET-1082]

This commit is contained in:
stoletniy
2017-09-18 18:18:45 +03:00
parent 9e3010ab52
commit 0cdae52c66
39 changed files with 412 additions and 413 deletions

View File

@ -30,7 +30,6 @@
"react/self-closing-comp": 0,
"react/jsx-closing-bracket-location": 0,
"react/no-string-refs": 0,
"react/jsx-curly-spacing": 0,
"react/no-did-mount-set-state": 0,
"react/prefer-stateless-function": 0,
"jsx-a11y/label-has-for": 0,

View File

@ -20,15 +20,15 @@ define([
const options = Object.keys(this.props.field.values).map(
(value, index) => {
return (
<p key={ 'checkbox-' + index }>
<p key={'checkbox-' + index}>
<label>
<input
ref="checkbox"
type="checkbox"
value="1"
checked={ isChecked }
onChange={ this.onValueChange }
name={ this.props.field.name }
checked={isChecked}
onChange={this.onValueChange}
name={this.props.field.name}
/>
{ this.props.field.values[value] }
</label>

View File

@ -12,7 +12,7 @@ define([
if (this.props.placeholder !== undefined) {
years.push((
<option value="" key={ 0 }>{ this.props.placeholder }</option>
<option value="" key={0}>{ this.props.placeholder }</option>
));
}
@ -20,16 +20,16 @@ define([
for (let i = currentYear; i >= currentYear - yearsRange; i -= 1) {
years.push((
<option
key={ i }
value={ i }
key={i}
value={i}
>{ i }</option>
));
}
return (
<select
name={ `${this.props.name}[year]` }
value={ this.props.year }
onChange={ this.props.onValueChange }
name={`${this.props.name}[year]`}
value={this.props.year}
onChange={this.props.onValueChange}
>
{ years }
</select>
@ -43,23 +43,23 @@ define([
if (this.props.placeholder !== undefined) {
months.push((
<option value="" key={ 0 }>{ this.props.placeholder }</option>
<option value="" key={0}>{ this.props.placeholder }</option>
));
}
for (let i = 1; i <= 12; i += 1) {
months.push((
<option
key={ i }
value={ i }
key={i}
value={i}
>{ this.props.monthNames[i - 1] }</option>
));
}
return (
<select
name={ `${this.props.name}[month]` }
value={ this.props.month }
onChange={ this.props.onValueChange }
name={`${this.props.name}[month]`}
value={this.props.month}
onChange={this.props.onValueChange}
>
{ months }
</select>
@ -73,24 +73,24 @@ define([
if (this.props.placeholder !== undefined) {
days.push((
<option value="" key={ 0 }>{ this.props.placeholder }</option>
<option value="" key={0}>{ this.props.placeholder }</option>
));
}
for (let i = 1; i <= 31; i += 1) {
days.push((
<option
key={ i }
value={ i }
key={i}
value={i}
>{ i }</option>
));
}
return (
<select
name={ `${this.props.name}[day]` }
value={ this.props.day }
onChange={ this.props.onValueChange }
name={`${this.props.name}[day]`}
value={this.props.day}
onChange={this.props.onValueChange}
>
{ days }
</select>
@ -205,33 +205,33 @@ define([
switch(type) {
case 'YYYY':
return (<FormFieldDateYear
onValueChange={ this.onValueChange.bind(this) }
ref={ 'year' }
key={ 'year' }
name={ this.props.field.name }
year={ this.state.year }
placeholder={ this.props.field.year_placeholder }
onValueChange={this.onValueChange.bind(this)}
ref={'year'}
key={'year'}
name={this.props.field.name}
year={this.state.year}
placeholder={this.props.field.year_placeholder}
/>);
case 'MM':
return (<FormFieldDateMonth
onValueChange={ this.onValueChange.bind(this) }
ref={ 'month' }
key={ 'month' }
name={ this.props.field.name }
month={ this.state.month }
monthNames={ monthNames }
placeholder={ this.props.field.month_placeholder }
onValueChange={this.onValueChange.bind(this)}
ref={'month'}
key={'month'}
name={this.props.field.name}
month={this.state.month}
monthNames={monthNames}
placeholder={this.props.field.month_placeholder}
/>);
case 'DD':
return (<FormFieldDateDay
onValueChange={ this.onValueChange.bind(this) }
ref={ 'day' }
key={ 'day' }
name={ this.props.field.name }
day={ this.state.day }
placeholder={ this.props.field.day_placeholder }
onValueChange={this.onValueChange.bind(this)}
ref={'day'}
key={'day'}
name={this.props.field.name}
day={this.state.day}
placeholder={this.props.field.day_placeholder}
/>);
}
});

View File

@ -72,14 +72,14 @@ define([
if(inline === true) {
return (
<span key={ 'field-' + (data.index || 0) }>
<span key={'field-' + (data.index || 0)}>
{ field }
{ description }
</span>
);
} else {
return (
<div key={ 'field-' + (data.index || 0) }>
<div key={'field-' + (data.index || 0)}>
{ field }
{ description }
</div>
@ -113,7 +113,7 @@ define([
<tr>
<th scope="row">
<label
htmlFor={ 'field_'+this.props.field.name }
htmlFor={'field_'+this.props.field.name}
>
{ this.props.field.label }
{ tip }

View File

@ -14,14 +14,14 @@ define([
const options = Object.keys(this.props.field.values).map(
(value, index) => {
return (
<p key={ 'radio-' + index }>
<p key={'radio-' + index}>
<label>
<input
type="radio"
checked={ selected_value === value }
value={ value }
onChange={ this.props.onValueChange }
name={ this.props.field.name } />
checked={selected_value === value}
value={value}
onChange={this.props.onValueChange}
name={this.props.field.name} />
{ this.props.field.values[value] }
</label>
</p>

View File

@ -50,8 +50,8 @@ const FormFieldSelect = React.createClass({
return (
<option
key={ 'option-' + index }
value={ value }>
key={'option-' + index}
value={value}>
{ this.props.field.values[value] }
</option>
);
@ -60,10 +60,10 @@ const FormFieldSelect = React.createClass({
return (
<select
name={ this.props.field.name }
id={ 'field_'+this.props.field.name }
value={ this.props.item[this.props.field.name] }
onChange={ this.props.onValueChange }
name={this.props.field.name}
id={'field_'+this.props.field.name}
value={this.props.item[this.props.field.name]}
onChange={this.props.onValueChange}
{...this.props.field.validation}
>
{placeholder}

View File

@ -168,9 +168,9 @@ define([
return (
<option
key={ 'option-'+index }
value={ value }
title={ searchLabel }
key={'option-'+index}
value={value}
title={searchLabel}
>
{ label }
</option>
@ -179,12 +179,12 @@ define([
return (
<select
id={ this.props.field.id || this.props.field.name }
id={this.props.field.id || this.props.field.name}
ref="select"
disabled={this.props.field.disabled}
data-placeholder={ this.props.field.placeholder }
multiple={ this.props.field.multiple }
defaultValue={ this.getSelectedValues() }
data-placeholder={this.props.field.placeholder}
multiple={this.props.field.multiple}
defaultValue={this.getSelectedValues()}
{...this.props.field.validation}
>{ options }</select>
);

View File

@ -15,17 +15,17 @@ const FormFieldText = React.createClass({
? this.props.field.disabled(this.props.item)
: false
}
className={ (this.props.field.size) ? '' : 'regular-text' }
className={(this.props.field.size) ? '' : 'regular-text'}
size={
(this.props.field.size !== 'auto' && this.props.field.size > 0)
? this.props.field.size
: false
}
name={ this.props.field.name }
id={ 'field_'+this.props.field.name }
value={ value }
placeholder={ this.props.field.placeholder }
onChange={ this.props.onValueChange }
name={this.props.field.name}
id={'field_'+this.props.field.name}
value={value}
placeholder={this.props.field.placeholder}
onChange={this.props.onValueChange}
{...this.props.field.validation}
/>
);

View File

@ -10,12 +10,12 @@ define([
<textarea
type="text"
className="regular-text"
name={ this.props.field.name }
id={ 'field_'+this.props.field.name }
value={ this.props.item[this.props.field.name] }
placeholder={ this.props.field.placeholder }
defaultValue={ this.props.field.defaultValue }
onChange={ this.props.onValueChange }
name={this.props.field.name}
id={'field_'+this.props.field.name}
value={this.props.item[this.props.field.name]}
placeholder={this.props.field.placeholder}
defaultValue={this.props.field.defaultValue}
onChange={this.props.onValueChange}
{...this.props.field.validation}
/>
);

View File

@ -159,7 +159,7 @@ define(
if(this.getErrors() !== undefined) {
errors = this.getErrors().map((error, index) => {
return (
<p key={ 'error-'+index } className="mailpoet_error">
<p key={'error-'+index} className="mailpoet_error">
{ error.message }
</p>
);
@ -194,10 +194,10 @@ define(
return (
<FormField
field={ field }
item={ this.getValues() }
onValueChange={ onValueChange }
key={ 'field-'+i } />
field={field}
item={this.getValues()}
onValueChange={onValueChange}
key={'field-'+i} />
);
});
@ -218,9 +218,9 @@ define(
<div>
{ beforeFormContent }
<form
id={ this.props.id }
id={this.props.id}
ref="form"
className={ formClasses }
className={formClasses}
onSubmit={
(this.props.onSubmit !== undefined)
? this.props.onSubmit

View File

@ -16,10 +16,10 @@ const container = document.getElementById('forms_container');
if(container) {
ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<IndexRoute component={ FormList } />
<Route path="*" component={ FormList } />
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={FormList} />
<Route path="*" component={FormList} />
</Route>
</Router>
), container);

View File

@ -87,7 +87,7 @@ const item_actions = [
label: MailPoet.I18n.t('edit'),
link: function (item) {
return (
<a href={ `admin.php?page=mailpoet-form-editor&id=${item.id}` }>{MailPoet.I18n.t('edit')}</a>
<a href={`admin.php?page=mailpoet-form-editor&id=${item.id}`}>{MailPoet.I18n.t('edit')}</a>
);
},
},
@ -158,11 +158,11 @@ const FormList = React.createClass({
return (
<div>
<td className={ row_classes }>
<td className={row_classes}>
<strong>
<a
className="row-title"
href={ `admin.php?page=mailpoet-form-editor&id=${form.id}` }
href={`admin.php?page=mailpoet-form-editor&id=${form.id}`}
>{ form.name }</a>
</strong>
{ actions }
@ -186,21 +186,21 @@ const FormList = React.createClass({
{MailPoet.I18n.t('pageTitle')} <a
className="page-title-action"
href="javascript:;"
onClick={ this.createForm }
onClick={this.createForm}
>{MailPoet.I18n.t('new')}</a>
</h1>
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
messages={ messages }
search={ false }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
messages={messages}
search={false}
endpoint="forms"
onRenderItem={ this.renderItem }
columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ item_actions }
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={bulk_actions}
item_actions={item_actions}
/>
</div>
);

View File

@ -19,12 +19,12 @@ const container = document.getElementById('help_container');
if(container) {
ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<Router history={history}>
<Route path="/" component={App}>
<IndexRedirect to="knowledgeBase" />
{/* Pages */}
<Route path="knowledgeBase(/)**" params={{ tab: 'knowledgeBase' }} component={ KnowledgeBase } />
<Route path="systemInfo(/)**" params={{ tab: 'systemInfo' }} component={ SystemInfo } />
<Route path="knowledgeBase(/)**" params={{ tab: 'knowledgeBase' }} component={KnowledgeBase} />
<Route path="systemInfo(/)**" params={{ tab: 'systemInfo' }} component={SystemInfo} />
</Route>
</Router>
), container);

View File

@ -26,9 +26,9 @@ function Tabs(props) {
return (
<Link
key={ 'tab-'+index }
className={ tabClasses }
to={ tab.link }
key={'tab-'+index}
className={tabClasses}
to={tab.link}
>{ tab.label }</Link>
);
});

View File

@ -93,21 +93,21 @@ define([
<select
name="bulk_actions"
ref="action"
value={ this.state.action }
value={this.state.action}
onChange={this.handleChangeAction}
>
<option value="">{MailPoet.I18n.t('bulkActions')}</option>
{ this.props.bulk_actions.map((action, index) => {
return (
<option
value={ action.name }
key={ 'action-' + index }
value={action.name}
key={'action-' + index}
>{ action.label }</option>
);
}) }
</select>
<input
onClick={ this.handleApplyAction }
onClick={this.handleApplyAction}
type="submit"
defaultValue={MailPoet.I18n.t('apply')}
className="button action" />

View File

@ -52,15 +52,15 @@ define([
.map((filter, i) => {
return (
<select
ref={ `filter-${i}` }
key={ `filter-${i}` }
name={ filter }
ref={`filter-${i}`}
key={`filter-${i}`}
name={filter}
>
{ filters[filter].map((option, j) => {
return (
<option
value={ option.value }
key={ 'filter-option-' + j }
value={option.value}
key={'filter-option-' + j}
>{ option.label }</option>
);
}) }
@ -74,7 +74,7 @@ define([
button = (
<input
id="post-query-submit"
onClick={ this.handleFilterAction }
onClick={this.handleFilterAction}
type="submit"
defaultValue={MailPoet.I18n.t('filter')}
className="button" />
@ -85,7 +85,7 @@ define([
if (this.props.group === 'trash') {
empty_trash = (
<input
onClick={ this.handleEmptyTrash }
onClick={this.handleEmptyTrash}
type="submit"
value={MailPoet.I18n.t('emptyTrash')}
className="button"

View File

@ -19,7 +19,7 @@ const ListingHeader = React.createClass({
<ListingColumn
onSort={this.props.onSort}
sort_by={this.props.sort_by}
key={ 'column-' + index }
key={'column-' + index}
column={renderColumn} />
);
});
@ -37,8 +37,8 @@ const ListingHeader = React.createClass({
type="checkbox"
name="select_all"
ref="toggle"
checked={ this.props.selection }
onChange={ this.handleSelectItems } />
checked={this.props.selection}
onChange={this.handleSelectItems} />
</th>
);
}
@ -70,7 +70,7 @@ const ListingColumn = React.createClass({
if(this.props.column.sortable === true) {
label = (
<a onClick={ this.handleSort }>
<a onClick={this.handleSort}>
<span>{ this.props.column.label }</span>
<span className="sorting-indicator"></span>
</a>
@ -80,10 +80,10 @@ const ListingColumn = React.createClass({
}
return (
<th
className={ classes }
id={this.props.column.name }
className={classes}
id={this.props.column.name}
scope="col"
width={ this.props.column.width || null }
width={this.props.column.width || null}
>{label}</th>
);
},

View File

@ -48,12 +48,12 @@ const ListingItem = React.createClass({
}</label>
<input
type="checkbox"
value={ this.props.item.id }
value={this.props.item.id}
checked={
this.props.item.selected || this.props.selection === 'all'
}
onChange={ this.handleSelectItem }
disabled={ this.props.selection === 'all' } />
onChange={this.handleSelectItem}
disabled={this.props.selection === 'all'} />
</th>
);
}
@ -74,14 +74,14 @@ const ListingItem = React.createClass({
if (action.name === 'trash') {
custom_action = (
<span key={ 'action-'+index } className="trash">
<span key={'action-'+index} className="trash">
{(!is_first) ? ' | ' : ''}
<a
href="javascript:;"
onClick={ this.handleTrashItem.bind(
onClick={this.handleTrashItem.bind(
null,
this.props.item.id
) }>
)}>
{MailPoet.I18n.t('moveToTrash')}
</a>
</span>
@ -89,8 +89,8 @@ const ListingItem = React.createClass({
} else if (action.refresh) {
custom_action = (
<span
onClick={ this.props.onRefreshItems }
key={ 'action-'+index } className={ action.name }>
onClick={this.props.onRefreshItems}
key={'action-'+index} className={action.name}>
{(!is_first) ? ' | ' : ''}
{ action.link(this.props.item) }
</span>
@ -98,7 +98,7 @@ const ListingItem = React.createClass({
} else if (action.link) {
custom_action = (
<span
key={ 'action-'+index } className={ action.name }>
key={'action-'+index} className={action.name}>
{(!is_first) ? ' | ' : ''}
{ action.link(this.props.item) }
</span>
@ -106,7 +106,7 @@ const ListingItem = React.createClass({
} else {
custom_action = (
<span
key={ 'action-'+index } className={ action.name }>
key={'action-'+index} className={action.name}>
{(!is_first) ? ' | ' : ''}
<a href="javascript:;" onClick={
(action.onClick !== undefined)
@ -129,7 +129,7 @@ const ListingItem = React.createClass({
} else {
item_actions = (
<span className="edit">
<Link to={ `/edit/${ this.props.item.id }` }>{MailPoet.I18n.t('edit')}</Link>
<Link to={`/edit/${ this.props.item.id }`}>{MailPoet.I18n.t('edit')}</Link>
</span>
);
}
@ -143,7 +143,7 @@ const ListingItem = React.createClass({
<span>
<a
href="javascript:;"
onClick={ this.handleRestoreItem.bind(
onClick={this.handleRestoreItem.bind(
null,
this.props.item.id
)}
@ -154,7 +154,7 @@ const ListingItem = React.createClass({
<a
className="submitdelete"
href="javascript:;"
onClick={ this.handleDeleteItem.bind(
onClick={this.handleDeleteItem.bind(
null,
this.props.item.id
)}
@ -162,7 +162,7 @@ const ListingItem = React.createClass({
</span>
</div>
<button
onClick={ this.handleToggleItem.bind(null, this.props.item.id) }
onClick={this.handleToggleItem.bind(null, this.props.item.id)}
className="toggle-row" type="button">
<span className="screen-reader-text">{MailPoet.I18n.t('showMoreDetails')}</span>
</button>
@ -175,7 +175,7 @@ const ListingItem = React.createClass({
{ item_actions }
</div>
<button
onClick={ this.handleToggleItem.bind(null, this.props.item.id) }
onClick={this.handleToggleItem.bind(null, this.props.item.id)}
className="toggle-row" type="button">
<span className="screen-reader-text">{MailPoet.I18n.t('showMoreDetails')}</span>
</button>
@ -186,7 +186,7 @@ const ListingItem = React.createClass({
const row_classes = classNames({ 'is-expanded': this.state.expanded });
return (
<tr className={ row_classes }>
<tr className={row_classes}>
{ checkbox }
{ this.props.onRenderItem(this.props.item, actions) }
</tr>
@ -235,7 +235,7 @@ const ListingItems = React.createClass({
return (
<tbody>
<tr className={ select_all_classes }>
<tr className={select_all_classes}>
<td colSpan={
this.props.columns.length
+ (this.props.is_selectable ? 1 : 0)
@ -250,7 +250,7 @@ const ListingItems = React.createClass({
}
&nbsp;
<a
onClick={ this.props.onSelectAll }
onClick={this.props.onSelectAll}
href="javascript:;">{
(this.props.selection !== 'all')
? MailPoet.I18n.t('selectAllLink')
@ -266,19 +266,19 @@ const ListingItems = React.createClass({
return (
<ListingItem
columns={ this.props.columns }
onSelectItem={ this.props.onSelectItem }
onRenderItem={ this.props.onRenderItem }
onDeleteItem={ this.props.onDeleteItem }
onRestoreItem={ this.props.onRestoreItem }
onTrashItem={ this.props.onTrashItem }
onRefreshItems={ this.props.onRefreshItems }
selection={ this.props.selection }
is_selectable={ this.props.is_selectable }
item_actions={ this.props.item_actions }
group={ this.props.group }
key={ `item-${renderItem.id}-${index}` }
item={ renderItem } />
columns={this.props.columns}
onSelectItem={this.props.onSelectItem}
onRenderItem={this.props.onRenderItem}
onDeleteItem={this.props.onDeleteItem}
onRestoreItem={this.props.onRestoreItem}
onTrashItem={this.props.onTrashItem}
onRefreshItems={this.props.onRefreshItems}
selection={this.props.selection}
is_selectable={this.props.is_selectable}
item_actions={this.props.item_actions}
group={this.props.group}
key={`item-${renderItem.id}-${index}`}
item={renderItem} />
);
})}
</tbody>
@ -789,8 +789,8 @@ const Listing = React.createClass({
// search
let search = (
<ListingSearch
onSearch={ this.handleSearch }
search={ this.state.search }
onSearch={this.handleSearch}
search={this.state.search}
/>
);
if (this.props.search === false) {
@ -800,9 +800,9 @@ const Listing = React.createClass({
// groups
let groups = (
<ListingGroups
groups={ this.state.groups }
group={ this.state.group }
onSelectGroup={ this.handleGroup }
groups={this.state.groups}
group={this.state.group}
onSelectGroup={this.handleGroup}
/>
);
if (this.props.groups === false) {
@ -821,81 +821,81 @@ const Listing = React.createClass({
{ search }
<div className="tablenav top clearfix">
<ListingBulkActions
count={ this.state.count }
bulk_actions={ bulk_actions }
selection={ this.state.selection }
selected_ids={ this.state.selected_ids }
onBulkAction={ this.handleBulkAction } />
count={this.state.count}
bulk_actions={bulk_actions}
selection={this.state.selection}
selected_ids={this.state.selected_ids}
onBulkAction={this.handleBulkAction} />
<ListingFilters
filters={ this.state.filters }
filter={ this.state.filter }
group={ this.state.group }
onBeforeSelectFilter={ this.props.onBeforeSelectFilter || null }
onSelectFilter={ this.handleFilter }
onEmptyTrash={ this.handleEmptyTrash }
filters={this.state.filters}
filter={this.state.filter}
group={this.state.group}
onBeforeSelectFilter={this.props.onBeforeSelectFilter || null}
onSelectFilter={this.handleFilter}
onEmptyTrash={this.handleEmptyTrash}
/>
<ListingPages
count={ this.state.count }
page={ this.state.page }
limit={ this.state.limit }
onSetPage={ this.handleSetPage } />
count={this.state.count}
page={this.state.page}
limit={this.state.limit}
onSetPage={this.handleSetPage} />
</div>
<table className={ table_classes }>
<table className={table_classes}>
<thead>
<ListingHeader
onSort={ this.handleSort }
onSelectItems={ this.handleSelectItems }
selection={ this.state.selection }
sort_by={ sort_by }
sort_order={ sort_order }
columns={ columns }
is_selectable={ bulk_actions.length > 0 } />
onSort={this.handleSort}
onSelectItems={this.handleSelectItems}
selection={this.state.selection}
sort_by={sort_by}
sort_order={sort_order}
columns={columns}
is_selectable={bulk_actions.length > 0} />
</thead>
<ListingItems
onRenderItem={ this.handleRenderItem }
onDeleteItem={ this.handleDeleteItem }
onRestoreItem={ this.handleRestoreItem }
onTrashItem={ this.handleTrashItem }
onRefreshItems={ this.handleRefreshItems }
columns={ columns }
is_selectable={ bulk_actions.length > 0 }
onSelectItem={ this.handleSelectItem }
onSelectAll={ this.handleSelectAll }
selection={ this.state.selection }
selected_ids={ this.state.selected_ids }
loading={ this.state.loading }
group={ this.state.group }
count={ this.state.count }
limit={ this.state.limit }
item_actions={ item_actions }
messages={ messages }
items={ items } />
onRenderItem={this.handleRenderItem}
onDeleteItem={this.handleDeleteItem}
onRestoreItem={this.handleRestoreItem}
onTrashItem={this.handleTrashItem}
onRefreshItems={this.handleRefreshItems}
columns={columns}
is_selectable={bulk_actions.length > 0}
onSelectItem={this.handleSelectItem}
onSelectAll={this.handleSelectAll}
selection={this.state.selection}
selected_ids={this.state.selected_ids}
loading={this.state.loading}
group={this.state.group}
count={this.state.count}
limit={this.state.limit}
item_actions={item_actions}
messages={messages}
items={items} />
<tfoot>
<ListingHeader
onSort={ this.handleSort }
onSelectItems={ this.handleSelectItems }
selection={ this.state.selection }
sort_by={ sort_by }
sort_order={ sort_order }
columns={ columns }
is_selectable={ bulk_actions.length > 0 } />
onSort={this.handleSort}
onSelectItems={this.handleSelectItems}
selection={this.state.selection}
sort_by={sort_by}
sort_order={sort_order}
columns={columns}
is_selectable={bulk_actions.length > 0} />
</tfoot>
</table>
<div className="tablenav bottom">
<ListingBulkActions
count={ this.state.count }
bulk_actions={ bulk_actions }
selection={ this.state.selection }
selected_ids={ this.state.selected_ids }
onBulkAction={ this.handleBulkAction } />
count={this.state.count}
bulk_actions={bulk_actions}
selection={this.state.selection}
selected_ids={this.state.selected_ids}
onBulkAction={this.handleBulkAction} />
<ListingPages
count={ this.state.count }
page={ this.state.page }
limit={ this.state.limit }
onSetPage={ this.handleSetPage } />
count={this.state.count}
page={this.state.page}
limit={this.state.limit}
onSetPage={this.handleSetPage} />
</div>
</div>
);

View File

@ -78,7 +78,7 @@ define([
if(this.props.page > 1) {
previousPage = (
<a href="javascript:;"
onClick={ this.setPreviousPage }
onClick={this.setPreviousPage}
className="prev-page">
<span className="screen-reader-text">{MailPoet.I18n.t('previousPage')}</span>
<span aria-hidden="true"></span>
@ -89,7 +89,7 @@ define([
if(this.props.page > 2) {
firstPage = (
<a href="javascript:;"
onClick={ this.setFirstPage }
onClick={this.setFirstPage}
className="first-page">
<span className="screen-reader-text">{MailPoet.I18n.t('firstPage')}</span>
<span aria-hidden="true">«</span>
@ -100,7 +100,7 @@ define([
if(this.props.page < this.getLastPage()) {
nextPage = (
<a href="javascript:;"
onClick={ this.setNextPage }
onClick={this.setNextPage}
className="next-page">
<span className="screen-reader-text">{MailPoet.I18n.t('nextPage')}</span>
<span aria-hidden="true"></span>
@ -111,7 +111,7 @@ define([
if(this.props.page < this.getLastPage() - 1) {
lastPage = (
<a href="javascript:;"
onClick={ this.setLastPage }
onClick={this.setLastPage}
className="last-page">
<span className="screen-reader-text">{MailPoet.I18n.t('lastPage')}</span>
<span aria-hidden="true">»</span>
@ -136,13 +136,13 @@ define([
htmlFor="current-page-selector">{MailPoet.I18n.t('currentPage')}</label>
<input
type="text"
onChange={ this.handleChangeManualPage }
onKeyUp={ this.handleSetManualPage }
onBlur={ this.handleBlurManualPage }
onChange={this.handleChangeManualPage}
onKeyUp={this.handleSetManualPage}
onBlur={this.handleBlurManualPage}
aria-describedby="table-paging"
size="2"
ref="page"
value={ pageValue }
value={pageValue}
name="paged"
id="current-page-selector"
className="current-page" />
@ -172,7 +172,7 @@ define([
.replace('%$1d', this.props.count.toLocaleString());
}
return (
<div className={ classes }>
<div className={classes}>
<span className="displaying-num">{ numberOfItemsLabel }</span>
{ pagination }
</div>

View File

@ -48,13 +48,13 @@ define(
if(step['link'] !== undefined && this.props.step !== step.name) {
label = (
<Link to={ step.link }>{ step.label }</Link>
<Link to={step.link}>{ step.label }</Link>
);
}
return (
<span key={ 'step-'+index }>
<span className={ stepClasses }>
<span key={'step-'+index}>
<span className={stepClasses}>
{ label }
</span>
{ (index < (this.state.steps.length - 1) ) ? ' > ' : '' }

View File

@ -95,20 +95,20 @@ const _QueueMixin = {
{ newsletter.queue.count_processed } / { newsletter.queue.count_total }
&nbsp;&nbsp;
<a
id={ 'resume_'+newsletter.id }
id={'resume_'+newsletter.id}
className="button"
style={{ display: (newsletter.queue.status === 'paused')
? 'inline-block': 'none' }}
href="javascript:;"
onClick={ this.resumeSending.bind(null, newsletter) }
onClick={this.resumeSending.bind(null, newsletter)}
>{MailPoet.I18n.t('resume')}</a>
<a
id={ 'pause_'+newsletter.id }
id={'pause_'+newsletter.id}
className="button mailpoet_pause"
style={{ display: (newsletter.queue.status === null)
? 'inline-block': 'none' }}
href="javascript:;"
onClick={ this.pauseSending.bind(null, newsletter) }
onClick={this.pauseSending.bind(null, newsletter)}
>{MailPoet.I18n.t('pause')}</a>
</span>
);
@ -125,10 +125,10 @@ const _QueueMixin = {
return (
<div>
<div className={ progressClasses }>
<div className={progressClasses}>
<span
className="mailpoet_progress_bar"
style={ { width: progress_bar_width + '%' } }
style={{ width: progress_bar_width + '%' }}
></span>
<span className="mailpoet_progress_label">
{ percentage }
@ -285,9 +285,9 @@ const _StatisticsMixin = {
return (
<div>
<Link
key={ `stats-${newsletter.id}` }
to={ params.link }
onClick={ params.onClick || null }
key={`stats-${newsletter.id}`}
to={params.link}
onClick={params.onClick || null}
>
{content}
</Link>
@ -347,7 +347,7 @@ const _MailerMixin = {
<p>
<a href="javascript:;"
className="button"
onClick={ this.resumeMailerSending }
onClick={this.resumeMailerSending}
>{ MailPoet.I18n.t('mailerResumeSendingButton') }</a>
</p>
</div>

View File

@ -104,7 +104,7 @@ const newsletter_actions = [
name: 'view',
link: function (newsletter) {
return (
<a href={ newsletter.preview_url } target="_blank">
<a href={newsletter.preview_url} target="_blank">
{MailPoet.I18n.t('preview')}
</a>
);
@ -114,7 +114,7 @@ const newsletter_actions = [
name: 'edit',
link: function (newsletter) {
return (
<a href={ `?page=mailpoet-newsletter-editor&id=${ newsletter.id }` }>
<a href={`?page=mailpoet-newsletter-editor&id=${ newsletter.id }`}>
{MailPoet.I18n.t('edit')}
</a>
);
@ -184,9 +184,9 @@ const NewsletterListNotification = React.createClass({
renderStatus: function (newsletter) {
return (
<select
data-id={ newsletter.id }
defaultValue={ newsletter.status }
onChange={ this.updateStatus }
data-id={newsletter.id}
defaultValue={newsletter.status}
onChange={this.updateStatus}
>
<option value="active">{ MailPoet.I18n.t('active') }</option>
<option value="draft">{ MailPoet.I18n.t('inactive') }</option>
@ -269,7 +269,7 @@ const NewsletterListNotification = React.createClass({
} else {
return (
<Link
to={ `/notification/history/${ newsletter.id }` }
to={`/notification/history/${ newsletter.id }`}
>{ MailPoet.I18n.t('viewHistory') }</Link>
);
}
@ -283,25 +283,25 @@ const NewsletterListNotification = React.createClass({
return (
<div>
<td className={ rowClasses }>
<td className={rowClasses}>
<strong>
<a
className="row-title"
href={ `?page=mailpoet-newsletter-editor&id=${ newsletter.id }` }
href={`?page=mailpoet-newsletter-editor&id=${ newsletter.id }`}
>{ newsletter.subject }</a>
</strong>
{ actions }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('status') }>
<td className="column" data-colname={MailPoet.I18n.t('status')}>
{ this.renderStatus(newsletter) }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('settings') }>
<td className="column" data-colname={MailPoet.I18n.t('settings')}>
{ this.renderSettings(newsletter) }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('history') }>
<td className="column" data-colname={MailPoet.I18n.t('history')}>
{ this.renderHistoryLink(newsletter) }
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('lastModifiedOn') }>
<td className="column-date" data-colname={MailPoet.I18n.t('lastModifiedOn')}>
<abbr>{ MailPoet.Date.format(newsletter.updated_at) }</abbr>
</td>
</div>
@ -317,21 +317,21 @@ const NewsletterListNotification = React.createClass({
<ListingTabs tab="notification" />
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
endpoint="newsletters"
type="notification"
base_url="notification"
onRenderItem={ this.renderItem }
columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ newsletter_actions }
messages={ messages }
auto_refresh={ true }
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={bulk_actions}
item_actions={newsletter_actions}
messages={messages}
auto_refresh={true}
sort_by="updated_at"
sort_order="desc"
afterGetItems={ this.checkMailerStatus }
afterGetItems={this.checkMailerStatus}
/>
</div>
);

View File

@ -44,7 +44,7 @@ let newsletter_actions = [
name: 'view',
link: function (newsletter) {
return (
<a href={ newsletter.preview_url } target="_blank">
<a href={newsletter.preview_url} target="_blank">
{MailPoet.I18n.t('preview')}
</a>
);
@ -69,27 +69,27 @@ const NewsletterListNotificationHistory = React.createClass({
return (
<div>
<td className={ rowClasses }>
<td className={rowClasses}>
<strong>
<a
href={ newsletter.preview_url }
href={newsletter.preview_url}
target="_blank"
>{ newsletter.queue.newsletter_rendered_subject || newsletter.subject }</a>
</strong>
{ actions }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('status') }>
<td className="column" data-colname={MailPoet.I18n.t('status')}>
{ this.renderQueueStatus(newsletter, meta.mta_log) }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('lists') }>
<td className="column" data-colname={MailPoet.I18n.t('lists')}>
{ segments }
</td>
{ (mailpoet_tracking_enabled === true) ? (
<td className="column" data-colname={ MailPoet.I18n.t('statistics') }>
<td className="column" data-colname={MailPoet.I18n.t('statistics')}>
{ this.renderStatistics(newsletter, undefined, meta.current_time) }
</td>
) : null }
<td className="column-date" data-colname={ MailPoet.I18n.t('sentOn') }>
<td className="column-date" data-colname={MailPoet.I18n.t('sentOn')}>
{ (newsletter.sent_at) ? MailPoet.Date.format(newsletter.sent_at) : MailPoet.I18n.t('notSentYet') }
</td>
</div>
@ -110,19 +110,19 @@ const NewsletterListNotificationHistory = React.createClass({
>{MailPoet.I18n.t('backToPostNotifications')}</Link>
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
endpoint="newsletters"
type="notification_history"
base_url="notification/history/:parent_id"
onRenderItem={ this.renderItem }
onRenderItem={this.renderItem}
columns={columns}
item_actions={ newsletter_actions }
auto_refresh={ true }
item_actions={newsletter_actions}
auto_refresh={true}
sort_by="sent_at"
sort_order="desc"
afterGetItems={ this.checkMailerStatus }
afterGetItems={this.checkMailerStatus}
/>
</div>
);

View File

@ -113,7 +113,7 @@ let newsletter_actions = [
name: 'view',
link: function (newsletter) {
return (
<a href={ newsletter.preview_url } target="_blank">
<a href={newsletter.preview_url} target="_blank">
{MailPoet.I18n.t('preview')}
</a>
);
@ -174,7 +174,7 @@ const NewsletterListStandard = React.createClass({
return (
<div>
<td className={ rowClasses }>
<td className={rowClasses}>
<strong>
<a
className="row-title"
@ -184,18 +184,18 @@ const NewsletterListStandard = React.createClass({
</strong>
{ actions }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('status') }>
<td className="column" data-colname={MailPoet.I18n.t('status')}>
{ this.renderQueueStatus(newsletter, meta.mta_log) }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('lists') }>
<td className="column" data-colname={MailPoet.I18n.t('lists')}>
{ segments }
</td>
{ (mailpoet_tracking_enabled === true) ? (
<td className="column" data-colname={ MailPoet.I18n.t('statistics') }>
<td className="column" data-colname={MailPoet.I18n.t('statistics')}>
{ this.renderStatistics(newsletter, undefined, meta.current_time) }
</td>
) : null }
<td className="column-date" data-colname={ MailPoet.I18n.t('sentOn') }>
<td className="column-date" data-colname={MailPoet.I18n.t('sentOn')}>
<abbr>{ (newsletter.sent_at) ? MailPoet.Date.format(newsletter.sent_at) : MailPoet.I18n.t('notSentYet') }</abbr>
</td>
</div>
@ -218,21 +218,21 @@ const NewsletterListStandard = React.createClass({
<ListingTabs tab="standard" />
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
endpoint="newsletters"
type="standard"
base_url="standard"
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={ bulk_actions }
item_actions={ newsletter_actions }
messages={ messages }
auto_refresh={ true }
bulk_actions={bulk_actions}
item_actions={newsletter_actions}
messages={messages}
auto_refresh={true}
sort_by="sent_at"
sort_order="desc"
afterGetItems={ this.checkMailerStatus }
afterGetItems={this.checkMailerStatus}
/>
</div>
);

View File

@ -35,9 +35,9 @@ const ListingTabs = React.createClass({
return (
<Link
key={ 'tab-'+index }
className={ tabClasses }
to={ tab.link }
key={'tab-'+index}
className={tabClasses}
to={tab.link}
onClick={() => MailPoet.trackEvent(`Tab Emails > ${tab.name} clicked`,
{ 'MailPoet Free version': window.mailpoet_version }
)}

View File

@ -103,7 +103,7 @@ let newsletter_actions = [
name: 'view',
link: function (newsletter) {
return (
<a href={ newsletter.preview_url } target="_blank">
<a href={newsletter.preview_url} target="_blank">
{MailPoet.I18n.t('preview')}
</a>
);
@ -113,7 +113,7 @@ let newsletter_actions = [
name: 'edit',
link: function (newsletter) {
return (
<a href={ `?page=mailpoet-newsletter-editor&id=${ newsletter.id }` }>
<a href={`?page=mailpoet-newsletter-editor&id=${ newsletter.id }`}>
{MailPoet.I18n.t('edit')}
</a>
);
@ -164,9 +164,9 @@ const NewsletterListWelcome = React.createClass({
<div>
<p>
<select
data-id={ newsletter.id }
defaultValue={ newsletter.status }
onChange={ this.updateStatus }
data-id={newsletter.id}
defaultValue={newsletter.status}
onChange={this.updateStatus}
>
<option value="active">{ MailPoet.I18n.t('active') }</option>
<option value="draft">{ MailPoet.I18n.t('inactive') }</option>
@ -256,30 +256,30 @@ const NewsletterListWelcome = React.createClass({
return (
<div>
<td className={ rowClasses }>
<td className={rowClasses}>
<strong>
<a
className="row-title"
href={ `?page=mailpoet-newsletter-editor&id=${ newsletter.id }` }
href={`?page=mailpoet-newsletter-editor&id=${ newsletter.id }`}
>{ newsletter.subject }</a>
</strong>
{ actions }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('status') }>
<td className="column" data-colname={MailPoet.I18n.t('status')}>
{ this.renderStatus(newsletter) }
</td>
<td className="column" data-colname={ MailPoet.I18n.t('settings') }>
<td className="column" data-colname={MailPoet.I18n.t('settings')}>
{ this.renderSettings(newsletter) }
</td>
{ (mailpoet_tracking_enabled === true) ? (
<td className="column" data-colname={ MailPoet.I18n.t('statistics') }>
<td className="column" data-colname={MailPoet.I18n.t('statistics')}>
{ this.renderStatistics(
newsletter,
newsletter.total_sent > 0 && newsletter.statistics
) }
</td>
) : null }
<td className="column-date" data-colname={ MailPoet.I18n.t('lastModifiedOn') }>
<td className="column-date" data-colname={MailPoet.I18n.t('lastModifiedOn')}>
<abbr>{ MailPoet.Date.format(newsletter.updated_at) }</abbr>
</td>
</div>
@ -295,21 +295,21 @@ const NewsletterListWelcome = React.createClass({
<ListingTabs tab="welcome" />
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
endpoint="newsletters"
type="welcome"
base_url="welcome"
onRenderItem={ this.renderItem }
columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ newsletter_actions }
messages={ messages }
auto_refresh={ true }
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={bulk_actions}
item_actions={newsletter_actions}
messages={messages}
auto_refresh={true}
sort_by="updated_at"
sort_order="desc"
afterGetItems={ this.checkMailerStatus }
afterGetItems={this.checkMailerStatus}
/>
</div>
);

View File

@ -31,23 +31,23 @@ if(container) {
extra_routes = Hooks.applyFilters('mailpoet_newsletters_before_router', extra_routes);
const mailpoet_listing = ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<Router history={history}>
<Route path="/" component={App}>
<IndexRedirect to="standard" />
{/* Listings */}
<Route path="standard(/)**" params={{ tab: 'standard' }} component={ NewsletterListStandard } />
<Route path="welcome(/)**" component={ NewsletterListWelcome } />
<Route path="notification/history/:parent_id(/)**" component={ NewsletterListNotificationHistory } />
<Route path="notification(/)**" component={ NewsletterListNotification } />
<Route path="standard(/)**" params={{ tab: 'standard' }} component={NewsletterListStandard} />
<Route path="welcome(/)**" component={NewsletterListWelcome} />
<Route path="notification/history/:parent_id(/)**" component={NewsletterListNotificationHistory} />
<Route path="notification(/)**" component={NewsletterListNotification} />
{/* Newsletter: type selection */}
<Route path="new" component={ NewsletterTypes } />
<Route path="new" component={NewsletterTypes} />
{/* New newsletter: types */}
<Route path="new/standard" component={ NewsletterTypeStandard } />
<Route path="new/notification" component={ NewsletterTypeNotification } />
<Route path="new/standard" component={NewsletterTypeStandard} />
<Route path="new/notification" component={NewsletterTypeNotification} />
{/* Template selection */}
<Route name="template" path="template/:id" component={ NewsletterTemplates } />
<Route name="template" path="template/:id" component={NewsletterTemplates} />
{/* Sending options */}
<Route path="send/:id" component={ NewsletterSend } />
<Route path="send/:id" component={NewsletterSend} />
{/* Extra routes */}
{ extra_routes.map(rt => <Route key={rt.path} path={rt.path} component={rt.component} />) }
</Route>

View File

@ -293,9 +293,9 @@ define(
<Form
id="mailpoet_newsletter"
fields={ fields }
item={ this.state.item }
loading={ this.state.loading }
fields={fields}
item={this.state.item}
loading={this.state.loading}
onChange={this.handleFormChange}
onSubmit={this.handleSave}
>
@ -305,13 +305,13 @@ define(
<input
className="button button-primary"
type="button"
onClick={ this.handleResume }
onClick={this.handleResume}
value={MailPoet.I18n.t('resume')} />
:
<input
className="button button-primary"
type="button"
onClick={ this.handleSend }
onClick={this.handleSend}
value={MailPoet.I18n.t('send')}
{...this.getSendButtonOptions()}
/>

View File

@ -157,7 +157,7 @@ define(
size="10"
name={this.getFieldName()}
value={this.getDisplayDate(this.props.value)}
readOnly={ true }
readOnly={true}
disabled={this.props.disabled}
onChange={this.onChange}
ref="dateInput"
@ -172,8 +172,8 @@ define(
(value, index) => {
return (
<option
key={ 'option-' + index }
value={ value }>
key={'option-' + index}
value={value}>
{ timeOfDayItems[value] }
</option>
);

View File

@ -219,7 +219,7 @@ define(
<div className="mailpoet_delete">
<a
href="javascript:;"
onClick={ this.handleDeleteTemplate.bind(null, template) }
onClick={this.handleDeleteTemplate.bind(null, template)}
>
{MailPoet.I18n.t('delete')}
</a>
@ -231,14 +231,14 @@ define(
&& template.thumbnail.length > 0) {
thumbnail = (
<a href="javascript:;" onClick={this.handleShowTemplate.bind(null, template)}>
<img src={ template.thumbnail } />
<img src={template.thumbnail} />
<div className="mailpoet_overlay"></div>
</a>
);
}
return (
<li key={ 'template-'+index }>
<li key={'template-'+index}>
<div className="mailpoet_thumbnail">
{ thumbnail }
</div>
@ -251,14 +251,14 @@ define(
<div className="mailpoet_actions">
<a
className="button button-secondary"
onClick={ this.handleShowTemplate.bind(null, template) }
onClick={this.handleShowTemplate.bind(null, template)}
>
{MailPoet.I18n.t('preview')}
</a>
&nbsp;
<a
className="button button-primary"
onClick={ this.handleSelectTemplate.bind(null, template) }
onClick={this.handleSelectTemplate.bind(null, template)}
>
{MailPoet.I18n.t('select')}
</a>
@ -280,7 +280,7 @@ define(
<Breadcrumb step="template" />
<ul className={ boxClasses }>
<ul className={boxClasses}>
{ templates }
</ul>

View File

@ -58,7 +58,7 @@ define(
description: MailPoet.I18n.t('regularNewsletterTypeDescription'),
action: function () {
return (
<a className="button button-primary" onClick={ this.createNewsletter.bind(null, 'standard') }>
<a className="button button-primary" onClick={this.createNewsletter.bind(null, 'standard')}>
{MailPoet.I18n.t('create')}
</a>
);
@ -84,7 +84,7 @@ define(
description: MailPoet.I18n.t('postNotificationNewsletterTypeDescription'),
action: function () {
return (
<a className="button button-primary" onClick={ this.setupNewsletter.bind(null, 'notification') }>
<a className="button button-primary" onClick={this.setupNewsletter.bind(null, 'notification')}>
{MailPoet.I18n.t('setUp')}
</a>
);

View File

@ -82,7 +82,7 @@ define(
<input
className="button button-primary"
type="button"
onClick={ this.handleNext }
onClick={this.handleNext}
value={MailPoet.I18n.t('next')} />
</p>
</div>

View File

@ -130,42 +130,42 @@ const WelcomeScheduling = React.createClass({
if (value.event === 'user') {
roleSegmentSelection = (
<Select
field={ roleField }
item={ this._getCurrentValue() }
onValueChange={ this.handleRoleChange } />
field={roleField}
item={this._getCurrentValue()}
onValueChange={this.handleRoleChange} />
);
} else {
roleSegmentSelection = (
<Select
field={ segmentField }
item={ this._getCurrentValue() }
onValueChange={ this.handleSegmentChange } />
field={segmentField}
item={this._getCurrentValue()}
onValueChange={this.handleSegmentChange} />
);
}
if (value.afterTimeType !== 'immediate') {
timeNumber = (
<Text
field={ afterTimeNumberField }
item={ this._getCurrentValue() }
onValueChange={ this.handleAfterTimeNumberChange } />
field={afterTimeNumberField}
item={this._getCurrentValue()}
onValueChange={this.handleAfterTimeNumberChange} />
);
}
return (
<div>
<Select
field={ events }
item={ this._getCurrentValue() }
onValueChange={ this.handleEventChange } />
field={events}
item={this._getCurrentValue()}
onValueChange={this.handleEventChange} />
{ roleSegmentSelection }
{ timeNumber }
<Select
field={ afterTimeTypeField }
item={ this._getCurrentValue() }
onValueChange={ this.handleAfterTimeTypeChange } />
field={afterTimeTypeField}
item={this._getCurrentValue()}
onValueChange={this.handleAfterTimeTypeChange} />
</div>
);
},

View File

@ -51,9 +51,9 @@ define(
<Form
endpoint="segments"
fields={ fields }
params={ this.props.params }
messages={ messages }
fields={fields}
params={this.props.params}
messages={messages}
/>
</div>
);

View File

@ -99,7 +99,7 @@ const item_actions = [
name: 'edit',
link: function (item) {
return (
<Link to={ `/edit/${item.id}` }>{MailPoet.I18n.t('edit')}</Link>
<Link to={`/edit/${item.id}`}>{MailPoet.I18n.t('edit')}</Link>
);
},
display: function (segment) {
@ -180,7 +180,7 @@ const item_actions = [
name: 'view_subscribers',
link: function (item) {
return (
<a href={ item.subscribers_url }>{MailPoet.I18n.t('viewSubscribers')}</a>
<a href={item.subscribers_url}>{MailPoet.I18n.t('viewSubscribers')}</a>
);
},
},
@ -216,35 +216,35 @@ const SegmentList = React.createClass({
segment_name = (
<Link
className="row-title"
to={ `/edit/${segment.id}` }
to={`/edit/${segment.id}`}
>{ segment.name }</Link>
);
}
return (
<div>
<td className={ rowClasses }>
<td className={rowClasses}>
<strong>
{ segment_name }
</strong>
{ actions }
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('description') }>
<td className="column-date" data-colname={MailPoet.I18n.t('description')}>
<abbr>{ segment.description }</abbr>
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('subscribed') }>
<td className="column-date" data-colname={MailPoet.I18n.t('subscribed')}>
<abbr>{ subscribed.toLocaleString() }</abbr>
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('unconfirmed') }>
<td className="column-date" data-colname={MailPoet.I18n.t('unconfirmed')}>
<abbr>{ unconfirmed.toLocaleString() }</abbr>
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('unsubscribed') }>
<td className="column-date" data-colname={MailPoet.I18n.t('unsubscribed')}>
<abbr>{ unsubscribed.toLocaleString() }</abbr>
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('bounced') }>
<td className="column-date" data-colname={MailPoet.I18n.t('bounced')}>
<abbr>{ bounced.toLocaleString() }</abbr>
</td>
<td className="column-date" data-colname={ MailPoet.I18n.t('createdOn') }>
<td className="column-date" data-colname={MailPoet.I18n.t('createdOn')}>
<abbr>{ MailPoet.Date.format(segment.created_at) }</abbr>
</td>
</div>
@ -258,16 +258,16 @@ const SegmentList = React.createClass({
</h1>
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
messages={ messages }
search={ false }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
messages={messages}
search={false}
endpoint="segments"
onRenderItem={ this.renderItem }
columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ item_actions }
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={bulk_actions}
item_actions={item_actions}
sort_by="name"
sort_order="asc"
/>

View File

@ -18,12 +18,12 @@ const container = document.getElementById('segments_container');
if(container) {
ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<IndexRoute component={ SegmentList } />
<Route path="new" component={ SegmentForm } />
<Route path="edit/:id" component={ SegmentForm } />
<Route path="*" component={ SegmentList } />
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={SegmentList} />
<Route path="new" component={SegmentForm} />
<Route path="edit/:id" component={SegmentForm} />
<Route path="*" component={SegmentList} />
</Route>
</Router>
), container);

View File

@ -159,7 +159,7 @@ define(
/\[link\](.*?)\[\/link\]/g,
(match, i) => (
<a
key={ i }
key={i}
href={`user-edit.php?user_id=${ subscriber.wp_user_id }`}
>{ match }</a>
)
@ -193,11 +193,11 @@ define(
<Form
endpoint="subscribers"
fields={ fields }
params={ this.props.params }
messages={ messages }
beforeFormContent={ beforeFormContent }
afterFormContent={ afterFormContent }
fields={fields}
params={this.props.params}
messages={messages}
beforeFormContent={beforeFormContent}
afterFormContent={afterFormContent}
/>
</div>
);

View File

@ -88,7 +88,7 @@ const messages = {
<div>
<p>{MailPoet.I18n.t('bouncedSubscribersHelp')}</p>
<p>
<a href={ 'admin.php?page=mailpoet-premium' } className="button-primary">
<a href={'admin.php?page=mailpoet-premium'} className="button-primary">
{MailPoet.I18n.t('bouncedSubscribersPremiumButtonText')}
</a>
</p>
@ -117,7 +117,7 @@ const bulk_actions = [
};
return (
<Selection field={ field } />
<Selection field={field} />
);
},
getData: function () {
@ -149,7 +149,7 @@ const bulk_actions = [
};
return (
<Selection field={ field } />
<Selection field={field} />
);
},
getData: function () {
@ -181,7 +181,7 @@ const bulk_actions = [
};
return (
<Selection field={ field } />
<Selection field={field} />
);
},
getData: function () {
@ -230,7 +230,7 @@ const item_actions = [
label: MailPoet.I18n.t('edit'),
link: function (subscriber) {
return (
<Link to={ `/edit/${subscriber.id}` }>{MailPoet.I18n.t('edit')}</Link>
<Link to={`/edit/${subscriber.id}`}>{MailPoet.I18n.t('edit')}</Link>
);
},
},
@ -303,11 +303,11 @@ const SubscriberList = React.createClass({
return (
<div>
<td className={ row_classes }>
<td className={row_classes}>
<strong>
<Link
className="row-title"
to={ `/edit/${ subscriber.id }` }
to={`/edit/${ subscriber.id }`}
>{ subscriber.email }</Link>
</strong>
<p style={{ margin: 0 }}>
@ -350,17 +350,17 @@ const SubscriberList = React.createClass({
</h1>
<Listing
limit={ window.mailpoet_listing_per_page }
location={ this.props.location }
params={ this.props.params }
limit={window.mailpoet_listing_per_page}
location={this.props.location}
params={this.props.params}
endpoint="subscribers"
onRenderItem={ this.renderItem }
columns={ columns }
bulk_actions={ bulk_actions }
item_actions={ item_actions }
messages={ messages }
sort_by={ 'created_at' }
sort_order={ 'desc' }
onRenderItem={this.renderItem}
columns={columns}
bulk_actions={bulk_actions}
item_actions={item_actions}
messages={messages}
sort_by={'created_at'}
sort_order={'desc'}
/>
</div>
);

View File

@ -17,12 +17,12 @@ const container = document.getElementById('subscribers_container');
if(container) {
ReactDOM.render((
<Router history={ history }>
<Route path="/" component={ App }>
<IndexRoute component={ SubscriberList } />
<Route path="new" component={ SubscriberForm } />
<Route path="edit/:id" component={ SubscriberForm } />
<Route path="*" component={ SubscriberList } />
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={SubscriberList} />
<Route path="new" component={SubscriberForm} />
<Route path="edit/:id" component={SubscriberForm} />
<Route path="*" component={SubscriberList} />
</Route>
</Router>
), container);