Skip to content

Commit d285e5f

Browse files
authored
Todoist - improving 'New Completed Task' (#16196)
* Package/pnpm bump * [partial] Adding 'due is recurring' prop * Adding recurring date info alert prop * Text improvement * pnpm * Reworking 'New Completed Task' to include recurring tasks
1 parent cfbc427 commit d285e5f

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

components/todoist/actions/create-task/create-task.mjs

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ export default {
44
key: "todoist-create-task",
55
name: "Create Task",
66
description: "Creates a task. [See the docs here](https://developer.todoist.com/rest/v2/#create-a-new-task)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
type: "action",
99
props: {
1010
todoist,
11+
recurringInfoLabel: {
12+
type: "alert",
13+
alertType: "info",
14+
content: "To create a recurring task, use the `Due String` prop with a value such as `every week`. [See the Todoist documentation on recurring dates](https://www.todoist.com/help/articles/introduction-to-recurring-dates-YUYVJJAV) for more examples and information.",
15+
},
1116
content: {
1217
propDefinition: [
1318
todoist,

components/todoist/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/todoist",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Pipedream Todoist Components",
55
"main": "todoist.app.mjs",
66
"keywords": [
@@ -10,7 +10,7 @@
1010
"homepage": "https://pipedream.com/apps/todoist",
1111
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
1212
"dependencies": {
13-
"@pipedream/platform": "^1.2.1",
13+
"@pipedream/platform": "^3.0.3",
1414
"json-2-csv": "^3.15.1",
1515
"query-string": "^7.1.3",
1616
"tmp-promise": "^3.0.3",

components/todoist/sources/completed-task/completed-task.mjs

+26-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,36 @@ export default {
55
key: "todoist-completed-task",
66
name: "New Completed Task",
77
description: "Emit new event for each completed task. [See the docs here](https://developer.todoist.com/sync/v8/#read-resources)",
8-
version: "0.0.6",
8+
version: "1.0.0",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {
1212
...common.methods,
13-
isElementRelevant(element) {
14-
return element.checked;
13+
_getLastDate() {
14+
return this.db.get("lastDate");
15+
},
16+
_setLastDate(value) {
17+
this.db.set("lastDate", value);
18+
},
19+
async getSyncResult() {
20+
const lastDate = this._getLastDate();
21+
const items = await this.todoist.getCompletedTasks({
22+
params: {
23+
since: lastDate,
24+
annotate_items: true,
25+
},
26+
});
27+
28+
const newDate = new Date().toISOString();
29+
this._setLastDate(newDate);
30+
31+
console.log(items);
32+
return items;
33+
},
34+
filterResults(syncResult) {
35+
return syncResult
36+
.filter((element) =>
37+
this.todoist.isProjectInList(element.project_id, this.selectProjects ?? []));
1538
},
1639
},
1740
};

pnpm-lock.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)