From 6ea52544e3de2b5cdea223464f518033d37afd1d Mon Sep 17 00:00:00 2001 From: HJ Works Date: Mon, 13 Nov 2023 23:10:53 +0900 Subject: [PATCH 1/7] Update TaskEntity.ts --- src/models/TaskEntity.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/models/TaskEntity.ts b/src/models/TaskEntity.ts index faa0c8f..6636a8e 100644 --- a/src/models/TaskEntity.ts +++ b/src/models/TaskEntity.ts @@ -45,17 +45,19 @@ export interface TaskEntityObject { class TaskEntity { private block: BlockEntity; private page: PageEntity; + private content: string; constructor(block: BlockEntity, page: PageEntity) { this.block = block; this.page = page; + this.content = this.rawContent; } public get uuid(): string { return getBlockUUID(this.block); } - public get content(): string { + public get trimContent(): string { let content = this.rawContent; content = content.replace(this.block.marker, ''); content = content.replace(`[#${this.block.priority}]`, ''); @@ -96,6 +98,14 @@ class TaskEntity { return this.page.properties?.[key]; } + public getContent() { + return this.trimContent(this.content); + } + + public setContent(value: string) { + this.cotnent = value; + } + public toObject(): TaskEntityObject { return { uuid: this.uuid, From 63f488b86eba31a40b9824cca2f2d4413f69f1ea Mon Sep 17 00:00:00 2001 From: HJ Works Date: Mon, 13 Nov 2023 23:14:28 +0900 Subject: [PATCH 2/7] Update tasks.ts --- src/state/tasks.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/state/tasks.ts b/src/state/tasks.ts index 36cb8ff..d28565d 100644 --- a/src/state/tasks.ts +++ b/src/state/tasks.ts @@ -21,7 +21,18 @@ async function getTaskEntitiesByQuery(query: string) { const page = await window.logseq.Editor.getPage( (block?.page as PageEntity).name, ); - return new TaskEntity(block!, page!); + let task = new TaskEntity(block!, page!); + try { + task.setContent(task.getContent().replace('((', '').replace('))','')); + const in_block = await window.logseq.Editor.getBlock(task.getContent(), { + includeChildren: false, + }); + if (in_block != null) { + task.setContent(task.trimContent(in_block.content)); + } + } catch { + } + return task; }), ); From 17dfb691c912d0a40153ad06c0d21d8c1fafecb2 Mon Sep 17 00:00:00 2001 From: HJ Works Date: Mon, 13 Nov 2023 23:27:31 +0900 Subject: [PATCH 3/7] Update TaskEntity.ts --- src/models/TaskEntity.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/models/TaskEntity.ts b/src/models/TaskEntity.ts index 6636a8e..bb08fc1 100644 --- a/src/models/TaskEntity.ts +++ b/src/models/TaskEntity.ts @@ -57,8 +57,7 @@ class TaskEntity { return getBlockUUID(this.block); } - public get trimContent(): string { - let content = this.rawContent; + public get trimContent(conten: string): string { content = content.replace(this.block.marker, ''); content = content.replace(`[#${this.block.priority}]`, ''); content = content.replace(/SCHEDULED: <[^>]+>/, ''); From 5201d64bcbda3da1378f5057d89d9278a97842d5 Mon Sep 17 00:00:00 2001 From: HJ Works Date: Mon, 13 Nov 2023 23:31:19 +0900 Subject: [PATCH 4/7] Update TaskEntity.ts --- src/models/TaskEntity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/TaskEntity.ts b/src/models/TaskEntity.ts index bb08fc1..3609194 100644 --- a/src/models/TaskEntity.ts +++ b/src/models/TaskEntity.ts @@ -57,7 +57,7 @@ class TaskEntity { return getBlockUUID(this.block); } - public get trimContent(conten: string): string { + public get trimContent(content: string): string { content = content.replace(this.block.marker, ''); content = content.replace(`[#${this.block.priority}]`, ''); content = content.replace(/SCHEDULED: <[^>]+>/, ''); From 120e849a3b9ca1e63c29588924a80f8c2dee4e42 Mon Sep 17 00:00:00 2001 From: HJ Works Date: Mon, 13 Nov 2023 23:33:28 +0900 Subject: [PATCH 5/7] Update TaskEntity.ts --- src/models/TaskEntity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/TaskEntity.ts b/src/models/TaskEntity.ts index 3609194..38863a2 100644 --- a/src/models/TaskEntity.ts +++ b/src/models/TaskEntity.ts @@ -102,7 +102,7 @@ class TaskEntity { } public setContent(value: string) { - this.cotnent = value; + this.content = value; } public toObject(): TaskEntityObject { From 08365ced78a48b3bd055525a4fc15789e797bcaf Mon Sep 17 00:00:00 2001 From: HJ Works Date: Tue, 14 Nov 2023 09:17:04 +0900 Subject: [PATCH 6/7] Update TaskEntity.ts --- src/models/TaskEntity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/TaskEntity.ts b/src/models/TaskEntity.ts index 38863a2..aeba45b 100644 --- a/src/models/TaskEntity.ts +++ b/src/models/TaskEntity.ts @@ -57,7 +57,7 @@ class TaskEntity { return getBlockUUID(this.block); } - public get trimContent(content: string): string { + public trimContent(content: string): string { content = content.replace(this.block.marker, ''); content = content.replace(`[#${this.block.priority}]`, ''); content = content.replace(/SCHEDULED: <[^>]+>/, ''); From c5f67a72222c25420f52ef285ae8f99d0742a6cc Mon Sep 17 00:00:00 2001 From: Hyungju Date: Thu, 23 Nov 2023 00:36:03 +0900 Subject: [PATCH 7/7] remove sponser. --- readme.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/readme.md b/readme.md index 37b34c0..cc530a4 100644 --- a/readme.md +++ b/readme.md @@ -4,8 +4,6 @@ A simple to-do list plugin for logseq > This plugin relies solely on the Logseq Plugin API to access local data, and does not store it externally. - - ### Features - Quickly add new to-do items to today's journal page. - View all of today's to-do items (include scheduled & today's journal page).