Kairo-Jinkendo/frontend/src/plan/planOutlineNodes.js
Lars 4f2f801889
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
AP1.12d: Plan-Outline-Knoten Arbeit mit Actions-Liste im Plan-Kontext.
Route /plan/work, Modal-Anlage, Links zu Objektseiten; Outline zeigt Zähler für Eingang und Arbeit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 11:38:17 +02:00

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
}