AP1.4d: Graph Engine mit blocked/ready Read Models.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 2m17s
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 2m17s
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
Migration 020 fuer Kantenarten und Parallelgruppe; steering/graph berechnet Fortschritt; UI zeigt Bereit/Blockiert in Liste und Graph. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bd64340ca1
commit
4f8725e234
15 files changed
+488
-84
No files matched your search
@@ -12,6 +12,10 @@ export function listInitiativeRoadmapCriteriaProgress(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/roadmap/criteria-progress`)
|
||||
}
|
||||
|
||||
export function listInitiativeRoadmapGraphState(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/roadmap/graph-state`)
|
||||
}
|
||||
|
||||
export function createInitiativeRoadmapItem(initiativeId, body) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/roadmap/items`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -6,6 +6,8 @@ const DEPENDENCY_TYPE_LABELS = {
|
||||
requires: 'Voraussetzung',
|
||||
blocks: 'Blockiert',
|
||||
related: 'Bezug',
|
||||
parallel_group: 'Parallelgruppe',
|
||||
optional_branch: 'Optional',
|
||||
}
|
||||
|
||||
const OUTGOING_PHRASES = {
|
||||
@@ -56,6 +58,7 @@ function DependencyRow({ dep, itemId, siblingItems, direction, canManage, busy,
|
||||
</p>
|
||||
<p className="muted list-item-sub">
|
||||
{DEPENDENCY_TYPE_LABELS[dep.dependency_type] || dep.dependency_type}
|
||||
{dep.group_key ? ` · Gruppe ${dep.group_key}` : ''}
|
||||
</p>
|
||||
</div>
|
||||
{canManage && (
|
||||
@@ -92,11 +95,17 @@ export function GateDependenciesSection({
|
||||
const form = event.target
|
||||
const toItemId = form.to_item_id.value
|
||||
const dependencyType = form.dependency_type.value
|
||||
const groupKey = form.group_key?.value?.trim()
|
||||
if (!toItemId) return
|
||||
await onAdd({
|
||||
const body = {
|
||||
to_item_id: toItemId,
|
||||
dependency_type: dependencyType,
|
||||
})
|
||||
}
|
||||
if (dependencyType === 'parallel_group') {
|
||||
if (!groupKey) return
|
||||
body.group_key = groupKey
|
||||
}
|
||||
await onAdd(body)
|
||||
form.reset()
|
||||
}
|
||||
|
||||
@@ -169,9 +178,20 @@ export function GateDependenciesSection({
|
||||
<select name="dependency_type" defaultValue="requires">
|
||||
<option value="requires">benötigt (Voraussetzung)</option>
|
||||
<option value="blocks">blockiert</option>
|
||||
<option value="parallel_group">Parallelgruppe</option>
|
||||
<option value="optional_branch">optionaler Zweig</option>
|
||||
<option value="related">steht in Bezug zu</option>
|
||||
</select>
|
||||
</label>
|
||||
<label className="gate-dependency-form__group-key">
|
||||
Parallelgruppe (Schlüssel)
|
||||
<input
|
||||
name="group_key"
|
||||
maxLength={128}
|
||||
placeholder="z. B. phase-1"
|
||||
/>
|
||||
<span className="muted form-hint">Nur bei Kantenart „Parallelgruppe“.</span>
|
||||
</label>
|
||||
<label>
|
||||
Anderes Gate
|
||||
<select name="to_item_id" required defaultValue="">
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { gateTitleById } from './GateSelect.jsx'
|
||||
|
||||
export function GateGraphStateBadge({ graphState, itemId, siblingItems = [] }) {
|
||||
if (!graphState?.items?.[itemId]) return null
|
||||
|
||||
const { blocked, ready, blocked_by: blockedBy = [] } = graphState.items[itemId]
|
||||
|
||||
if (ready) {
|
||||
return <span className="status-pill status-pill--ready">Bereit</span>
|
||||
}
|
||||
|
||||
if (blocked) {
|
||||
const blockerTitle =
|
||||
blockedBy.length === 1 ? gateTitleById(siblingItems, blockedBy[0]) : null
|
||||
const title =
|
||||
blockerTitle != null
|
||||
? `Blockiert durch ${blockerTitle}`
|
||||
: `Blockiert (${blockedBy.length} Voraussetzungen)`
|
||||
return (
|
||||
<span className="status-pill status-pill--blocked" title={title}>
|
||||
Blockiert
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { listInitiativeRoadmapDependencies } from '../api/roadmap.js'
|
||||
import { listInitiativeRoadmapDependencies, listInitiativeRoadmapGraphState } from '../api/roadmap.js'
|
||||
import { ROADMAP_ITEM_TYPE_LABELS } from '../constants/status.js'
|
||||
import { gatePath } from '../utils/routes.js'
|
||||
import { computeGateGraphLayout } from '../plan/gateGraphLayout.js'
|
||||
@@ -21,28 +21,39 @@ function truncateTitle(title, max = 28) {
|
||||
export function GateMapView({ initiativeId, items }) {
|
||||
const navigate = useNavigate()
|
||||
const [dependencies, setDependencies] = useState([])
|
||||
const [graphState, setGraphState] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!initiativeId) {
|
||||
setDependencies([])
|
||||
setGraphState(null)
|
||||
setLoading(false)
|
||||
return undefined
|
||||
}
|
||||
let cancelled = false
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
listInitiativeRoadmapDependencies(initiativeId)
|
||||
.then((data) => {
|
||||
if (!cancelled) setDependencies(Array.isArray(data) ? data : [])
|
||||
})
|
||||
.catch((err) => {
|
||||
if (!cancelled) setError(err.message || 'Abhängigkeiten konnten nicht geladen werden.')
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setLoading(false)
|
||||
})
|
||||
Promise.allSettled([
|
||||
listInitiativeRoadmapDependencies(initiativeId),
|
||||
listInitiativeRoadmapGraphState(initiativeId),
|
||||
]).then(([depsResult, graphResult]) => {
|
||||
if (cancelled) return
|
||||
if (depsResult.status === 'fulfilled') {
|
||||
setDependencies(Array.isArray(depsResult.value) ? depsResult.value : [])
|
||||
} else {
|
||||
setError(
|
||||
depsResult.reason?.message || 'Abhängigkeiten konnten nicht geladen werden.',
|
||||
)
|
||||
}
|
||||
if (graphResult.status === 'fulfilled') {
|
||||
setGraphState(graphResult.value || null)
|
||||
} else {
|
||||
setGraphState(null)
|
||||
}
|
||||
setLoading(false)
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
@@ -140,10 +151,16 @@ export function GateMapView({ initiativeId, items }) {
|
||||
|
||||
{layout.nodes.map((node) => {
|
||||
const item = node.item
|
||||
const nodeGraph = graphState?.items?.[node.id]
|
||||
const nodeClass =
|
||||
'gate-map-view__node gate-map-view__node--' +
|
||||
(item.status || 'planned') +
|
||||
(nodeGraph?.blocked ? ' gate-map-view__node--blocked' : '') +
|
||||
(nodeGraph?.ready ? ' gate-map-view__node--ready' : '')
|
||||
return (
|
||||
<g
|
||||
key={node.id}
|
||||
className={`gate-map-view__node gate-map-view__node--${item.status || 'planned'}`}
|
||||
className={nodeClass}
|
||||
transform={`translate(${node.x}, ${node.y})`}
|
||||
role="link"
|
||||
tabIndex={0}
|
||||
|
||||
@@ -2,11 +2,9 @@ import {
|
||||
MILESTONE_STATUSES,
|
||||
MILESTONE_STATUS_LABELS,
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
SEQUENCING_MODE_LABELS,
|
||||
} from '../constants/status.js'
|
||||
|
||||
const ITEM_TYPES = ['milestone', 'review_gate', 'maturity_stage']
|
||||
const SEQUENCING_MODES = ['sequential', 'parallel', 'optional']
|
||||
const EDITABLE_STATUSES = MILESTONE_STATUSES.filter(
|
||||
(s) => !['reached', 'moved', 'discarded'].includes(s),
|
||||
)
|
||||
@@ -27,7 +25,7 @@ export function RoadmapItemForm({
|
||||
goal_description: form.goal_description.value.trim(),
|
||||
target_date: form.target_date.value || undefined,
|
||||
item_type: form.item_type.value,
|
||||
sequencing_mode: form.sequencing_mode.value,
|
||||
sequencing_mode: initial.sequencing_mode || 'sequential',
|
||||
}
|
||||
if (mode === 'create') {
|
||||
const initialCriterion = form.initial_criterion_title?.value?.trim()
|
||||
@@ -94,31 +92,19 @@ export function RoadmapItemForm({
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
<div className="form-row form-row--2">
|
||||
<label>
|
||||
Abfolge
|
||||
<select
|
||||
name="sequencing_mode"
|
||||
defaultValue={initial.sequencing_mode || 'sequential'}
|
||||
disabled={statusLocked}
|
||||
>
|
||||
{SEQUENCING_MODES.map((m) => (
|
||||
<option key={m} value={m}>
|
||||
{SEQUENCING_MODE_LABELS[m] || m}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Zieltermin
|
||||
<input
|
||||
type="date"
|
||||
name="target_date"
|
||||
defaultValue={initial.target_date || ''}
|
||||
disabled={statusLocked}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label>
|
||||
Zieltermin
|
||||
<input
|
||||
type="date"
|
||||
name="target_date"
|
||||
defaultValue={initial.target_date || ''}
|
||||
disabled={statusLocked}
|
||||
/>
|
||||
</label>
|
||||
<p className="muted form-hint">
|
||||
Reihenfolge und Parallelität steuerst du über Kanten auf der Gate-Detailseite — nicht mehr
|
||||
über ein Abfolge-Feld.
|
||||
</p>
|
||||
{mode === 'edit' && (
|
||||
<label>
|
||||
Status
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { gatePath } from '../utils/routes.js'
|
||||
import { listInitiativeRoadmapCriteriaProgress } from '../api/roadmap.js'
|
||||
import { listInitiativeRoadmapCriteriaProgress, listInitiativeRoadmapGraphState } from '../api/roadmap.js'
|
||||
import {
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
SEQUENCING_MODE_LABELS,
|
||||
} from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { GateGraphStateBadge } from './GateGraphStateBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
import { Modal } from './Modal.jsx'
|
||||
import { RoadmapItemForm } from './RoadmapItemForm.jsx'
|
||||
@@ -38,21 +38,32 @@ export function RoadmapPlanSection({
|
||||
const [dragItemId, setDragItemId] = useState('')
|
||||
const [dropTargetId, setDropTargetId] = useState('')
|
||||
const [criteriaProgress, setCriteriaProgress] = useState({})
|
||||
const [graphState, setGraphState] = useState(null)
|
||||
const isDesktop = useMinWidth(1024)
|
||||
const canReorder = canManage && typeof onReorder === 'function'
|
||||
|
||||
useEffect(() => {
|
||||
if (!initiativeId) {
|
||||
setCriteriaProgress({})
|
||||
setGraphState(null)
|
||||
return undefined
|
||||
}
|
||||
let cancelled = false
|
||||
listInitiativeRoadmapCriteriaProgress(initiativeId)
|
||||
.then((data) => {
|
||||
if (!cancelled) setCriteriaProgress(data || {})
|
||||
Promise.all([
|
||||
listInitiativeRoadmapCriteriaProgress(initiativeId),
|
||||
listInitiativeRoadmapGraphState(initiativeId),
|
||||
])
|
||||
.then(([progressData, graphData]) => {
|
||||
if (!cancelled) {
|
||||
setCriteriaProgress(progressData || {})
|
||||
setGraphState(graphData || null)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setCriteriaProgress({})
|
||||
if (!cancelled) {
|
||||
setCriteriaProgress({})
|
||||
setGraphState(null)
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
@@ -173,8 +184,6 @@ export function RoadmapPlanSection({
|
||||
</strong>
|
||||
<p className="muted list-item-sub">
|
||||
{ROADMAP_ITEM_TYPE_LABELS[item.item_type] || item.item_type}
|
||||
{' · '}
|
||||
{SEQUENCING_MODE_LABELS[item.sequencing_mode] || item.sequencing_mode}
|
||||
</p>
|
||||
{item.goal_description && (
|
||||
<p className="list-item-desc">{item.goal_description}</p>
|
||||
@@ -190,6 +199,11 @@ export function RoadmapPlanSection({
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="milestone" status={item.status} />
|
||||
<GateGraphStateBadge
|
||||
graphState={graphState}
|
||||
itemId={item.id}
|
||||
siblingItems={sortedItems}
|
||||
/>
|
||||
{canReorder && !isDesktop && (
|
||||
<ReorderControls
|
||||
itemId={item.id}
|
||||
|
||||
@@ -18,7 +18,6 @@ import { StatusBadge } from '../../components/StatusBadge.jsx'
|
||||
import {
|
||||
MILESTONE_STATUS_LABELS,
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
SEQUENCING_MODE_LABELS,
|
||||
} from '../../constants/status.js'
|
||||
import { useCapabilities } from '../../hooks/useCapabilities.js'
|
||||
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
|
||||
@@ -161,8 +160,6 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
{ROADMAP_ITEM_TYPE_LABELS[item.item_type] || item.item_type}
|
||||
{' · '}
|
||||
{MILESTONE_STATUS_LABELS[item.status] || item.status}
|
||||
{' · '}
|
||||
{SEQUENCING_MODE_LABELS[item.sequencing_mode] || item.sequencing_mode}
|
||||
</p>
|
||||
{item.goal_description && (
|
||||
<p className="roadmap-item-detail__goal-context">{item.goal_description}</p>
|
||||
|
||||
@@ -1765,6 +1765,38 @@
|
||||
fill: #f8fafc;
|
||||
}
|
||||
|
||||
.gate-map-view__node--ready .gate-map-view__node-box {
|
||||
stroke: #059669;
|
||||
stroke-dasharray: none;
|
||||
}
|
||||
|
||||
.gate-map-view__node--blocked .gate-map-view__node-box {
|
||||
stroke: #dc2626;
|
||||
fill: #fef2f2;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.status-pill {
|
||||
display: inline-block;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
background: var(--jk-surface-muted, #eef2f6);
|
||||
color: var(--jk-text-secondary, #445);
|
||||
}
|
||||
|
||||
.status-pill--ready {
|
||||
background: #ecfdf5;
|
||||
color: #047857;
|
||||
}
|
||||
|
||||
.status-pill--blocked {
|
||||
background: #fef2f2;
|
||||
color: #b91c1c;
|
||||
}
|
||||
|
||||
.gate-map-view__node-title {
|
||||
fill: var(--jk-text, #1a1a1a);
|
||||
font-size: 14px;
|
||||
|
||||
Reference in new issue
Block a user