Skip to content
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

Merged
merged 2 commits into from
Oct 25, 2023
Merged

Sync projects as headings #38

merged 2 commits into from
Oct 25, 2023

Conversation

olexs
Copy link
Contributor

@olexs olexs commented May 25, 2022

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:

  • "Include project" disabled (default), same behaviour as before the new feature:
    -- 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"
  • "Include project" enabled:
    -- 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.

@kovstas
Copy link
Contributor

kovstas commented Nov 26, 2022

I tested it on my obsidian, looks cool. Thank you! I guess this PR closes #40.

@ekexium
Copy link

ekexium commented Nov 30, 2022

Exactly what I need. 👍

@netfly
Copy link

netfly commented Mar 28, 2023

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.

@martedesco
Copy link

Thanks @olexs ! @liamcain, @olexs addition looks pretty cool. I would love to see this PR merged 🙌🏼

@kakkoyun
Copy link

It'd be awesome to this is merged 🎉

Thanks @olexs

@pwntester
Copy link

+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
Copy link
Contributor Author

@olexs olexs Sep 18, 2023

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.

@buylife
Copy link

buylife commented Oct 16, 2023

@liamcain I'd like to think the day we'll have this merged will come soon.

@liamcain liamcain merged commit a0c4259 into liamcain:main Oct 25, 2023
@buylife
Copy link

buylife commented Oct 25, 2023

@liamcain Thank you so much! Appreciate it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants