2026-07-08 12:55:37 +02:00
|
|
|
import { CockpitPage } from '../pages/modes/CockpitPage.jsx'
|
|
|
|
|
import { WorkLayout, WorkIndexRedirect } from '../pages/modes/WorkLayout.jsx'
|
|
|
|
|
import { WorkTodayPage } from '../pages/modes/WorkTodayPage.jsx'
|
|
|
|
|
import { WorkMinePage } from '../pages/modes/WorkMinePage.jsx'
|
|
|
|
|
import { PlanLayout, PlanIndexRedirect } from '../pages/modes/PlanLayout.jsx'
|
|
|
|
|
import { PlanStructurePage } from '../pages/modes/PlanStructurePage.jsx'
|
|
|
|
|
import { PlanGatesPage } from '../pages/modes/PlanGatesPage.jsx'
|
|
|
|
|
import { PlanInboxPage } from '../pages/modes/PlanInboxPage.jsx'
|
2026-07-09 11:38:17 +02:00
|
|
|
import { PlanWorkPage } from '../pages/modes/PlanWorkPage.jsx'
|
2026-07-09 11:16:42 +02:00
|
|
|
import { PlanProfilePage } from '../pages/modes/PlanProfilePage.jsx'
|
|
|
|
|
import { PlanPortfolioPage } from '../pages/modes/PlanPortfolioPage.jsx'
|
2026-07-08 12:55:37 +02:00
|
|
|
import { ControlLayout, ControlIndexRedirect } from '../pages/modes/ControlLayout.jsx'
|
|
|
|
|
import { ControlStatusPage } from '../pages/modes/ControlStatusPage.jsx'
|
|
|
|
|
import { ControlJourneyPage } from '../pages/modes/ControlJourneyPage.jsx'
|
|
|
|
|
import { TeamPage } from '../pages/modes/TeamPage.jsx'
|
2026-07-05 06:41:23 +02:00
|
|
|
import { InitiativesPage } from '../pages/InitiativesPage.jsx'
|
|
|
|
|
|
2026-07-05 06:58:48 +02:00
|
|
|
/** @type {import('./viewRegistry.js').ViewDefinition[]} */
|
2026-07-05 06:41:23 +02:00
|
|
|
export const VIEWS = [
|
|
|
|
|
{
|
2026-07-08 12:55:37 +02:00
|
|
|
key: 'kairo.cockpit',
|
|
|
|
|
path: '/cockpit',
|
|
|
|
|
title: 'Cockpit',
|
|
|
|
|
navLabel: 'Cockpit',
|
|
|
|
|
shortLabel: 'Cockpit',
|
|
|
|
|
matchPrefix: '/cockpit',
|
|
|
|
|
requiredCapability: 'kairo.action.read',
|
|
|
|
|
component: CockpitPage,
|
|
|
|
|
showInNav: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'kairo.work',
|
|
|
|
|
path: '/work',
|
|
|
|
|
title: 'Ausführen',
|
|
|
|
|
navLabel: 'Ausführen',
|
|
|
|
|
shortLabel: 'Arbeit',
|
|
|
|
|
matchPrefix: '/work',
|
|
|
|
|
objectPrefixes: ['/actions'],
|
|
|
|
|
requiredCapability: 'kairo.action.read',
|
|
|
|
|
component: WorkLayout,
|
|
|
|
|
showInNav: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'kairo.plan',
|
|
|
|
|
path: '/plan',
|
|
|
|
|
title: 'Planen',
|
|
|
|
|
navLabel: 'Planen',
|
|
|
|
|
shortLabel: 'Plan',
|
|
|
|
|
matchPrefix: '/plan',
|
|
|
|
|
objectPrefixes: ['/projects', '/gates'],
|
|
|
|
|
requiredCapability: 'kairo.initiative.read',
|
|
|
|
|
component: PlanLayout,
|
|
|
|
|
showInNav: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'kairo.control',
|
|
|
|
|
path: '/control',
|
|
|
|
|
title: 'Kontrolle',
|
|
|
|
|
navLabel: 'Kontrolle',
|
|
|
|
|
shortLabel: 'Kontrolle',
|
|
|
|
|
matchPrefix: '/control',
|
|
|
|
|
requiredCapability: 'kairo.initiative.read',
|
|
|
|
|
component: ControlLayout,
|
|
|
|
|
showInNav: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'kairo.team',
|
|
|
|
|
path: '/team',
|
|
|
|
|
title: 'Team',
|
|
|
|
|
navLabel: 'Team',
|
|
|
|
|
shortLabel: 'Team',
|
|
|
|
|
matchPrefix: '/team',
|
2026-07-05 06:41:23 +02:00
|
|
|
requiredCapability: 'kairo.action.read',
|
2026-07-08 12:55:37 +02:00
|
|
|
component: TeamPage,
|
2026-07-05 06:41:23 +02:00
|
|
|
showInNav: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'kairo.initiatives',
|
|
|
|
|
path: '/initiatives',
|
|
|
|
|
title: 'Vorhaben',
|
2026-07-05 06:58:48 +02:00
|
|
|
navLabel: 'Vorhaben',
|
|
|
|
|
shortLabel: 'Vorhaben',
|
|
|
|
|
matchPrefix: '/initiatives',
|
2026-07-05 06:41:23 +02:00
|
|
|
requiredCapability: 'kairo.initiative.read',
|
|
|
|
|
component: InitiativesPage,
|
|
|
|
|
showInNav: true,
|
|
|
|
|
},
|
2026-07-08 12:55:37 +02:00
|
|
|
{
|
|
|
|
|
key: 'kairo.workspace',
|
|
|
|
|
path: '/workspace',
|
|
|
|
|
title: 'Workspace',
|
|
|
|
|
component: CockpitPage,
|
|
|
|
|
showInNav: false,
|
|
|
|
|
},
|
2026-07-05 06:58:48 +02:00
|
|
|
{
|
|
|
|
|
key: 'kairo.my_actions',
|
|
|
|
|
path: '/my-actions',
|
|
|
|
|
title: 'Meine Maßnahmen',
|
2026-07-08 12:55:37 +02:00
|
|
|
component: WorkMinePage,
|
|
|
|
|
showInNav: false,
|
2026-07-05 06:58:48 +02:00
|
|
|
},
|
2026-07-05 06:41:23 +02:00
|
|
|
]
|
|
|
|
|
|
2026-07-05 06:58:48 +02:00
|
|
|
/**
|
|
|
|
|
* @typedef {Object} ViewDefinition
|
|
|
|
|
* @property {string} key
|
|
|
|
|
* @property {string} path
|
|
|
|
|
* @property {string} title
|
|
|
|
|
* @property {string} [navLabel]
|
|
|
|
|
* @property {string} [shortLabel]
|
|
|
|
|
* @property {string} [matchPrefix]
|
2026-07-08 12:55:37 +02:00
|
|
|
* @property {string[]} [objectPrefixes]
|
2026-07-05 06:58:48 +02:00
|
|
|
* @property {string} [requiredCapability]
|
|
|
|
|
* @property {import('react').ComponentType<any>} component
|
|
|
|
|
* @property {boolean} [showInNav]
|
|
|
|
|
*/
|
|
|
|
|
|
2026-07-05 06:41:23 +02:00
|
|
|
export function getNavViews(capabilities) {
|
|
|
|
|
const capSet = capabilities instanceof Set ? capabilities : new Set(capabilities)
|
|
|
|
|
return VIEWS.filter((v) => v.showInNav !== false)
|
|
|
|
|
.filter((v) => !v.requiredCapability || capSet.has(v.requiredCapability))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getViewByKey(key) {
|
|
|
|
|
return VIEWS.find((v) => v.key === key)
|
|
|
|
|
}
|
2026-07-08 12:55:37 +02:00
|
|
|
|
|
|
|
|
export const MODE_ROUTE_COMPONENTS = {
|
|
|
|
|
workToday: WorkTodayPage,
|
|
|
|
|
workMine: WorkMinePage,
|
2026-07-09 11:16:42 +02:00
|
|
|
planPortfolio: PlanPortfolioPage,
|
|
|
|
|
planProfile: PlanProfilePage,
|
2026-07-08 12:55:37 +02:00
|
|
|
planStructure: PlanStructurePage,
|
|
|
|
|
planGates: PlanGatesPage,
|
|
|
|
|
planInbox: PlanInboxPage,
|
2026-07-09 11:38:17 +02:00
|
|
|
planWork: PlanWorkPage,
|
2026-07-08 12:55:37 +02:00
|
|
|
controlStatus: ControlStatusPage,
|
|
|
|
|
controlJourney: ControlJourneyPage,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
WorkLayout,
|
|
|
|
|
WorkIndexRedirect,
|
|
|
|
|
PlanLayout,
|
|
|
|
|
PlanIndexRedirect,
|
|
|
|
|
ControlLayout,
|
|
|
|
|
ControlIndexRedirect,
|
|
|
|
|
}
|