From 172cc4ce538f98fc7d720bb833e89c10a3dccea5 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 14 Feb 2019 22:00:13 +0000 Subject: [PATCH] Task: rename the completed property to finished and include cancelled. --- src/components/TaskList.tsx | 2 +- src/pim-types.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/TaskList.tsx b/src/components/TaskList.tsx index adf3b00..3fce1b4 100644 --- a/src/components/TaskList.tsx +++ b/src/components/TaskList.tsx @@ -47,7 +47,7 @@ class TaskList extends React.PureComponent { }; render() { - const entries = this.props.entries.filter((x) => !x.completed); + const entries = this.props.entries.filter((x) => !x.finished); const sortedEntries = sortSelector(entries); let itemList = sortedEntries.map((entry, idx, array) => { diff --git a/src/pim-types.ts b/src/pim-types.ts index 02acdf7..bb6fa98 100644 --- a/src/pim-types.ts +++ b/src/pim-types.ts @@ -71,9 +71,9 @@ export class TaskType extends EventType { super(comp ? comp : new ICAL.Component('vtodo')); } - get completed() { - const status = this.component.getFirstPropertyValue('status'); - return status === 'COMPLETED'; + get finished() { + return this.status === TaskStatusType.Completed || + this.status === TaskStatusType.Cancelled; } set status(status: TaskStatusType) {