AP1.4e: Methodenprofile am Gate-Graph.
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Failing after 2m18s
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 43s
Test Suite / pytest-backend (push) Failing after 2m18s
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
generic_operating ohne harte Blockade, Reifegrad-Methoden mit Erfuellungsgrad; Attention gate_graph_blocked fuer gate-orientierte Methoden. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4f8725e234
commit
1fa61b2dac
14 files changed
+426
-36
No files matched your search
@@ -0,0 +1,19 @@
|
||||
export function GateFulfillmentBadge({ graphState, itemId }) {
|
||||
const ratio = graphState?.items?.[itemId]?.fulfillment_ratio
|
||||
if (ratio == null) return null
|
||||
|
||||
const pct = Math.round(ratio * 100)
|
||||
const emphasize = graphState?.graph_profile?.emphasize_fulfillment
|
||||
|
||||
return (
|
||||
<span
|
||||
className={
|
||||
'status-pill status-pill--fulfillment' +
|
||||
(emphasize ? ' status-pill--fulfillment-primary' : '')
|
||||
}
|
||||
title="Kriterien erfüllt / gesamt"
|
||||
>
|
||||
{pct}% Kriterien
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -3,6 +3,10 @@ import { gateTitleById } from './GateSelect.jsx'
|
||||
export function GateGraphStateBadge({ graphState, itemId, siblingItems = [] }) {
|
||||
if (!graphState?.items?.[itemId]) return null
|
||||
|
||||
if (graphState.graph_profile?.enforce_gate_blocking === false) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { blocked, ready, blocked_by: blockedBy = [] } = graphState.items[itemId]
|
||||
|
||||
if (ready) {
|
||||
|
||||
@@ -18,27 +18,29 @@ function truncateTitle(title, max = 28) {
|
||||
return `${title.slice(0, max - 1)}…`
|
||||
}
|
||||
|
||||
export function GateMapView({ initiativeId, items }) {
|
||||
export function GateMapView({ initiativeId, items, graphState: graphStateProp }) {
|
||||
const navigate = useNavigate()
|
||||
const [dependencies, setDependencies] = useState([])
|
||||
const [graphState, setGraphState] = useState(null)
|
||||
const [graphStateLocal, setGraphStateLocal] = useState(null)
|
||||
const graphState = graphStateProp ?? graphStateLocal
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!initiativeId) {
|
||||
setDependencies([])
|
||||
setGraphState(null)
|
||||
if (!graphStateProp) setGraphStateLocal(null)
|
||||
setLoading(false)
|
||||
return undefined
|
||||
}
|
||||
let cancelled = false
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
Promise.allSettled([
|
||||
listInitiativeRoadmapDependencies(initiativeId),
|
||||
listInitiativeRoadmapGraphState(initiativeId),
|
||||
]).then(([depsResult, graphResult]) => {
|
||||
const loaders = [listInitiativeRoadmapDependencies(initiativeId)]
|
||||
if (!graphStateProp) {
|
||||
loaders.push(listInitiativeRoadmapGraphState(initiativeId))
|
||||
}
|
||||
Promise.allSettled(loaders).then(([depsResult, graphResult]) => {
|
||||
if (cancelled) return
|
||||
if (depsResult.status === 'fulfilled') {
|
||||
setDependencies(Array.isArray(depsResult.value) ? depsResult.value : [])
|
||||
@@ -47,17 +49,17 @@ export function GateMapView({ initiativeId, items }) {
|
||||
depsResult.reason?.message || 'Abhängigkeiten konnten nicht geladen werden.',
|
||||
)
|
||||
}
|
||||
if (graphResult.status === 'fulfilled') {
|
||||
setGraphState(graphResult.value || null)
|
||||
} else {
|
||||
setGraphState(null)
|
||||
if (!graphStateProp && graphResult?.status === 'fulfilled') {
|
||||
setGraphStateLocal(graphResult.value || null)
|
||||
} else if (!graphStateProp) {
|
||||
setGraphStateLocal(null)
|
||||
}
|
||||
setLoading(false)
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [initiativeId])
|
||||
}, [initiativeId, graphStateProp])
|
||||
|
||||
const layout = useMemo(
|
||||
() => computeGateGraphLayout(items, dependencies),
|
||||
@@ -152,10 +154,11 @@ export function GateMapView({ initiativeId, items }) {
|
||||
{layout.nodes.map((node) => {
|
||||
const item = node.item
|
||||
const nodeGraph = graphState?.items?.[node.id]
|
||||
const enforceBlocking = graphState?.graph_profile?.enforce_gate_blocking !== false
|
||||
const nodeClass =
|
||||
'gate-map-view__node gate-map-view__node--' +
|
||||
(item.status || 'planned') +
|
||||
(nodeGraph?.blocked ? ' gate-map-view__node--blocked' : '') +
|
||||
(enforceBlocking && nodeGraph?.blocked ? ' gate-map-view__node--blocked' : '') +
|
||||
(nodeGraph?.ready ? ' gate-map-view__node--ready' : '')
|
||||
return (
|
||||
<g
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
|
||||
import { RoadmapPlanSection } from './RoadmapPlanSection.jsx'
|
||||
import { GateMapView } from './GateMapView.jsx'
|
||||
import { resolveGatesViewMode, storeGatesViewMode } from '../plan/gateGraphLayout.js'
|
||||
import { listInitiativeRoadmapGraphState } from '../api/roadmap.js'
|
||||
|
||||
export function GatesPlanPanel({
|
||||
initiativeId,
|
||||
@@ -13,18 +14,56 @@ export function GatesPlanPanel({
|
||||
busy,
|
||||
}) {
|
||||
const [viewMode, setViewMode] = useState(() => resolveGatesViewMode(initiativeId, items.length))
|
||||
const [graphState, setGraphState] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
setViewMode(resolveGatesViewMode(initiativeId, items.length))
|
||||
}, [initiativeId, items.length])
|
||||
|
||||
useEffect(() => {
|
||||
if (!initiativeId) {
|
||||
setGraphState(null)
|
||||
return undefined
|
||||
}
|
||||
let cancelled = false
|
||||
listInitiativeRoadmapGraphState(initiativeId)
|
||||
.then((data) => {
|
||||
if (!cancelled) setGraphState(data || null)
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) setGraphState(null)
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [initiativeId, items])
|
||||
|
||||
function handleViewChange(mode) {
|
||||
setViewMode(mode)
|
||||
storeGatesViewMode(initiativeId, mode)
|
||||
}
|
||||
|
||||
const fulfillmentPct =
|
||||
graphState?.initiative_fulfillment_ratio != null
|
||||
? Math.round(graphState.initiative_fulfillment_ratio * 100)
|
||||
: null
|
||||
|
||||
return (
|
||||
<div className="gates-plan-panel">
|
||||
{graphState?.graph_profile?.emphasize_fulfillment && fulfillmentPct != null && (
|
||||
<p className="gates-plan-panel__fulfillment muted">
|
||||
Erfüllungsgrad (Plan): <strong>{fulfillmentPct}%</strong> — Reifegrad zählt, kein
|
||||
Gate-Zwang.
|
||||
</p>
|
||||
)}
|
||||
{graphState?.graph_profile?.enforce_gate_blocking === false &&
|
||||
!graphState?.graph_profile?.emphasize_fulfillment && (
|
||||
<p className="gates-plan-panel__method-hint muted">
|
||||
Gates sind optional — der Graph blockiert nicht hart; Reihenfolge über Kanten oder
|
||||
Liste.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<div className="gates-plan-panel__toolbar" role="tablist" aria-label="Zielzustände Ansicht">
|
||||
<button
|
||||
type="button"
|
||||
@@ -59,9 +98,10 @@ export function GatesPlanPanel({
|
||||
onReorder={onReorder}
|
||||
onDelete={onDelete}
|
||||
busy={busy}
|
||||
graphState={graphState}
|
||||
/>
|
||||
) : (
|
||||
<GateMapView initiativeId={initiativeId} items={items} />
|
||||
<GateMapView initiativeId={initiativeId} items={items} graphState={graphState} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -2,11 +2,10 @@ import { useEffect, useMemo, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { gatePath } from '../utils/routes.js'
|
||||
import { listInitiativeRoadmapCriteriaProgress, listInitiativeRoadmapGraphState } from '../api/roadmap.js'
|
||||
import {
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
} from '../constants/status.js'
|
||||
import { ROADMAP_ITEM_TYPE_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { GateGraphStateBadge } from './GateGraphStateBadge.jsx'
|
||||
import { GateFulfillmentBadge } from './GateFulfillmentBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
import { Modal } from './Modal.jsx'
|
||||
import { RoadmapItemForm } from './RoadmapItemForm.jsx'
|
||||
@@ -33,42 +32,46 @@ export function RoadmapPlanSection({
|
||||
onReorder,
|
||||
onDelete,
|
||||
busy,
|
||||
graphState: graphStateProp,
|
||||
}) {
|
||||
const [showCreate, setShowCreate] = useState(false)
|
||||
const [dragItemId, setDragItemId] = useState('')
|
||||
const [dropTargetId, setDropTargetId] = useState('')
|
||||
const [criteriaProgress, setCriteriaProgress] = useState({})
|
||||
const [graphState, setGraphState] = useState(null)
|
||||
const [graphStateLocal, setGraphStateLocal] = useState(null)
|
||||
const graphState = graphStateProp ?? graphStateLocal
|
||||
const isDesktop = useMinWidth(1024)
|
||||
const canReorder = canManage && typeof onReorder === 'function'
|
||||
|
||||
useEffect(() => {
|
||||
if (!initiativeId) {
|
||||
setCriteriaProgress({})
|
||||
setGraphState(null)
|
||||
if (!graphStateProp) setGraphStateLocal(null)
|
||||
return undefined
|
||||
}
|
||||
let cancelled = false
|
||||
Promise.all([
|
||||
listInitiativeRoadmapCriteriaProgress(initiativeId),
|
||||
listInitiativeRoadmapGraphState(initiativeId),
|
||||
])
|
||||
.then(([progressData, graphData]) => {
|
||||
if (!cancelled) {
|
||||
setCriteriaProgress(progressData || {})
|
||||
setGraphState(graphData || null)
|
||||
const loaders = [listInitiativeRoadmapCriteriaProgress(initiativeId)]
|
||||
if (!graphStateProp) {
|
||||
loaders.push(listInitiativeRoadmapGraphState(initiativeId))
|
||||
}
|
||||
Promise.all(loaders)
|
||||
.then((results) => {
|
||||
if (cancelled) return
|
||||
setCriteriaProgress(results[0] || {})
|
||||
if (!graphStateProp && results[1]) {
|
||||
setGraphStateLocal(results[1] || null)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) {
|
||||
setCriteriaProgress({})
|
||||
setGraphState(null)
|
||||
if (!graphStateProp) setGraphStateLocal(null)
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
}, [initiativeId, items])
|
||||
}, [initiativeId, items, graphStateProp])
|
||||
|
||||
const sortedItems = useMemo(() => sortByOrder(items), [items])
|
||||
|
||||
@@ -204,6 +207,7 @@ export function RoadmapPlanSection({
|
||||
itemId={item.id}
|
||||
siblingItems={sortedItems}
|
||||
/>
|
||||
<GateFulfillmentBadge graphState={graphState} itemId={item.id} />
|
||||
{canReorder && !isDesktop && (
|
||||
<ReorderControls
|
||||
itemId={item.id}
|
||||
|
||||
Reference in new issue
Block a user