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))
|
||||
.fail((res) => {
|
||||
setNewsletterSubject('');
|
||||
MailPoet.Notice.error(
|
||||
res.errors.map(error => error.message),
|
||||
{ scroll: true }
|
||||
);
|
||||
MailPoet.Notice.showApiErrorNotice(res);
|
||||
});
|
||||
}, [newsletterId]);
|
||||
|
||||
@ -77,7 +74,9 @@ const SendingStatus = (props) => {
|
||||
);
|
||||
};
|
||||
SendingStatus.propTypes = {
|
||||
location: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
location: PropTypes.shape({
|
||||
pathname: PropTypes.string,
|
||||
}).isRequired,
|
||||
match: PropTypes.shape({
|
||||
params: PropTypes.shape({
|
||||
id: PropTypes.string.isRequired,
|
||||
@ -112,10 +111,7 @@ const ListingItem = ({
|
||||
data: { taskId, subscriberId },
|
||||
})
|
||||
.done(() => window.mailpoet_listing.forceUpdate())
|
||||
.fail(res => MailPoet.Notice.error(
|
||||
res.errors.map(err => err.message),
|
||||
{ scroll: true }
|
||||
));
|
||||
.fail(res => MailPoet.Notice.showApiErrorNotice(res));
|
||||
};
|
||||
|
||||
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'),
|
||||
]);
|
||||
}
|
||||
$data['params']['task_ids'] = array_map(function($item) {
|
||||
return $item['task_id'];
|
||||
}, $tasks_ids);
|
||||
$data['params']['task_ids'] = array_column($tasks_ids, 'task_id');
|
||||
$listing_data = $this->listing_handler->get('\MailPoet\Models\ScheduledTaskSubscriber', $data);
|
||||
|
||||
$items = [];
|
||||
|
@ -225,7 +225,7 @@ class Newsletter {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function beingSentToSubscriber($subscriber, array $data = []) {
|
||||
public function withSubscriber($subscriber, array $data = []) {
|
||||
$this->task_subscribers[] = array_merge([
|
||||
'subscriber_id' => $subscriber->id,
|
||||
'processed' => 1,
|
||||
|
@ -30,8 +30,8 @@ class SendingStatusCest {
|
||||
'count_processed' => 2,
|
||||
'count_total' => 2,
|
||||
])
|
||||
->beingSentToSubscriber($lucky_subscriber)
|
||||
->beingSentToSubscriber($unlucky_subscriber, [
|
||||
->withSubscriber($lucky_subscriber)
|
||||
->withSubscriber($unlucky_subscriber, [
|
||||
'failed' => 1,
|
||||
'error' => 'Oh no!',
|
||||
])
|
||||
|
Reference in New Issue
Block a user