AP1.4c: Gate-Checkliste statt Freitext-DoD.
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 2m13s
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 12s
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 2m13s
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 12s
Kriterien-Fortschritt in der Gate-Liste, Modal-UX fuer Checklisten und optionales Erst-Kriterium beim Anlegen. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
dbe6f4f684
commit
bd64340ca1
10 files changed
+509
-198
No files matched your search
@@ -1,16 +1,9 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { Link, useParams } from 'react-router-dom'
|
||||
import {
|
||||
createInitiativeEvidence,
|
||||
} from '../../api/evidence.js'
|
||||
import { createInitiativeEvidence } from '../../api/evidence.js'
|
||||
import {
|
||||
getRoadmapItem,
|
||||
listRoadmapItemCriteria,
|
||||
createRoadmapItemCriterion,
|
||||
deleteRoadmapCriterion,
|
||||
satisfyRoadmapCriterion,
|
||||
waiveRoadmapCriterion,
|
||||
deferRoadmapCriterion,
|
||||
verifyRoadmapItemReached,
|
||||
reopenRoadmapItem,
|
||||
updateRoadmapItem,
|
||||
@@ -23,9 +16,6 @@ import { ErrorState } from '../../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../../components/LoadingState.jsx'
|
||||
import { StatusBadge } from '../../components/StatusBadge.jsx'
|
||||
import {
|
||||
CRITERION_KIND_LABELS,
|
||||
CRITERION_KINDS,
|
||||
CRITERION_STATUS_LABELS,
|
||||
MILESTONE_STATUS_LABELS,
|
||||
ROADMAP_ITEM_TYPE_LABELS,
|
||||
SEQUENCING_MODE_LABELS,
|
||||
@@ -36,52 +26,10 @@ import { scopedPath } from '../../utils/routes.js'
|
||||
import { listGateContributions } from '../../api/journey.js'
|
||||
import { GateContributionsSection } from '../../components/GateContributionsSection.jsx'
|
||||
import { GateDependenciesSection } from '../../components/GateDependenciesSection.jsx'
|
||||
import { GateCriteriaSection } from '../../components/GateCriteriaSection.jsx'
|
||||
import { Modal } from '../../components/Modal.jsx'
|
||||
import { RoadmapItemForm } from '../../components/RoadmapItemForm.jsx'
|
||||
|
||||
function CriterionDecisionForm({ label, onSubmit, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [description, setDescription] = useState('')
|
||||
|
||||
return (
|
||||
<form
|
||||
className="inline-form-block criterion-decision-form"
|
||||
onSubmit={async (e) => {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onSubmit({
|
||||
decision_title: title.trim(),
|
||||
decision_description: description.trim(),
|
||||
})
|
||||
setTitle('')
|
||||
setDescription('')
|
||||
}}
|
||||
>
|
||||
<label>
|
||||
{label} — Begründung (Decision)
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
required
|
||||
maxLength={255}
|
||||
placeholder="Kurzbegründung"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Details
|
||||
<textarea
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
rows={2}
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-secondary" disabled={busy}>
|
||||
Speichern
|
||||
</button>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
|
||||
export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
const { id: routeInitiativeId, itemId: routeItemId, gateId } = useParams()
|
||||
const ops = useInitiativeOperations()
|
||||
@@ -97,9 +45,6 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [newTitle, setNewTitle] = useState('')
|
||||
const [newKind, setNewKind] = useState('manual')
|
||||
const [expandedDecision, setExpandedDecision] = useState(null)
|
||||
const [reopenReason, setReopenReason] = useState('')
|
||||
const [contributions, setContributions] = useState(null)
|
||||
const [contributionsLoading, setContributionsLoading] = useState(true)
|
||||
@@ -151,6 +96,16 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
}
|
||||
}, [itemId, initiativeId])
|
||||
|
||||
const reloadCriteria = useCallback(async () => {
|
||||
try {
|
||||
const criteriaData = await listRoadmapItemCriteria(itemId)
|
||||
setCriteria(criteriaData.items || [])
|
||||
setProgress(criteriaData.progress || null)
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}, [itemId])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
@@ -159,6 +114,19 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
loadContributions()
|
||||
}, [loadContributions])
|
||||
|
||||
async function runCriteriaAction(fn) {
|
||||
setBusy(true)
|
||||
setError(null)
|
||||
try {
|
||||
await fn()
|
||||
await reloadCriteria()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function runAction(fn) {
|
||||
setBusy(true)
|
||||
setError(null)
|
||||
@@ -176,9 +144,6 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
if (error && !item) return <ErrorState message={error} onRetry={load} />
|
||||
if (!item) return <ErrorState message="Plan-Element nicht gefunden." onRetry={load} />
|
||||
|
||||
const closedCount = progress?.closed ?? 0
|
||||
const totalCount = progress?.total ?? criteria.length
|
||||
|
||||
return (
|
||||
<section className="card roadmap-item-detail">
|
||||
<p className="breadcrumb muted">
|
||||
@@ -199,7 +164,9 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
{' · '}
|
||||
{SEQUENCING_MODE_LABELS[item.sequencing_mode] || item.sequencing_mode}
|
||||
</p>
|
||||
{item.goal_description && <p>{item.goal_description}</p>}
|
||||
{item.goal_description && (
|
||||
<p className="roadmap-item-detail__goal-context">{item.goal_description}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="section-header__actions">
|
||||
<StatusBadge kind="milestone" status={item.status} />
|
||||
@@ -216,10 +183,6 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="muted">
|
||||
Checkliste: {closedCount}/{totalCount} Kriterien abgeschlossen
|
||||
</p>
|
||||
|
||||
<GateContributionsSection
|
||||
contributions={contributions}
|
||||
initiativeId={initiativeId}
|
||||
@@ -237,136 +200,16 @@ export function RoadmapItemDetailPage({ overrideItemId }) {
|
||||
onDelete={(dependencyId) => runAction(() => deleteRoadmapDependency(dependencyId))}
|
||||
/>
|
||||
|
||||
<ul className="item-list criterion-list">
|
||||
{criteria.map((crit) => (
|
||||
<li key={crit.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{crit.title}</strong>
|
||||
<p className="muted list-item-sub">
|
||||
{CRITERION_KIND_LABELS[crit.criterion_kind] || crit.criterion_kind}
|
||||
</p>
|
||||
{crit.description && <p className="list-item-desc">{crit.description}</p>}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<span className="status-pill">
|
||||
{CRITERION_STATUS_LABELS[crit.status] || crit.status}
|
||||
</span>
|
||||
{canManage && crit.status === 'open' && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
disabled={busy}
|
||||
onClick={() => runAction(() => satisfyRoadmapCriterion(crit.id))}
|
||||
>
|
||||
Erfüllt
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
setExpandedDecision(
|
||||
expandedDecision === `${crit.id}:waive` ? null : `${crit.id}:waive`
|
||||
)
|
||||
}
|
||||
>
|
||||
Auslassen
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
setExpandedDecision(
|
||||
expandedDecision === `${crit.id}:defer` ? null : `${crit.id}:defer`
|
||||
)
|
||||
}
|
||||
>
|
||||
Verschieben
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{canManage && criteria.length > 1 && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
disabled={busy}
|
||||
onClick={() => runAction(() => deleteRoadmapCriterion(crit.id))}
|
||||
>
|
||||
Entfernen
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{expandedDecision === `${crit.id}:waive` && (
|
||||
<CriterionDecisionForm
|
||||
label="Auslassen"
|
||||
busy={busy}
|
||||
onSubmit={(body) =>
|
||||
runAction(async () => {
|
||||
await waiveRoadmapCriterion(crit.id, body)
|
||||
setExpandedDecision(null)
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{expandedDecision === `${crit.id}:defer` && (
|
||||
<CriterionDecisionForm
|
||||
label="Verschieben"
|
||||
busy={busy}
|
||||
onSubmit={(body) =>
|
||||
runAction(async () => {
|
||||
await deferRoadmapCriterion(crit.id, body)
|
||||
setExpandedDecision(null)
|
||||
})
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
{canManage && (
|
||||
<form
|
||||
className="inline-form-block"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
if (!newTitle.trim()) return
|
||||
runAction(async () => {
|
||||
await createRoadmapItemCriterion(itemId, {
|
||||
title: newTitle.trim(),
|
||||
criterion_kind: newKind,
|
||||
})
|
||||
setNewTitle('')
|
||||
setNewKind('manual')
|
||||
})
|
||||
}}
|
||||
>
|
||||
<h3>Kriterium hinzufügen</h3>
|
||||
<label>
|
||||
Titel
|
||||
<input
|
||||
value={newTitle}
|
||||
onChange={(e) => setNewTitle(e.target.value)}
|
||||
maxLength={500}
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Art
|
||||
<select value={newKind} onChange={(e) => setNewKind(e.target.value)}>
|
||||
{CRITERION_KINDS.map((k) => (
|
||||
<option key={k} value={k}>
|
||||
{CRITERION_KIND_LABELS[k]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Hinzufügen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
<GateCriteriaSection
|
||||
itemId={itemId}
|
||||
itemStatus={item.status}
|
||||
criteria={criteria}
|
||||
progress={progress}
|
||||
canManage={canManage}
|
||||
busy={busy}
|
||||
onChanged={reloadCriteria}
|
||||
onAction={runCriteriaAction}
|
||||
/>
|
||||
|
||||
<div className="gate-detail-actions">
|
||||
{canManage && ['planned', 'active', 'at_risk'].includes(item.status) && (
|
||||
|
||||
Reference in new issue
Block a user