AP1.9a: Arbeitsmodi-Shell mit Scope, Objekt-Routen und Legacy-Redirects.
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m46s
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
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m46s
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
Ersetzt die Vorhaben-Tab-Navigation durch Cockpit/Ausführen/Planen/Kontrolle/Team, Deep Links für APs/Projekte/Gates und Programm-Scope im Header. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
33831a8c2c
commit
e42edd86fa
54 files changed
+2489
-150
No files matched your search
@@ -0,0 +1,84 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useCapabilities } from '../../hooks/useCapabilities.js'
|
||||
import { getWidgetsForArea } from '../../registry/widgetRegistry.js'
|
||||
import { useSession } from '../../context/SessionContext.jsx'
|
||||
import { InitiativeForm } from '../../components/InitiativeForm.jsx'
|
||||
import { createInitiative } from '../../api/initiatives.js'
|
||||
import { ModeShell } from '../../components/ModeShell.jsx'
|
||||
import { initiativeCatalogPath } from '../../utils/routes.js'
|
||||
|
||||
export function CockpitPage() {
|
||||
const navigate = useNavigate()
|
||||
const { context } = useSession()
|
||||
const { capabilities, hasCapability } = useCapabilities()
|
||||
const widgets = getWidgetsForArea('workspace', capabilities)
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
const [formBusy, setFormBusy] = useState(false)
|
||||
const [formError, setFormError] = useState(null)
|
||||
|
||||
async function handleCreateInitiative(payload) {
|
||||
setFormBusy(true)
|
||||
setFormError(null)
|
||||
try {
|
||||
await createInitiative({
|
||||
...payload,
|
||||
owner_actor_id: context?.actor?.id,
|
||||
})
|
||||
setShowForm(false)
|
||||
navigate(initiativeCatalogPath())
|
||||
} catch (err) {
|
||||
setFormError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="app-page">
|
||||
<ModeShell
|
||||
modeKey="cockpit"
|
||||
actions={
|
||||
hasCapability('kairo.initiative.manage') ? (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Vorhaben anlegen'}
|
||||
</button>
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
|
||||
{showForm && (
|
||||
<section className="card inline-form-card">
|
||||
<h2 className="card-title card-title--lg">Neues Vorhaben</h2>
|
||||
{formError && <p className="error">{formError}</p>}
|
||||
<InitiativeForm
|
||||
onSubmit={handleCreateInitiative}
|
||||
onCancel={() => setShowForm(false)}
|
||||
busy={formBusy}
|
||||
submitLabel="Vorhaben anlegen"
|
||||
/>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<div className="widget-grid">
|
||||
{widgets.map((widget) => {
|
||||
const Component = widget.component
|
||||
return <Component key={widget.key} />
|
||||
})}
|
||||
</div>
|
||||
|
||||
{hasCapability('kairo.initiative.read') && (
|
||||
<p className="page-footer-link">
|
||||
<Link to={initiativeCatalogPath()} className="link-inline">
|
||||
Zum Vorhaben-Katalog →
|
||||
</Link>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { InitiativeJourneyPage } from '../initiative/InitiativeJourneyPage.jsx'
|
||||
|
||||
export function ControlJourneyPage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Journey ist vorhabenspezifisch.">
|
||||
<ScopedInitiativeProvider>
|
||||
<InitiativeJourneyPage />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom'
|
||||
import { ModeShell } from '../../components/ModeShell.jsx'
|
||||
import { ModeSubNav } from '../../components/ModeSubNav.jsx'
|
||||
|
||||
const CONTROL_NAV = [
|
||||
{ to: '/control/status', label: 'Steuerung', end: true },
|
||||
{ to: '/control/journey', label: 'Journey', end: true },
|
||||
]
|
||||
|
||||
export function ControlLayout() {
|
||||
return (
|
||||
<div className="app-page">
|
||||
<ModeShell modeKey="control" />
|
||||
<ModeSubNav items={CONTROL_NAV} />
|
||||
<Outlet />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function ControlIndexRedirect() {
|
||||
return <Navigate to="/control/status" replace />
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { InitiativeOverviewPage } from '../initiative/InitiativeOverviewPage.jsx'
|
||||
|
||||
export function ControlStatusPage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Steuerung und Lagebild brauchen ein Vorhaben im Scope.">
|
||||
<ScopedInitiativeProvider>
|
||||
<InitiativeOverviewPage />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { InitiativePlanPage } from '../initiative/InitiativePlanPage.jsx'
|
||||
|
||||
export function PlanGatesPage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Gates und Roadmap gehören zu einem Vorhaben.">
|
||||
<ScopedInitiativeProvider>
|
||||
<InitiativePlanPage />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { InitiativeInboxPage } from '../initiative/InitiativeInboxPage.jsx'
|
||||
|
||||
export function PlanInboxPage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Eingang und Triage sind vorhabenspezifisch.">
|
||||
<ScopedInitiativeProvider>
|
||||
<InitiativeInboxPage />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom'
|
||||
import { ModeShell } from '../../components/ModeShell.jsx'
|
||||
import { ModeSubNav } from '../../components/ModeSubNav.jsx'
|
||||
|
||||
const PLAN_NAV = [
|
||||
{ to: '/plan/structure', label: 'Struktur', end: true },
|
||||
{ to: '/plan/gates', label: 'Zielzustände', end: true },
|
||||
{ to: '/plan/inbox', label: 'Eingang', end: true },
|
||||
]
|
||||
|
||||
export function PlanLayout() {
|
||||
return (
|
||||
<div className="app-page">
|
||||
<ModeShell modeKey="plan" />
|
||||
<ModeSubNav items={PLAN_NAV} />
|
||||
<Outlet />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function PlanIndexRedirect() {
|
||||
return <Navigate to="/plan/structure" replace />
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { ProjectsSection } from '../../components/ProjectsSection.jsx'
|
||||
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
|
||||
|
||||
function PlanStructureInner() {
|
||||
const {
|
||||
initiativeId,
|
||||
projects,
|
||||
roadmapItems,
|
||||
selectedProjectId,
|
||||
setSelectedProjectId,
|
||||
capabilities,
|
||||
error,
|
||||
} = useInitiativeOperations()
|
||||
|
||||
return (
|
||||
<>
|
||||
{error && <p className="error">{error}</p>}
|
||||
<ProjectsSection
|
||||
initiativeId={initiativeId}
|
||||
projects={projects}
|
||||
roadmapItems={roadmapItems}
|
||||
selectedProjectId={selectedProjectId}
|
||||
onSelectProject={setSelectedProjectId}
|
||||
canManage={capabilities.has('kairo.project.manage')}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export function PlanStructurePage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Projektstruktur hängt an einem Vorhaben — wähle den Scope oben oder hier.">
|
||||
<ScopedInitiativeProvider>
|
||||
<PlanStructureInner />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { getActorWorkload } from '../../api/workspace.js'
|
||||
import { ModeShell } from '../../components/ModeShell.jsx'
|
||||
import { LoadingState } from '../../components/LoadingState.jsx'
|
||||
import { ErrorState } from '../../components/ErrorState.jsx'
|
||||
import { scopedPath } from '../../utils/routes.js'
|
||||
|
||||
export function TeamPage() {
|
||||
const [rows, setRows] = useState(null)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
getActorWorkload()
|
||||
.then((data) => {
|
||||
if (!cancelled) setRows(data)
|
||||
})
|
||||
.catch((err) => {
|
||||
if (!cancelled) setError(err.message)
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="app-page">
|
||||
<ModeShell modeKey="team" />
|
||||
{rows === null && !error && <LoadingState message="Lade Team-Auslastung …" />}
|
||||
{error && <ErrorState message={error} />}
|
||||
{rows && (
|
||||
<section className="card">
|
||||
<h2 className="card-title">Auslastung nach Actor</h2>
|
||||
{rows.length === 0 ? (
|
||||
<p className="muted">Keine Zuweisungen im Portfolio.</p>
|
||||
) : (
|
||||
<ul className="team-workload-list">
|
||||
{rows.map((row) => (
|
||||
<li key={row.actor_id} className="team-workload-list__item">
|
||||
<div>
|
||||
<strong>{row.actor_name || row.actor_id}</strong>
|
||||
<span className="muted">
|
||||
{' '}
|
||||
· {row.open_actions ?? 0} offen
|
||||
{(row.blocked_actions ?? 0) > 0
|
||||
? ` · ${row.blocked_actions} blockiert`
|
||||
: ''}
|
||||
</span>
|
||||
</div>
|
||||
<Link to={scopedPath('/work/mine')} className="link-inline">
|
||||
Queue ansehen
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<p className="page-footer-link muted">
|
||||
AP1.9b erweitert Team um Filter nach Vorhaben und direkte Zuweisungslinks.
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom'
|
||||
import { ModeShell } from '../../components/ModeShell.jsx'
|
||||
import { ModeSubNav } from '../../components/ModeSubNav.jsx'
|
||||
|
||||
const WORK_NAV = [
|
||||
{ to: '/work/today', label: 'Heute', end: true },
|
||||
{ to: '/work/mine', label: 'Meine Queue', end: true },
|
||||
]
|
||||
|
||||
export function WorkLayout() {
|
||||
return (
|
||||
<div className="app-page">
|
||||
<ModeShell modeKey="work" />
|
||||
<ModeSubNav items={WORK_NAV} />
|
||||
<Outlet />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function WorkIndexRedirect() {
|
||||
return <Navigate to="/work/today" replace />
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { MyActionsPage } from '../MyActionsPage.jsx'
|
||||
|
||||
export function WorkMinePage() {
|
||||
return <MyActionsPage embedded />
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { WorkspaceTodayWidget } from '../../widgets/WorkspaceTodayWidget.jsx'
|
||||
|
||||
export function WorkTodayPage() {
|
||||
return (
|
||||
<section className="card">
|
||||
<WorkspaceTodayWidget />
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user