Some checks failed
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 3m9s
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 3s
Test Suite / compose-smoke (push) Has been skipped
Archetyp-Profile und Seitenlogik auf Operating Context migriert; methodUiDefaults nur noch Fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
116 lines
3.9 KiB
JavaScript
116 lines
3.9 KiB
JavaScript
import { Navigate, Route, Routes } from 'react-router-dom'
|
|
import { SessionProvider, useSession } from './context/SessionContext.jsx'
|
|
import { ProgramScopeProvider } from './context/ProgramScopeContext.jsx'
|
|
import { ScopedOperationsBridge } from './layout/ScopedOperationsBridge.jsx'
|
|
import { AppLayout } from './layout/AppLayout.jsx'
|
|
import { AuthPanel } from './pages/AuthPanel.jsx'
|
|
import { ActionDetailPage } from './pages/ActionDetailPage.jsx'
|
|
import { ProjectObjectPage } from './pages/objects/ProjectObjectPage.jsx'
|
|
import { GateObjectPage } from './pages/objects/GateObjectPage.jsx'
|
|
import {
|
|
VIEWS,
|
|
WorkLayout,
|
|
WorkIndexRedirect,
|
|
PlanLayout,
|
|
PlanIndexRedirect,
|
|
ControlLayout,
|
|
ControlIndexRedirect,
|
|
} from './registry/viewRegistry.js'
|
|
import { renderModeRoutes } from './registry/renderModeRoutes.jsx'
|
|
import {
|
|
WorkspaceRedirect,
|
|
MyActionsRedirect,
|
|
InitiativeRootRedirect,
|
|
InitiativePlanRedirect,
|
|
InitiativeExecutionRedirect,
|
|
InitiativeInboxRedirect,
|
|
InitiativeJourneyRedirect,
|
|
InitiativeGateRedirect,
|
|
InitiativeProjectRedirect,
|
|
InitiativeActionRedirect,
|
|
} from './pages/LegacyRedirects.jsx'
|
|
import './app.css'
|
|
|
|
function AppRoutes() {
|
|
const { isAuthenticated, loading } = useSession()
|
|
|
|
if (loading) {
|
|
return null
|
|
}
|
|
|
|
if (!isAuthenticated) {
|
|
return <AuthPanel />
|
|
}
|
|
|
|
const topLevelViews = VIEWS.filter(
|
|
(v) =>
|
|
![
|
|
'kairo.workspace',
|
|
'kairo.my_actions',
|
|
'kairo.work',
|
|
'kairo.plan',
|
|
'kairo.control',
|
|
].includes(v.key),
|
|
)
|
|
|
|
return (
|
|
<ProgramScopeProvider>
|
|
<ScopedOperationsBridge>
|
|
<Routes>
|
|
<Route element={<AppLayout />}>
|
|
{topLevelViews.map((view) => (
|
|
<Route key={view.key} path={view.path} element={<view.component />} />
|
|
))}
|
|
|
|
<Route path="/work" element={<WorkLayout />}>
|
|
<Route index element={<WorkIndexRedirect />} />
|
|
{renderModeRoutes('work')}
|
|
</Route>
|
|
|
|
<Route path="/plan" element={<PlanLayout />}>
|
|
<Route index element={<PlanIndexRedirect />} />
|
|
{renderModeRoutes('plan')}
|
|
</Route>
|
|
|
|
<Route path="/control" element={<ControlLayout />}>
|
|
<Route index element={<ControlIndexRedirect />} />
|
|
{renderModeRoutes('control')}
|
|
</Route>
|
|
|
|
<Route path="/projects/:projectId" element={<ProjectObjectPage />} />
|
|
<Route path="/gates/:gateId" element={<GateObjectPage />} />
|
|
<Route path="/actions/:actionId" element={<ActionDetailPage />} />
|
|
|
|
<Route path="/workspace" element={<WorkspaceRedirect />} />
|
|
<Route path="/my-actions" element={<MyActionsRedirect />} />
|
|
|
|
<Route path="/initiatives/:id" element={<InitiativeRootRedirect />} />
|
|
<Route path="/initiatives/:id/plan" element={<InitiativePlanRedirect />} />
|
|
<Route path="/initiatives/:id/plan/items/:itemId" element={<InitiativeGateRedirect />} />
|
|
<Route path="/initiatives/:id/execution" element={<InitiativeExecutionRedirect />} />
|
|
<Route
|
|
path="/initiatives/:id/execution/projects/:projectId"
|
|
element={<InitiativeProjectRedirect />}
|
|
/>
|
|
<Route path="/initiatives/:id/inbox" element={<InitiativeInboxRedirect />} />
|
|
<Route path="/initiatives/:id/journey" element={<InitiativeJourneyRedirect />} />
|
|
<Route path="/initiatives/:id/actions/:actionId" element={<InitiativeActionRedirect />} />
|
|
<Route path="/initiatives/:id/detail" element={<InitiativeRootRedirect />} />
|
|
|
|
<Route path="/" element={<Navigate to="/cockpit" replace />} />
|
|
<Route path="*" element={<Navigate to="/cockpit" replace />} />
|
|
</Route>
|
|
</Routes>
|
|
</ScopedOperationsBridge>
|
|
</ProgramScopeProvider>
|
|
)
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<SessionProvider>
|
|
<AppRoutes />
|
|
</SessionProvider>
|
|
)
|
|
}
|