AP1.6: Plan/Ist-Verknuepfung und Journey-Timeline.
Deploy Development / deploy (push) Failing after 37s
Test Suite / pytest-backend (push) Successful in 1m41s
Test Suite / lint-backend (push) Successful in 1s
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

Backlog, Actions, Projects und Tasks koennen Gates zugeordnet werden; Gate-Beitragsliste und chronologische Journey machen Plan/Ist nachvollziehbar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-06 08:43:11 +02:00
1 parent 4ca0a2c460
commit 7e4936a2e4
29 files changed
+1072 -40

No files matched your search

+7
View File
@@ -1,6 +1,7 @@
import { ACTION_STATUSES, PRIORITIES } from '../constants/status.js'
import { ACTION_STATUS_LABELS, PRIORITY_LABELS } from '../constants/status.js'
import { ActorSelect } from './ActorSelect.jsx'
import { GateSelect } from './GateSelect.jsx'
import { flattenLeafProjectOptions, getLeafProjects } from '../utils/projectTree.js'
function isoToLocalInput(iso) {
@@ -13,6 +14,7 @@ function isoToLocalInput(iso) {
export function ActionForm({
initial = {},
projects = [],
roadmapItems = [],
actors = [],
actorsLoading = false,
actorsError = null,
@@ -34,6 +36,7 @@ export function ActionForm({
priority: form.priority.value,
due_at: form.due_at.value ? new Date(form.due_at.value).toISOString() : null,
project_id: form.project_id?.value || undefined,
roadmap_item_id: form.roadmap_item_id?.value || undefined,
assigned_actor_ids: selected,
})
}
@@ -93,6 +96,10 @@ export function ActionForm({
</select>
</label>
)}
<GateSelect
roadmapItems={roadmapItems}
defaultValue={initial.roadmap_item_id || ''}
/>
<ActorSelect
actors={actors}
defaultSelected={defaultActors}
@@ -3,6 +3,7 @@ import { ACTION_STATUSES, ACTION_STATUS_LABELS } from '../constants/status.js'
import { StatusBadge } from './StatusBadge.jsx'
import { PriorityBadge } from './PriorityBadge.jsx'
import { ActionForm } from './ActionForm.jsx'
import { gateTitleById } from './GateSelect.jsx'
function formatDue(iso) {
if (!iso) return null
@@ -51,6 +52,8 @@ export function ActionHubCard({
actorsUsedFallback,
onReloadActors,
initiativeId,
projects = [],
roadmapItems = [],
detailMode = false,
}) {
const due = formatDue(action.due_at)
@@ -61,6 +64,8 @@ export function ActionHubCard({
<article className="action-hub-card action-hub-card--editing">
<ActionForm
initial={action}
projects={projects}
roadmapItems={roadmapItems}
actors={actors}
actorsLoading={actorsLoading}
actorsError={actorsError}
@@ -91,6 +96,9 @@ export function ActionHubCard({
<p className="action-hub-card-desc">{action.description}</p>
)}
<div className="action-hub-card-meta muted">
{action.roadmap_item_id && (
<span>Gate: {gateTitleById(roadmapItems, action.roadmap_item_id) || '…'}</span>
)}
{action.assigned_actor_ids?.length > 0 && (
<span>{action.assigned_actor_ids.length} zugewiesen</span>
)}
+43 -1
View File
@@ -7,23 +7,32 @@ import { StatusBadge } from './StatusBadge.jsx'
import { PriorityBadge } from './PriorityBadge.jsx'
import { EmptyState } from './EmptyState.jsx'
import { GateSelect, gateTitleById } from './GateSelect.jsx'
export function BacklogSection({
items,
roadmapItems = [],
canManage,
onCreate,
onUpdateGate,
onUpdateStatus,
onConvert,
onDelete,
busy,
}) {
const [title, setTitle] = useState('')
const [gateId, setGateId] = useState('')
const [showForm, setShowForm] = useState(false)
async function handleSubmit(e) {
e.preventDefault()
if (!title.trim()) return
await onCreate({ title: title.trim() })
await onCreate({
title: title.trim(),
roadmap_item_id: gateId || undefined,
})
setTitle('')
setGateId('')
setShowForm(false)
}
@@ -53,6 +62,19 @@ export function BacklogSection({
required
/>
</label>
{roadmapItems.length > 0 && (
<label>
Zielzustand (Gate)
<select value={gateId} onChange={(e) => setGateId(e.target.value)}>
<option value="">— keins —</option>
{roadmapItems.map((item) => (
<option key={item.id} value={item.id}>
{item.title}
</option>
))}
</select>
</label>
)}
<button type="submit" className="btn btn-primary" disabled={busy}>
Anlegen
</button>
@@ -69,10 +91,30 @@ export function BacklogSection({
{item.description && (
<p className="list-item-desc">{item.description}</p>
)}
{item.roadmap_item_id && (
<p className="list-item-sub muted">
Gate: {gateTitleById(roadmapItems, item.roadmap_item_id) || item.roadmap_item_id}
</p>
)}
</div>
<div className="list-item-meta action-controls">
<StatusBadge kind="backlog" status={item.status} />
<PriorityBadge priority={item.priority} />
{canManage && item.status !== 'converted' && roadmapItems.length > 0 && (
<select
className="inline-select"
value={item.roadmap_item_id || ''}
onChange={(e) => onUpdateGate(item.id, e.target.value)}
aria-label="Gate-Zuordnung"
>
<option value="">Gate …</option>
{roadmapItems.map((gate) => (
<option key={gate.id} value={gate.id}>
{gate.title}
</option>
))}
</select>
)}
{canManage && item.status !== 'converted' && (
<>
<select
@@ -0,0 +1,93 @@
import { Link } from 'react-router-dom'
export function GateContributionsSection({ contributions, initiativeId, loading, error }) {
if (loading) return <p className="muted">Ist-Beiträge werden geladen…</p>
if (error) return <p className="error">{error}</p>
if (!contributions) return null
const { counts } = contributions
if (counts.total === 0) {
return (
<section className="card gate-contributions">
<h2>Ist-Beiträge</h2>
<p className="section-lead muted">
Noch keine Verknüpfung — ordne Backlog, Projekte, Arbeitspakete oder Aufgaben diesem Gate zu.
</p>
</section>
)
}
return (
<section className="card gate-contributions">
<h2>Ist-Beiträge</h2>
<p className="section-lead muted">
Operative Arbeit, die auf diesen Zielzustand einzahlt ({counts.total} Verknüpfung
{counts.total === 1 ? '' : 'en'}).
</p>
<div className="gate-contributions-grid">
{contributions.actions?.length > 0 && (
<div>
<h3>Arbeitspakete</h3>
<ul className="item-list compact-list">
{contributions.actions.map((item) => (
<li key={item.id}>
<Link
to={`/initiatives/${initiativeId}/actions/${item.id}`}
className="link-button"
>
{item.title}
</Link>
<span className="muted"> — {item.status}</span>
</li>
))}
</ul>
</div>
)}
{contributions.backlog_items?.length > 0 && (
<div>
<h3>Backlog</h3>
<ul className="item-list compact-list">
{contributions.backlog_items.map((item) => (
<li key={item.id}>
{item.title}
<span className="muted"> — {item.status}</span>
</li>
))}
</ul>
</div>
)}
{contributions.projects?.length > 0 && (
<div>
<h3>Projekte</h3>
<ul className="item-list compact-list">
{contributions.projects.map((item) => (
<li key={item.id}>
{item.title}
<span className="muted"> — {item.status}</span>
</li>
))}
</ul>
</div>
)}
{contributions.tasks?.length > 0 && (
<div>
<h3>Aufgaben</h3>
<ul className="item-list compact-list">
{contributions.tasks.map((item) => (
<li key={item.id}>
<Link
to={`/initiatives/${initiativeId}/actions/${item.action_id}`}
className="link-button"
>
{item.title}
</Link>
<span className="muted"> ({item.action_title})</span>
</li>
))}
</ul>
</div>
)}
</div>
</section>
)
}
+28
View File
@@ -0,0 +1,28 @@
export function GateSelect({
roadmapItems = [],
name = 'roadmap_item_id',
defaultValue = '',
label = 'Zielzustand (Gate)',
allowEmpty = true,
}) {
if (roadmapItems.length === 0) return null
return (
<label>
{label}
<select name={name} defaultValue={defaultValue || ''}>
{allowEmpty && <option value="">— keins —</option>}
{roadmapItems.map((item) => (
<option key={item.id} value={item.id}>
{item.title}
</option>
))}
</select>
</label>
)
}
export function gateTitleById(roadmapItems, gateId) {
if (!gateId) return null
return roadmapItems.find((item) => item.id === gateId)?.title || null
}
@@ -6,6 +6,7 @@ export function InitiativeActionsHub({
initiativeId,
actions,
projects = [],
roadmapItems = [],
actionContextById,
hideDone,
onHideDoneChange,
@@ -62,6 +63,7 @@ export function InitiativeActionsHub({
<div className="inline-form-block">
<ActionForm
projects={projects}
roadmapItems={roadmapItems}
actors={actors}
actorsLoading={actorsLoading}
actorsError={actorsError}
@@ -100,6 +102,8 @@ export function InitiativeActionsHub({
actorsUsedFallback={actorsUsedFallback}
onReloadActors={onReloadActors}
initiativeId={initiativeId}
projects={projects}
roadmapItems={roadmapItems}
/>
))}
</div>
@@ -0,0 +1,71 @@
import { Link } from 'react-router-dom'
const KIND_LABELS = {
decision: 'Entscheidung',
review: 'Review',
evidence: 'Nachweis',
action: 'Arbeitspaket',
backlog: 'Backlog',
gate: 'Zielzustand',
}
function formatWhen(iso) {
if (!iso) return ''
try {
return new Date(iso).toLocaleString('de-DE', {
dateStyle: 'medium',
timeStyle: 'short',
})
} catch {
return iso
}
}
export function JourneyTimeline({ events, initiativeId, roadmapItems = [] }) {
if (!events?.length) {
return <p className="muted">Noch keine Journey-Einträge — Entscheidungen, Nachweise und committete Arbeit erscheinen hier.</p>
}
const gateTitles = Object.fromEntries(roadmapItems.map((item) => [item.id, item.title]))
return (
<ol className="journey-timeline">
{events.map((event, index) => (
<li key={`${event.kind}-${event.entity_id}-${index}`} className="journey-event card-list-item">
<div className="journey-event-meta muted">
<span className="journey-event-kind">{KIND_LABELS[event.kind] || event.kind}</span>
<time dateTime={event.occurred_at}>{formatWhen(event.occurred_at)}</time>
</div>
<strong>{event.title}</strong>
{event.summary && <p className="list-item-desc muted">{event.summary}</p>}
<div className="journey-event-links">
{event.roadmap_item_id && gateTitles[event.roadmap_item_id] && (
<Link
to={`/initiatives/${initiativeId}/plan/items/${event.roadmap_item_id}`}
className="link-button"
>
Gate: {gateTitles[event.roadmap_item_id]}
</Link>
)}
{event.kind === 'action' && (
<Link
to={`/initiatives/${initiativeId}/actions/${event.entity_id}`}
className="link-button"
>
Arbeitspaket öffnen
</Link>
)}
{event.kind === 'gate' && (
<Link
to={`/initiatives/${initiativeId}/plan/items/${event.entity_id}`}
className="link-button"
>
Gate öffnen
</Link>
)}
</div>
</li>
))}
</ol>
)
}
@@ -6,9 +6,11 @@ import {
containerKindLabel,
flattenProjectOptions,
} from '../utils/projectTree.js'
import { GateSelect, gateTitleById } from './GateSelect.jsx'
function ProjectTreeNodes({
projects,
roadmapItems,
parentId,
depth,
selectedProjectId,
@@ -42,6 +44,11 @@ function ProjectTreeNodes({
{containerKindLabel(project.container_kind)}
</span>
)}
{project.roadmap_item_id && (
<span className="project-kind-badge muted">
Gate: {gateTitleById(roadmapItems, project.roadmap_item_id)}
</span>
)}
{project.description && (
<p className="list-item-desc muted">{project.description}</p>
)}
@@ -62,6 +69,7 @@ function ProjectTreeNodes({
</div>
<ProjectTreeNodes
projects={projects}
roadmapItems={roadmapItems}
parentId={project.id}
depth={depth + 1}
selectedProjectId={selectedProjectId}
@@ -78,6 +86,7 @@ function ProjectTreeNodes({
export function ProjectsSection({
projects,
roadmapItems = [],
selectedProjectId,
onSelectProject,
canManage,
@@ -89,6 +98,7 @@ export function ProjectsSection({
const [description, setDescription] = useState('')
const [parentProjectId, setParentProjectId] = useState('')
const [containerKind, setContainerKind] = useState('')
const [gateId, setGateId] = useState('')
const [showForm, setShowForm] = useState(false)
const parentOptions = useMemo(
@@ -104,11 +114,13 @@ export function ProjectsSection({
description: description.trim(),
parent_project_id: parentProjectId || undefined,
container_kind: containerKind || undefined,
roadmap_item_id: gateId || undefined,
})
setTitle('')
setDescription('')
setParentProjectId('')
setContainerKind('')
setGateId('')
setShowForm(false)
}
@@ -195,6 +207,19 @@ export function ProjectsSection({
<option value="release">Release</option>
</select>
</label>
{roadmapItems.length > 0 && (
<label>
Zielzustand (Gate)
<select value={gateId} onChange={(e) => setGateId(e.target.value)}>
<option value="">— keins —</option>
{roadmapItems.map((item) => (
<option key={item.id} value={item.id}>
{item.title}
</option>
))}
</select>
</label>
)}
<button type="submit" className="btn btn-primary" disabled={busy}>
Anlegen
</button>
@@ -218,6 +243,7 @@ export function ProjectsSection({
</ul>
<ProjectTreeNodes
projects={projects}
roadmapItems={roadmapItems}
parentId=""
depth={1}
selectedProjectId={selectedProjectId}
+58 -3
View File
@@ -7,13 +7,15 @@ import {
} from '../api/tasks.js'
import { TASK_STATUSES, TASK_STATUS_LABELS } from '../constants/status.js'
import { EmptyState } from './EmptyState.jsx'
import { gateTitleById } from './GateSelect.jsx'
export function TasksSection({ actionId, canManage }) {
export function TasksSection({ actionId, canManage, roadmapItems = [] }) {
const [tasks, setTasks] = useState([])
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
const [busy, setBusy] = useState(false)
const [title, setTitle] = useState('')
const [gateId, setGateId] = useState('')
const load = useCallback(async () => {
if (!actionId) return
@@ -37,8 +39,12 @@ export function TasksSection({ actionId, canManage }) {
if (!title.trim()) return
setBusy(true)
try {
await createActionTask(actionId, { title: title.trim() })
await createActionTask(actionId, {
title: title.trim(),
roadmap_item_id: gateId || undefined,
})
setTitle('')
setGateId('')
await load()
} catch (err) {
setError(err.message)
@@ -59,6 +65,21 @@ export function TasksSection({ actionId, canManage }) {
}
}
async function handleGate(taskId, roadmapItemId) {
setBusy(true)
try {
await updateTask(taskId, {
roadmap_item_id: roadmapItemId || undefined,
clear_roadmap_item: !roadmapItemId,
})
await load()
} catch (err) {
setError(err.message)
} finally {
setBusy(false)
}
}
async function handleDelete(taskId) {
setBusy(true)
try {
@@ -79,7 +100,7 @@ export function TasksSection({ actionId, canManage }) {
<div>
<h3>Aufgaben</h3>
<p className="section-lead muted">
Kleinste ausführbare Schritte — später Zuordnung zu Gates (Zielerreichung).
Kleinste ausführbare Schritte — optional einem Zielzustand (Gate) zugeordnet.
</p>
</div>
</div>
@@ -98,6 +119,19 @@ export function TasksSection({ actionId, canManage }) {
placeholder="Konkreter nächster Schritt"
/>
</label>
{roadmapItems.length > 0 && (
<label>
Gate (optional)
<select value={gateId} onChange={(e) => setGateId(e.target.value)}>
<option value="">— keins —</option>
{roadmapItems.map((item) => (
<option key={item.id} value={item.id}>
{item.title}
</option>
))}
</select>
</label>
)}
<button type="submit" className="btn btn-primary" disabled={busy}>
Hinzufügen
</button>
@@ -113,8 +147,29 @@ export function TasksSection({ actionId, canManage }) {
<li key={task.id} className="list-item card-list-item">
<div className="list-item-main">
<strong>{task.title}</strong>
{task.roadmap_item_id && (
<p className="list-item-sub muted">
Gate: {gateTitleById(roadmapItems, task.roadmap_item_id)}
</p>
)}
</div>
<div className="list-item-meta action-controls">
{canManage && roadmapItems.length > 0 && (
<select
className="inline-select"
value={task.roadmap_item_id || ''}
disabled={busy}
onChange={(e) => handleGate(task.id, e.target.value)}
aria-label="Gate-Zuordnung"
>
<option value="">Gate …</option>
{roadmapItems.map((gate) => (
<option key={gate.id} value={gate.id}>
{gate.title}
</option>
))}
</select>
)}
{canManage ? (
<select
className="inline-select"