Fix small issues
This commit is contained in:
committed by
M. Shull
parent
2e9c673da0
commit
529a0fef7b
@ -42,10 +42,7 @@ const SendingStatus = (props) => {
|
|||||||
.done(res => setNewsletterSubject(res.data.subject))
|
.done(res => setNewsletterSubject(res.data.subject))
|
||||||
.fail((res) => {
|
.fail((res) => {
|
||||||
setNewsletterSubject('');
|
setNewsletterSubject('');
|
||||||
MailPoet.Notice.error(
|
MailPoet.Notice.showApiErrorNotice(res);
|
||||||
res.errors.map(error => error.message),
|
|
||||||
{ scroll: true }
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}, [newsletterId]);
|
}, [newsletterId]);
|
||||||
|
|
||||||
@ -77,7 +74,9 @@ const SendingStatus = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
SendingStatus.propTypes = {
|
SendingStatus.propTypes = {
|
||||||
location: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
location: PropTypes.shape({
|
||||||
|
pathname: PropTypes.string,
|
||||||
|
}).isRequired,
|
||||||
match: PropTypes.shape({
|
match: PropTypes.shape({
|
||||||
params: PropTypes.shape({
|
params: PropTypes.shape({
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
@ -112,10 +111,7 @@ const ListingItem = ({
|
|||||||
data: { taskId, subscriberId },
|
data: { taskId, subscriberId },
|
||||||
})
|
})
|
||||||
.done(() => window.mailpoet_listing.forceUpdate())
|
.done(() => window.mailpoet_listing.forceUpdate())
|
||||||
.fail(res => MailPoet.Notice.error(
|
.fail(res => MailPoet.Notice.showApiErrorNotice(res));
|
||||||
res.errors.map(err => err.message),
|
|
||||||
{ scroll: true }
|
|
||||||
));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const rowClasses = classNames(
|
const rowClasses = classNames(
|
||||||
|
@ -50,9 +50,7 @@ class SendingTaskSubscribers extends APIEndpoint {
|
|||||||
APIError::NOT_FOUND => __('This newsletter is not being sent to any subcriber yet.', 'mailpoet'),
|
APIError::NOT_FOUND => __('This newsletter is not being sent to any subcriber yet.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$data['params']['task_ids'] = array_map(function($item) {
|
$data['params']['task_ids'] = array_column($tasks_ids, 'task_id');
|
||||||
return $item['task_id'];
|
|
||||||
}, $tasks_ids);
|
|
||||||
$listing_data = $this->listing_handler->get('\MailPoet\Models\ScheduledTaskSubscriber', $data);
|
$listing_data = $this->listing_handler->get('\MailPoet\Models\ScheduledTaskSubscriber', $data);
|
||||||
|
|
||||||
$items = [];
|
$items = [];
|
||||||
|
@ -225,7 +225,7 @@ class Newsletter {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beingSentToSubscriber($subscriber, array $data = []) {
|
public function withSubscriber($subscriber, array $data = []) {
|
||||||
$this->task_subscribers[] = array_merge([
|
$this->task_subscribers[] = array_merge([
|
||||||
'subscriber_id' => $subscriber->id,
|
'subscriber_id' => $subscriber->id,
|
||||||
'processed' => 1,
|
'processed' => 1,
|
||||||
|
@ -30,8 +30,8 @@ class SendingStatusCest {
|
|||||||
'count_processed' => 2,
|
'count_processed' => 2,
|
||||||
'count_total' => 2,
|
'count_total' => 2,
|
||||||
])
|
])
|
||||||
->beingSentToSubscriber($lucky_subscriber)
|
->withSubscriber($lucky_subscriber)
|
||||||
->beingSentToSubscriber($unlucky_subscriber, [
|
->withSubscriber($unlucky_subscriber, [
|
||||||
'failed' => 1,
|
'failed' => 1,
|
||||||
'error' => 'Oh no!',
|
'error' => 'Oh no!',
|
||||||
])
|
])
|
||||||
|
Reference in New Issue
Block a user