Skip to content

Commit

Permalink
Merge pull request #6 from rbennett00:rbennett00/issue5
Browse files Browse the repository at this point in the history
Don't show 'sleeping' projects in dropdown
  • Loading branch information
rbennett00 authored Feb 15, 2024
2 parents db798ef + a82ca97 commit 0b85252
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 35 deletions.
10 changes: 5 additions & 5 deletions .obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
},
"active": "0bdae9833240843c",
"lastOpenFiles": [
"projects-tasks-demo/Calendar/daily/2024-02-11.md",
"projects-tasks-demo/Test3.md",
"projects-tasks-demo/Test2.md",
"projects-tasks-demo/Test1.md",
"projects-tasks-demo/DV Test.md",
"projects-tasks-demo-004.zip",
"projects-tasks-demo/people/yyy-yyy.md",
"projects-tasks-demo/people/xxx-xxx.md",
Expand Down Expand Up @@ -172,11 +177,6 @@
"projects-tasks-demo/templates/Daily Agenda.md",
"projects-tasks-demo/templates/Create new project.md",
"projects-tasks-demo/templates/Create new meeting note.md",
"projects-tasks-demo/templates",
"Efforts/Launch new website/Launch new website.md",
"projects-tasks-demo/Efforts/Some new project/Some new project.md",
"projects-tasks-demo/Efforts/Launch new website/Launch new website.md",
"projects-tasks-demo/Calendar/daily/2024-02-09.md",
"projects-tasks-demo/Example with notes.canvas",
"projects-tasks-demo/Taxonomy diagram.canvas",
"Example with notes.canvas",
Expand Down
52 changes: 30 additions & 22 deletions projects-tasks-demo/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
"type": "tabs",
"children": [
{
"id": "52957088e9611a60",
"id": "37a90a77754d1220",
"type": "leaf",
"state": {
"type": "empty",
"state": {}
"type": "markdown",
"state": {
"file": "templates/project.md",
"mode": "source",
"source": false
}
}
}
]
Expand Down Expand Up @@ -81,6 +85,7 @@
"state": {
"type": "backlink",
"state": {
"file": "templates/project.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -97,6 +102,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "templates/project.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand Down Expand Up @@ -130,7 +136,9 @@
"type": "leaf",
"state": {
"type": "outline",
"state": {}
"state": {
"file": "templates/project.md"
}
}
}
],
Expand All @@ -151,11 +159,26 @@
"templater-obsidian:Templater": false
}
},
"active": "52957088e9611a60",
"active": "37a90a77754d1220",
"lastOpenFiles": [
"Efforts/Launch new website/Launch new website.md",
"Efforts/Get some new flair/Get some new flair.md",
"Efforts/Compile weekly TPS reports/Compile weekly TPS reports.md",
"Efforts/Buy new red stapler/Buy new red stapler.md",
"templates/project.md",
"Welcome.md",
"templates/script - assign to project.md",
"templates/meeting.md",
"Calendar/Meetings/2024-02-15 sss.md",
"templates/Create new meeting note.md",
"Atlas/Maps/Efforts.md",
"Efforts/Get some new flair",
"Calendar/daily/2024-02-11.md",
"DV Test.md",
"Test1.md",
"Test3.md",
"Test2.md",
"Atlas/Maps/Areas.md",
"Welcome.md",
"Areas/Notes/People/fff-fff.md",
"Scrap test page.md",
"Areas/Notes/People/eee-eee.md",
Expand All @@ -169,20 +192,6 @@
"Areas/Notes/People",
"Areas/Notes",
"Areas",
"templates/create new person note.md",
"templates/person.md",
"Calendar/Meetings/2024-02-11 test2.md",
"Calendar/Meetings/2024-02-11 Test meeting.md",
"Test.md",
"templates/Task View.md",
"Atlas/Maps/Efforts.md",
"Atlas/Notes/People/Anna Winter.md",
"Atlas/Maps/People.md",
"Atlas/Notes/People/Simone Sez.md",
"templates/meeting.md",
"Behind-the-scenes details.md",
"templates/script - assign to project.md",
"templates/script - assign to area.md",
"Example with notes.canvas",
"Efforts/Buy new red stapler",
"Efforts/Compile weekly TPS reports",
Expand All @@ -191,7 +200,6 @@
"projects-tasks-demo",
"New folder",
"Taxonomy diagram.canvas",
"projects-tasks-demo.zip",
"Welcome.zip"
"projects-tasks-demo.zip"
]
}
50 changes: 50 additions & 0 deletions projects-tasks-demo/Atlas/Maps/Areas2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
up:
- "[[Welcome]]"
in:
- "[[Collections]]"
created: 2024-02-09
tags:
- map/view
---

This page uses DataviewJS to list all of the projects/efforts in the 'Efforts' folder, grouped by Area (using the area property in the project template), sorted by rank. The first codeblock is more complex because it puts each Area in a callout. If you don't care about that and just want a basic Dataview-style look, you can use the second codeblock instead (just remove the double-% above and below it). I'm still exploring ways to render the top version more elegantly, but am running into some weirness with dataviewjs and tables.

%%
```dataviewjs
var temp='\n> |Effort|Rank|Status|\n> |--|--|--|';
for (let group of dv.pages('"Efforts"').groupBy(p => p.area)) {
for (let row of group.rows
.sort(k => k.rank, 'desc')
.map(k => ["[[" + k.file.name + "]]", k.rank, k.project_status])) {
temp +=('\n> |' + row[0] + ' | ' + row[1] + ' | ' + row[2] + '|')
}
let mkdw = '> [!globe]+ ### ' + group.key + temp;
dv.span(mkdw);
temp='\n> |Effort|Rank|Status|\n> |--|--|--|';
}
```
%%


```dataviewjs
function drawCallout(header, entries) {
header = ">" + header + "\n><p style='height:0px; padding: 0px; margin: 0px;'>";
let id = (Math.random() + 1).toString(36).substring(14);
let target = `span.dataview.rbennett${id} span div.callout`;
dv.span(header, { cls: `dataview rbennett${id}` });
let div = document.querySelectorAll(target + " div.callout-content")[0];
//dv.api.taskList(tasks, false, div, dv.component);
dv.api.table(["Effort","Rank","Status"], entries, div, dv.component);
}
for (let group of dv.pages('"Efforts"').groupBy(p => p.area)) {
drawCallout("[!globe]+ " + group.key, group.rows.sort(k => k.rank, 'desc').map(k => [k.file.link, k.rank, k.project_status]));
}
```



Back to `= this.up`
2 changes: 1 addition & 1 deletion projects-tasks-demo/Atlas/Maps/Efforts.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ This page is pretty much identical to Nick's Efforts map, except it uses the `pr
> ```
---
[[Get some new flair]]
Back to `= this.up`
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
up:
- "[[Efforts]]"
project: Get some new flair
created: 2024-02-15
start_date: 2024-02-15
project_status: 💤 Sleeping
area: TGI Fridays
dependencies:
product:
stakeholders:
project_team:
tags:
rank:
type: project
template_version: "1.1"
---
# Project Goals
- x
- y
- z
# Notes

---

> [!multi-column]
>> [!todo]+ Tasks
>> ``` tasks
>> not done
>> description includes 📋[[Get some new flair]]
>> sort by due
>> group by priority
>> short mode
>>```
>
>>[!hint]+ Meetings
>> ``` dataview
>> list
>> from "Calendar/Meetings"
>> where contains(project, this.file.link)
>> sort meeting_date desc
>> ```
>
>> [!summary]+ Documents
>> -
>> -
---
Back to `= this.up`
5 changes: 2 additions & 3 deletions projects-tasks-demo/templates/meeting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ const projects = (await app.plugins.getPlugin("dataview").api.tryQuery(`
TABLE WITHOUT ID
project
FROM "Efforts"
WHERE project
GROUP BY project
SORT length(rows.file.link) DESC
WHERE type = "project" AND project_status != "💤 Sleeping"
SORT project ASC
`)).values;
projects.push("! new project");
let selectedProject = await tp.system.suggester(item => item, projects.sort(), true, "Select a project or create a new one...");
Expand Down
2 changes: 1 addition & 1 deletion projects-tasks-demo/templates/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ up: "[[Efforts]]"
project: <% project %>
created: <% tp.date.now("YYYY-MM-DD") %>
start_date: <% tp.date.now("YYYY-MM-DD") %>
project_status: on
project_status: 🔥 On
area: <% selectedArea %>
dependencies:
product:
Expand Down
5 changes: 2 additions & 3 deletions projects-tasks-demo/templates/script - assign to project.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ const projects = (await app.plugins.getPlugin("dataview").api.tryQuery(`
TABLE WITHOUT ID
project
FROM "Efforts"
WHERE project
GROUP BY project
SORT length(rows.file.link) DESC
WHERE type = "project" AND project_status != "💤 Sleeping"
SORT project ASC
`)).values;
projects.push("! new project");
let selectedProject = await tp.system.suggester(item => item, projects.sort(), true, "Select a project or create a new one...");
Expand Down

0 comments on commit 0b85252

Please sign in to comment.