Some checks failed
Deploy Development / deploy (push) Successful in 56s
Test Suite / pytest-backend (push) Failing after 1m48s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Route /plan/work, Modal-Anlage, Links zu Objektseiten; Outline zeigt Zähler für Eingang und Arbeit. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
/**
|
|
* Top-level Plan-Outline-Knoten (AP1.12a).
|
|
* Unterknoten (Projekt-Baum, Gate-Graph) folgen in AP1.12b+.
|
|
*
|
|
* @typedef {{ key: string, to: string, label: string, requiresInitiative?: boolean, disabled?: boolean, hint?: string }} PlanOutlineNode
|
|
*/
|
|
|
|
/** @type {PlanOutlineNode[]} */
|
|
export const PLAN_OUTLINE_NODES = [
|
|
{ key: 'profile', to: '/plan/profile', label: 'Profil', requiresInitiative: true },
|
|
{ key: 'structure', to: '/plan/structure', label: 'Struktur', requiresInitiative: true },
|
|
{ key: 'gates', to: '/plan/gates', label: 'Zielzustände', requiresInitiative: true },
|
|
{ key: 'inbox', to: '/plan/inbox', label: 'Eingang', requiresInitiative: true },
|
|
{ key: 'work', to: '/plan/work', label: 'Arbeit', requiresInitiative: true },
|
|
]
|
|
|
|
/**
|
|
* @param {string} pathname
|
|
* @returns {string | null}
|
|
*/
|
|
export function resolvePlanOutlineActiveKey(pathname) {
|
|
const path = pathname.replace(/\/$/, '') || pathname
|
|
const match = PLAN_OUTLINE_NODES.find(
|
|
(node) => path === node.to || path.startsWith(`${node.to}/`),
|
|
)
|
|
return match?.key ?? null
|
|
}
|