task.status === null)}
diff --git a/mailpoet/assets/js/src/help/tasks-list/tasks-list-data-row.jsx b/mailpoet/assets/js/src/help/tasks-list/tasks-list-data-row.jsx
index c3b155d275..3a9668aa10 100644
--- a/mailpoet/assets/js/src/help/tasks-list/tasks-list-data-row.jsx
+++ b/mailpoet/assets/js/src/help/tasks-list/tasks-list-data-row.jsx
@@ -4,10 +4,15 @@ import parseDate from 'date-fns/parse';
function TasksListDataRow(props) {
let scheduled = props.task.scheduled_at;
- if (scheduled) {
+ if (props.show_scheduled_at) {
scheduled = parseDate(scheduled, 'yyyy-MM-dd HH:mm:ss', new Date());
}
+ let cancelled = props.task.cancelled_at;
+ if (props.show_cancelled_at) {
+ cancelled = parseDate(cancelled, 'yyyy-MM-dd HH:mm:ss', new Date());
+ }
+
const updated = parseDate(
props.task.updated_at,
'yyyy-MM-dd HH:mm:ss',
@@ -51,6 +56,13 @@ function TasksListDataRow(props) {
)}`}
) : null}
+ {props.show_cancelled_at ? (
+
+ {`${MailPoet.Date.short(cancelled)} ${MailPoet.Date.time(
+ cancelled,
+ )}`}
+ |
+ ) : null}
{`${MailPoet.Date.short(updated)} ${MailPoet.Date.time(
updated,
@@ -62,12 +74,14 @@ function TasksListDataRow(props) {
TasksListDataRow.propTypes = {
show_scheduled_at: PropTypes.bool,
+ show_cancelled_at: PropTypes.bool,
task: PropTypes.shape({
id: PropTypes.number.isRequired,
type: PropTypes.string.isRequired,
priority: PropTypes.number.isRequired,
updated_at: PropTypes.string.isRequired,
scheduled_at: PropTypes.string,
+ cancelled_at: PropTypes.string,
status: PropTypes.string,
newsletter: PropTypes.shape({
newsletter_id: PropTypes.number.isRequired,
@@ -81,6 +95,7 @@ TasksListDataRow.propTypes = {
TasksListDataRow.defaultProps = {
show_scheduled_at: false,
+ show_cancelled_at: false,
};
export { TasksListDataRow };
diff --git a/mailpoet/assets/js/src/help/tasks-list/tasks-list-labels-row.jsx b/mailpoet/assets/js/src/help/tasks-list/tasks-list-labels-row.jsx
index d6e3d4697e..b8c1d468d7 100644
--- a/mailpoet/assets/js/src/help/tasks-list/tasks-list-labels-row.jsx
+++ b/mailpoet/assets/js/src/help/tasks-list/tasks-list-labels-row.jsx
@@ -1,16 +1,19 @@
import PropTypes from 'prop-types';
import { MailPoet } from 'mailpoet';
-function TasksListLabelsRow({ show_scheduled_at: showScheduledAt = false }) {
+function TasksListLabelsRow(props) {
return (
Id |
{MailPoet.I18n.t('email')} |
{MailPoet.I18n.t('subscriber')} |
{MailPoet.I18n.t('priority')} |
- {showScheduledAt ? (
+ {props.show_scheduled_at ? (
{MailPoet.I18n.t('scheduledAt')} |
) : null}
+ {props.show_cancelled_at ? (
+ {MailPoet.I18n.t('cancelledAt')} |
+ ) : null}
{MailPoet.I18n.t('updatedAt')} |
);
@@ -18,6 +21,12 @@ function TasksListLabelsRow({ show_scheduled_at: showScheduledAt = false }) {
TasksListLabelsRow.propTypes = {
show_scheduled_at: PropTypes.bool,
+ show_cancelled_at: PropTypes.bool,
+};
+
+TasksListLabelsRow.defaultProps = {
+ show_scheduled_at: false,
+ show_cancelled_at: false,
};
export { TasksListLabelsRow };
diff --git a/mailpoet/assets/js/src/help/tasks-list/tasks-list.jsx b/mailpoet/assets/js/src/help/tasks-list/tasks-list.jsx
index 3f70d9ef84..6fcb8c1658 100644
--- a/mailpoet/assets/js/src/help/tasks-list/tasks-list.jsx
+++ b/mailpoet/assets/js/src/help/tasks-list/tasks-list.jsx
@@ -4,12 +4,15 @@ import { TasksListDataRow } from './tasks-list-data-row.jsx';
import { TasksListLabelsRow } from './tasks-list-labels-row.jsx';
function TasksList(props) {
- const colsCount = props.show_scheduled_at ? 6 : 5;
+ const colsCount = props.show_scheduled_at || props.show_cancelled_at ? 6 : 5;
return (
-
+
{props.tasks.length ? (
@@ -18,6 +21,7 @@ function TasksList(props) {
key={task.id}
task={task}
show_scheduled_at={props.show_scheduled_at}
+ show_cancelled_at={props.show_cancelled_at}
/>
))
) : (
@@ -27,7 +31,10 @@ function TasksList(props) {
)}
-
+
);
@@ -35,11 +42,13 @@ function TasksList(props) {
TasksList.propTypes = {
show_scheduled_at: PropTypes.bool,
+ show_cancelled_at: PropTypes.bool,
tasks: PropTypes.arrayOf(TasksListDataRow.propTypes.task).isRequired,
};
TasksList.defaultProps = {
show_scheduled_at: false,
+ show_cancelled_at: false,
};
export { TasksList };
diff --git a/mailpoet/lib/AdminPages/Pages/Help.php b/mailpoet/lib/AdminPages/Pages/Help.php
index 0133a04912..273889858c 100644
--- a/mailpoet/lib/AdminPages/Pages/Help.php
+++ b/mailpoet/lib/AdminPages/Pages/Help.php
@@ -153,6 +153,9 @@ class Help {
'scheduled_at' => $task->getScheduledAt() ?
$task->getScheduledAt()->format(DateTime::DEFAULT_DATE_TIME_FORMAT)
: null,
+ 'cancelled_at' => $task->getCancelledAt() ?
+ $task->getCancelledAt()->format(DateTime::DEFAULT_DATE_TIME_FORMAT)
+ : null,
'status' => $task->getStatus(),
'newsletter' => $queue && $newsletter ? [
'newsletter_id' => $newsletter->getId(),
diff --git a/mailpoet/lib/Newsletter/Sending/ScheduledTasksRepository.php b/mailpoet/lib/Newsletter/Sending/ScheduledTasksRepository.php
index 4d3c3f6a92..04d3422d19 100644
--- a/mailpoet/lib/Newsletter/Sending/ScheduledTasksRepository.php
+++ b/mailpoet/lib/Newsletter/Sending/ScheduledTasksRepository.php
@@ -226,6 +226,7 @@ class ScheduledTasksRepository extends Repository {
$type = null,
$statuses = [
ScheduledTaskEntity::STATUS_COMPLETED,
+ ScheduledTaskEntity::STATUS_CANCELLED,
ScheduledTaskEntity::STATUS_SCHEDULED,
ScheduledTaskEntity::VIRTUAL_STATUS_RUNNING,
],
diff --git a/mailpoet/views/help.html b/mailpoet/views/help.html
index ae2802be31..26941d88b1 100644
--- a/mailpoet/views/help.html
+++ b/mailpoet/views/help.html
@@ -63,12 +63,14 @@
'scheduledTasks': __('Scheduled sending tasks'),
'runningTasks': __('Running sending tasks'),
'completedTasks': __('Completed sending tasks'),
+ 'cancelledTasks': __('Cancelled sending tasks'),
'type': _x('Type', 'Table column heading for task type.'),
'email': __('Email'),
'subscriber': __('Subscriber'),
'multipleSubscribers': _x('Multiple subscribers', 'Used when multiple subscribers are selected for a task and we don\'t list them all.'),
'priority': _x('Priority', 'Table column heading for task priority (number).' ),
'scheduledAt': __('Scheduled At'),
+ 'cancelledAt': __('Cancelled At'),
'updatedAt': __('Updated At'),
'nothingToShow': __('Nothing to show.'),
'preview': _x('Preview', 'Text of a link to email preview page.'),
|