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
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:
1 parent
4ca0a2c460
commit
7e4936a2e4
29 files changed
+1072
-40
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { apiFetch } from './client.js'
|
||||
|
||||
export function listInitiativeJourney(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/journey`)
|
||||
}
|
||||
|
||||
export function listGateContributions(roadmapItemId) {
|
||||
return apiFetch(`/api/roadmap-items/${roadmapItemId}/contributions`)
|
||||
}
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -233,6 +233,8 @@ export function InitiativeOperationsProvider({ children }) {
|
||||
clear_due_at: !payload.due_at,
|
||||
project_id: payload.project_id,
|
||||
clear_project: payload.project_id === '' || payload.project_id === null,
|
||||
roadmap_item_id: payload.roadmap_item_id || undefined,
|
||||
clear_roadmap_item: payload.roadmap_item_id === '' || payload.roadmap_item_id === null,
|
||||
})
|
||||
if (capabilities.has('kairo.action.manage')) {
|
||||
await setActionAssignments(actionId, payload.assigned_actor_ids || [])
|
||||
@@ -315,6 +317,18 @@ export function InitiativeOperationsProvider({ children }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBacklogGate(itemId, roadmapItemId) {
|
||||
try {
|
||||
await updateBacklogItem(itemId, {
|
||||
roadmap_item_id: roadmapItemId || undefined,
|
||||
clear_roadmap_item: !roadmapItemId,
|
||||
})
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleBacklogStatus(itemId, status) {
|
||||
try {
|
||||
await updateBacklogItem(itemId, { status })
|
||||
@@ -609,6 +623,7 @@ export function InitiativeOperationsProvider({ children }) {
|
||||
handleBlockerStatus,
|
||||
handleDeleteBlocker,
|
||||
handleCreateBacklog,
|
||||
handleBacklogGate,
|
||||
handleBacklogStatus,
|
||||
handleConvertBacklog,
|
||||
handleDeleteBacklog,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Link, useParams } from 'react-router-dom'
|
||||
import { getAction } from '../api/actions.js'
|
||||
import { getInitiativeSteeringSnapshot } from '../api/initiatives.js'
|
||||
import { listInitiativeProjects } from '../api/projects.js'
|
||||
import { listInitiativeRoadmapItems } from '../api/roadmap.js'
|
||||
import { updateAction, setActionAssignments } from '../api/actions.js'
|
||||
import { createInitiativeBlocker } from '../api/blockers.js'
|
||||
import { ActionHubCard } from '../components/ActionHubCard.jsx'
|
||||
@@ -27,12 +28,14 @@ function ActionDetailBody({
|
||||
capabilities,
|
||||
actorsState,
|
||||
projects = [],
|
||||
roadmapItems = [],
|
||||
}) {
|
||||
if (editing) {
|
||||
return (
|
||||
<ActionForm
|
||||
initial={action}
|
||||
projects={projects}
|
||||
roadmapItems={roadmapItems}
|
||||
actors={actorsState.actors}
|
||||
actorsLoading={actorsState.loading}
|
||||
actorsError={actorsState.error}
|
||||
@@ -70,6 +73,7 @@ function ActionDetailBody({
|
||||
<TasksSection
|
||||
actionId={action.id}
|
||||
canManage={capabilities.has('kairo.action.manage')}
|
||||
roadmapItems={roadmapItems}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
@@ -81,6 +85,7 @@ function ActionDetailStandalone() {
|
||||
const actorsState = useActors()
|
||||
const [action, setAction] = useState(null)
|
||||
const [projects, setProjects] = useState([])
|
||||
const [roadmapItems, setRoadmapItems] = useState([])
|
||||
const [context, setContext] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
@@ -93,11 +98,13 @@ function ActionDetailStandalone() {
|
||||
try {
|
||||
const actionData = await getAction(actionId)
|
||||
setAction(actionData)
|
||||
const [snap, projectData] = await Promise.all([
|
||||
const [snap, projectData, roadmapData] = await Promise.all([
|
||||
getInitiativeSteeringSnapshot(actionData.initiative_id),
|
||||
listInitiativeProjects(actionData.initiative_id).catch(() => []),
|
||||
listInitiativeRoadmapItems(actionData.initiative_id).catch(() => []),
|
||||
])
|
||||
setProjects(projectData)
|
||||
setRoadmapItems(roadmapData)
|
||||
setContext((snap.actions || []).find((a) => a.id === actionId) || null)
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
@@ -120,6 +127,10 @@ function ActionDetailStandalone() {
|
||||
priority: payload.priority,
|
||||
due_at: payload.due_at,
|
||||
clear_due_at: !payload.due_at,
|
||||
project_id: payload.project_id,
|
||||
clear_project: payload.project_id === '' || payload.project_id === null,
|
||||
roadmap_item_id: payload.roadmap_item_id,
|
||||
clear_roadmap_item: payload.roadmap_item_id === '' || payload.roadmap_item_id === null,
|
||||
})
|
||||
if (capabilities.has('kairo.action.manage')) {
|
||||
await setActionAssignments(action.id, payload.assigned_actor_ids || [])
|
||||
@@ -204,6 +215,7 @@ function ActionDetailStandalone() {
|
||||
capabilities={capabilities}
|
||||
actorsState={actorsState}
|
||||
projects={projects}
|
||||
roadmapItems={roadmapItems}
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
@@ -245,6 +257,7 @@ function ActionDetailNested() {
|
||||
reload: ops.reloadActors,
|
||||
}}
|
||||
projects={ops.projects}
|
||||
roadmapItems={ops.roadmapItems}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ export function InitiativeExecutionPage() {
|
||||
const {
|
||||
visibleActions,
|
||||
projects,
|
||||
roadmapItems,
|
||||
selectedProjectId,
|
||||
setSelectedProjectId,
|
||||
actionContextById,
|
||||
@@ -22,6 +23,7 @@ export function InitiativeExecutionPage() {
|
||||
unlinkedBlockers,
|
||||
initiativeId,
|
||||
error,
|
||||
roadmapItems,
|
||||
} = ops
|
||||
|
||||
return (
|
||||
@@ -30,6 +32,7 @@ export function InitiativeExecutionPage() {
|
||||
|
||||
<ProjectsSection
|
||||
projects={projects}
|
||||
roadmapItems={roadmapItems}
|
||||
selectedProjectId={selectedProjectId}
|
||||
onSelectProject={setSelectedProjectId}
|
||||
canManage={capabilities.has('kairo.project.manage')}
|
||||
@@ -42,6 +45,7 @@ export function InitiativeExecutionPage() {
|
||||
initiativeId={initiativeId}
|
||||
actions={visibleActions}
|
||||
projects={projects}
|
||||
roadmapItems={roadmapItems}
|
||||
actionContextById={actionContextById}
|
||||
hideDone={hideDone}
|
||||
onHideDoneChange={setHideDone}
|
||||
|
||||
@@ -4,10 +4,12 @@ import { BacklogSection } from '../../components/BacklogSection.jsx'
|
||||
export function InitiativeInboxPage() {
|
||||
const {
|
||||
backlogItems,
|
||||
roadmapItems,
|
||||
capabilities,
|
||||
formBusy,
|
||||
error,
|
||||
handleCreateBacklog,
|
||||
handleBacklogGate,
|
||||
handleBacklogStatus,
|
||||
handleConvertBacklog,
|
||||
handleDeleteBacklog,
|
||||
@@ -22,8 +24,10 @@ export function InitiativeInboxPage() {
|
||||
{error && <p className="error">{error}</p>}
|
||||
<BacklogSection
|
||||
items={backlogItems}
|
||||
roadmapItems={roadmapItems}
|
||||
canManage={capabilities.has('kairo.backlog.manage')}
|
||||
onCreate={handleCreateBacklog}
|
||||
onUpdateGate={handleBacklogGate}
|
||||
onUpdateStatus={handleBacklogStatus}
|
||||
onConvert={handleConvertBacklog}
|
||||
onDelete={handleDeleteBacklog}
|
||||
|
||||
@@ -1,12 +1,36 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
|
||||
import { listInitiativeJourney } from '../../api/journey.js'
|
||||
import { DecisionsSection } from '../../components/DecisionsSection.jsx'
|
||||
import { ReviewsSection } from '../../components/ReviewsSection.jsx'
|
||||
import { RecurringSection } from '../../components/RecurringSection.jsx'
|
||||
import { EvidenceSection } from '../../components/EvidenceSection.jsx'
|
||||
import { JourneyTimeline } from '../../components/JourneyTimeline.jsx'
|
||||
|
||||
export function InitiativeJourneyPage() {
|
||||
const ops = useInitiativeOperations()
|
||||
const { capabilities, error, formBusy } = ops
|
||||
const { id, capabilities, error, formBusy, roadmapItems } = ops
|
||||
const [journeyEvents, setJourneyEvents] = useState([])
|
||||
const [journeyLoading, setJourneyLoading] = useState(true)
|
||||
const [journeyError, setJourneyError] = useState(null)
|
||||
|
||||
const loadJourney = useCallback(async () => {
|
||||
if (!id) return
|
||||
setJourneyLoading(true)
|
||||
setJourneyError(null)
|
||||
try {
|
||||
const data = await listInitiativeJourney(id)
|
||||
setJourneyEvents(data.events || [])
|
||||
} catch (err) {
|
||||
setJourneyError(err.message)
|
||||
} finally {
|
||||
setJourneyLoading(false)
|
||||
}
|
||||
}, [id])
|
||||
|
||||
useEffect(() => {
|
||||
loadJourney()
|
||||
}, [loadJourney, ops.decisions, ops.reviews, ops.evidenceItems, ops.actions])
|
||||
|
||||
if (!capabilities.has('kairo.initiative.read')) {
|
||||
return null
|
||||
@@ -15,9 +39,25 @@ export function InitiativeJourneyPage() {
|
||||
return (
|
||||
<>
|
||||
{error && <p className="error">{error}</p>}
|
||||
<p className="section-lead muted initiative-journey-lead">
|
||||
Entscheidungen, Reviews und Nachweise — die Reise-Timeline folgt in AP1.6.
|
||||
</p>
|
||||
|
||||
<section className="card journey-timeline-section">
|
||||
<h2>Journey</h2>
|
||||
<p className="section-lead muted">
|
||||
Chronologie aus Entscheidungen, Nachweisen, committeter Arbeit und Zielzuständen — Plan/Ist
|
||||
nachvollziehbar.
|
||||
</p>
|
||||
{journeyError && <p className="error">{journeyError}</p>}
|
||||
{journeyLoading ? (
|
||||
<p className="muted">Timeline wird geladen…</p>
|
||||
) : (
|
||||
<JourneyTimeline
|
||||
events={journeyEvents}
|
||||
initiativeId={id}
|
||||
roadmapItems={roadmapItems}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
|
||||
<div className="initiative-journey-stack">
|
||||
<DecisionsSection
|
||||
items={ops.decisions}
|
||||
|
||||
@@ -25,6 +25,8 @@ import {
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
} from '../../constants/status.js'
|
||||
import { useCapabilities } from '../../hooks/useCapabilities.js'
|
||||
import { listGateContributions } from '../../api/journey.js'
|
||||
import { GateContributionsSection } from '../../components/GateContributionsSection.jsx'
|
||||
|
||||
function CriterionDecisionForm({ label, onSubmit, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
@@ -85,6 +87,21 @@ export function RoadmapItemDetailPage() {
|
||||
const [newKind, setNewKind] = useState('manual')
|
||||
const [expandedDecision, setExpandedDecision] = useState(null)
|
||||
const [reopenReason, setReopenReason] = useState('')
|
||||
const [contributions, setContributions] = useState(null)
|
||||
const [contributionsLoading, setContributionsLoading] = useState(true)
|
||||
const [contributionsError, setContributionsError] = useState(null)
|
||||
|
||||
const loadContributions = useCallback(async () => {
|
||||
setContributionsLoading(true)
|
||||
setContributionsError(null)
|
||||
try {
|
||||
setContributions(await listGateContributions(itemId))
|
||||
} catch (err) {
|
||||
setContributionsError(err.message)
|
||||
} finally {
|
||||
setContributionsLoading(false)
|
||||
}
|
||||
}, [itemId])
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true)
|
||||
@@ -108,6 +125,10 @@ export function RoadmapItemDetailPage() {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
useEffect(() => {
|
||||
loadContributions()
|
||||
}, [loadContributions])
|
||||
|
||||
async function runAction(fn) {
|
||||
setBusy(true)
|
||||
setError(null)
|
||||
@@ -155,6 +176,13 @@ export function RoadmapItemDetailPage() {
|
||||
Checkliste: {closedCount}/{totalCount} Kriterien abgeschlossen
|
||||
</p>
|
||||
|
||||
<GateContributionsSection
|
||||
contributions={contributions}
|
||||
initiativeId={initiativeId}
|
||||
loading={contributionsLoading}
|
||||
error={contributionsError}
|
||||
/>
|
||||
|
||||
<ul className="item-list criterion-list">
|
||||
{criteria.map((crit) => (
|
||||
<li key={crit.id} className="list-item card-list-item">
|
||||
|
||||
@@ -458,6 +458,49 @@
|
||||
margin-left: 0.35rem;
|
||||
}
|
||||
|
||||
.journey-timeline {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.journey-event {
|
||||
padding: 0.85rem 1rem;
|
||||
}
|
||||
|
||||
.journey-event-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem 1rem;
|
||||
font-size: 0.85rem;
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.journey-event-kind {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.journey-event-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.gate-contributions-grid {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.gate-contributions-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
}
|
||||
|
||||
.section-header h2 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
|
||||
Reference in new issue
Block a user