| 1 | /** |
| 2 | * Where Work's cycle pages are, apart from lib/cycles.ts so the sidebar |
| 3 | * (components/shell.tsx) links to them without bringing the cycle page's |
| 4 | * figures into every page. |
| 5 | */ |
| 6 | import { workPath } from "./work-items.ts"; |
| 7 | |
| 8 | /** The current cycle's page, or a numbered cycle's. */ |
| 9 | export function cyclePath(workspace: string, number?: number): string { |
| 10 | return number == null ? workPath(workspace, "cycle") : workPath(workspace, `cycles/${number}`); |
| 11 | } |
| 12 | |
| 13 | /** Planning the next cycle: Next beside the coming cycle. */ |
| 14 | export function cyclePlanPath(workspace: string): string { |
| 15 | return workPath(workspace, "cycle/plan"); |
| 16 | } |
| 17 | |
| 18 | /** Where Work's sidebar reads the current cycle. */ |
| 19 | export function cycleJsonPath(workspace: string): string { |
| 20 | return workPath(workspace, "cycle.json"); |
| 21 | } |
| 22 | |
| 23 | /** Work's settings, where cycles are turned on. */ |
| 24 | export function workSettingsPath(workspace: string): string { |
| 25 | return `/${workspace.toLowerCase()}/-/settings/work`; |
| 26 | } |
| 27 | |
| 28 | /** The sidebar's row: the current cycle in a few words (lib/cycles.ts `sidebarCycle`). */ |
| 29 | export type SidebarCycle = { number: number; left: string; done: number; scope: number; state: "upcoming" | "running" | "closed" }; |