AP1.12a: Plan-Outline-Shell ersetzt Untertabs im Planen-Modus.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 2m4s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 2m4s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Linke Outline mit Profil, Struktur, Zielzuständen und Eingang; Portfolio-Einstieg ohne Scope; Vorhabens-Profil als Read-only-Vorschau. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
aa7e1626ea
commit
bbadf22d39
12 files changed
+389
-16
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { Navigate } from 'react-router-dom'
|
||||
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
|
||||
|
||||
/** Portfolio ohne Scope → Übersicht; mit Vorhaben → Profil als Einstieg. */
|
||||
export function PlanIndexRedirect() {
|
||||
const { initiativeId, hrefWithScope } = useProgramScope()
|
||||
|
||||
if (initiativeId) {
|
||||
return <Navigate to={hrefWithScope('/plan/profile')} replace />
|
||||
}
|
||||
|
||||
return <Navigate to="/plan/portfolio" replace />
|
||||
}
|
||||
@@ -1,23 +1,19 @@
|
||||
import { Navigate, Outlet } from 'react-router-dom'
|
||||
import { 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 },
|
||||
]
|
||||
import { PlanOutlineNav } from '../../components/PlanOutlineNav.jsx'
|
||||
|
||||
export function PlanLayout() {
|
||||
return (
|
||||
<div className="app-page">
|
||||
<div className="app-page plan-outline-shell">
|
||||
<ModeShell modeKey="plan" />
|
||||
<ModeSubNav items={PLAN_NAV} />
|
||||
<Outlet />
|
||||
<div className="plan-outline-shell__body">
|
||||
<PlanOutlineNav />
|
||||
<div className="plan-outline-shell__content">
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function PlanIndexRedirect() {
|
||||
return <Navigate to="/plan/structure" replace />
|
||||
}
|
||||
export { PlanIndexRedirect } from './PlanIndexRedirect.jsx'
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Link } from 'react-router-dom'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { listInitiatives } from '../../api/initiatives.js'
|
||||
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
|
||||
import { LoadingState } from '../../components/LoadingState.jsx'
|
||||
import { scopedPath } from '../../utils/routes.js'
|
||||
|
||||
export function PlanPortfolioPage() {
|
||||
const { applyFromInitiative } = useProgramScope()
|
||||
const [initiatives, setInitiatives] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
listInitiatives()
|
||||
.then((data) => {
|
||||
if (!cancelled) setInitiatives(data)
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setInitiatives([])
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [])
|
||||
|
||||
if (initiatives === null) {
|
||||
return <LoadingState message="Lade Vorhaben …" />
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card plan-portfolio">
|
||||
<h2 className="card-title">Programm planen</h2>
|
||||
<p className="page-lead">
|
||||
Wähle ein Vorhaben im Scope oben oder in der Liste — dann erscheint die Plan-Outline
|
||||
mit Profil, Struktur, Zielzuständen und Eingang.
|
||||
</p>
|
||||
{initiatives.length === 0 ? (
|
||||
<p className="muted">
|
||||
Noch keine Vorhaben angelegt.{' '}
|
||||
<Link to="/initiatives">Zum Vorhaben-Katalog</Link>
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<p className="muted plan-portfolio__hint">
|
||||
Schnellstart — Vorhaben öffnen:
|
||||
</p>
|
||||
<ul className="scope-picker__list">
|
||||
{initiatives.map((item) => (
|
||||
<li key={item.id}>
|
||||
<Link
|
||||
to={scopedPath('/plan/profile', { initiativeId: item.id })}
|
||||
className="scope-picker__link"
|
||||
onClick={() => applyFromInitiative(item.id)}
|
||||
>
|
||||
{item.title}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
|
||||
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
|
||||
import { StatusBadge } from '../../components/StatusBadge.jsx'
|
||||
import { LoadingState } from '../../components/LoadingState.jsx'
|
||||
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
|
||||
|
||||
function PlanProfileInner() {
|
||||
const ops = useInitiativeOperations()
|
||||
const { initiative, loading, error } = ops
|
||||
|
||||
if (loading) {
|
||||
return <LoadingState message="Lade Profil …" />
|
||||
}
|
||||
|
||||
if (!initiative) {
|
||||
return <p className="muted">Vorhaben nicht gefunden.</p>
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card plan-profile">
|
||||
<header className="plan-profile__header">
|
||||
<h2 className="card-title">{initiative.title}</h2>
|
||||
<StatusBadge kind="initiative" status={initiative.status} />
|
||||
</header>
|
||||
{error && <p className="error">{error}</p>}
|
||||
{initiative.goal ? (
|
||||
<div className="plan-profile__field">
|
||||
<h3 className="plan-profile__label">Ziel</h3>
|
||||
<p>{initiative.goal}</p>
|
||||
</div>
|
||||
) : (
|
||||
<p className="muted">
|
||||
Noch kein Ziel hinterlegt — vollständiges Profil folgt mit Archetypen (AP1.10).
|
||||
</p>
|
||||
)}
|
||||
<p className="muted plan-profile__note">
|
||||
Bearbeitung per Modal kommt in AP1.10 (Entity Field System).
|
||||
</p>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
export function PlanProfilePage() {
|
||||
return (
|
||||
<RequireInitiativeScope lead="Das Vorhabens-Profil gehört zu einem gewählten Scope.">
|
||||
<ScopedInitiativeProvider>
|
||||
<PlanProfileInner />
|
||||
</ScopedInitiativeProvider>
|
||||
</RequireInitiativeScope>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user