Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make a view that shows projects with flagged tasks
- Loading branch information
1 parent
c0e56f2
commit b7fa0f9
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"label" = "Show Flagged Projects"; | ||
"shortLabel" = "Flagged"; | ||
"mediumLabel" = "Show Flagged"; | ||
"longLabel" = "Show Flagged Projects"; | ||
"paletteLabel" = "Flagged"; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use strict"; | ||
(() => { | ||
var action = new PlugIn.Action(async () => { | ||
try { | ||
let toFocus = []; | ||
flattenedProjects | ||
.filter((p) => p.status == Project.Status.Active) | ||
.flatMap((p) => p.flattenedTasks.filter((t) => t.flagged && | ||
(t.taskStatus == Task.Status.Available || | ||
t.taskStatus == Task.Status.DueSoon || | ||
t.taskStatus == Task.Status.Next || | ||
t.taskStatus == Task.Status.Overdue))) | ||
.forEach((task) => { | ||
if (task.containingProject && toFocus.indexOf(task.containingProject) === -1) { | ||
toFocus.push(task.containingProject); | ||
} | ||
}); | ||
document.windows[0].perspective = Perspective.BuiltIn.Projects; | ||
document.windows[0].focus = toFocus; | ||
} | ||
catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
}); | ||
return action; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(() => { | ||
var action = new PlugIn.Action(async () => { | ||
try { | ||
let toFocus: Project[] = []; | ||
|
||
flattenedProjects | ||
.filter((p) => p.status == Project.Status.Active) | ||
.flatMap((p) => | ||
p.flattenedTasks.filter( | ||
(t: Task) => | ||
t.flagged && | ||
(t.taskStatus == Task.Status.Available || | ||
t.taskStatus == Task.Status.DueSoon || | ||
t.taskStatus == Task.Status.Next || | ||
t.taskStatus == Task.Status.Overdue) | ||
) | ||
) | ||
.forEach((task: Task) => { | ||
if (task.containingProject && toFocus.indexOf(task.containingProject) === -1) { | ||
toFocus.push(task.containingProject); | ||
} | ||
}); | ||
|
||
document.windows[0].perspective = Perspective.BuiltIn.Projects; | ||
document.windows[0].focus = toFocus as SectionArray; | ||
} catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
}); | ||
|
||
return action; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters