-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync projects as headings #38
Conversation
I tested it on my obsidian, looks cool. Thank you! I guess this PR closes #40. |
Exactly what I need. 👍 |
Please merge this 👍 I just came here to fork the repos and build this by my self. But now I just grabbed this code ..... awesome, Thank you. |
It'd be awesome to this is merged 🎉 Thanks @olexs |
+1 on the request to merge this! |
@@ -112,6 +115,8 @@ async function getTasksFromThingsDb( | |||
ON TMTag.uuid = TMTaskTag.tags | |||
LEFT JOIN TMArea | |||
ON TMTask.area = TMArea.uuid | |||
LEFT JOIN TMTask TMProject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TMProject
is not a separate table, but an alias for TMTask
within the query. The query self-joins TMTask
to map tasks the their assigned projects. Actually, very good hint with headings - I need to add the same mechanic for those, currently they cause a bug that breaks the sync somewhat.
@liamcain I'd like to think the day we'll have this merged will come soon. |
@liamcain Thank you so much! Appreciate it 👍 |
I use projects extensively in my Things setup, and wanted to have an option to use projects as subheadings when syncing tasks, in the same way as areas are used. The new feature is implemented as an option, disabled by default, so the previous default behavior (group by areas only) is maintained unless the user explicitly enables the option.
The new behaviour is as follows:
-- Task has NO AREA: task is directly listed under "Logbook"
-- Task has AN AREA: task is listed under the "Area" subheading, 1 level below "Logbook"
-- Task has NO AREA and NO PROJECT: task is directly listed under "Logbook"
-- Task has AN AREA and NO PROJECT: task is listed under the "Area" subheading, 1 level below "Logbook"
-- Task has AN AREA and A PROJECT: task is listed under the "Area" subheading (area has priority over project)
-- Task has NO AREA and A PROJECT: task is listed under the "Project" subheading, 1 level below "Logbook"
Relates to #26. The desired implementations described there are a bit more complex, but should also be doable based on my changes.
Additionally, I added an option to pad the area/project subheadings with a preceding newline. Same thing, disabled by default to maintain previous behavior on update.