fix: Gate-Verify — Evidence an Plan-Element verknüpfen
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m31s
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 1s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m31s
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 1s
Test Suite / compose-smoke (push) Has been skipped
Verify prüft akzeptiertes Evidence am RoadmapItem. Plan-UI schließt Gates mit Nachweis; Journey erlaubt Plan-Zuordnung. Migration 011 roadmap_item_id auf evidence/reviews. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
09433b5d28
commit
fdda8a9fae
13 files changed
+262
-38
No files matched your search
@@ -1,24 +1,50 @@
|
||||
import { useState } from 'react'
|
||||
import { EVIDENCE_STATUSES, EVIDENCE_STATUS_LABELS } from '../constants/status.js'
|
||||
import { EVIDENCE_STATUSES, EVIDENCE_STATUS_LABELS, ROADMAP_ITEM_TYPE_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
export function EvidenceSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) {
|
||||
function planElementLabel(items, roadmapItemId) {
|
||||
if (!roadmapItemId) return null
|
||||
const item = items.find((i) => i.id === roadmapItemId)
|
||||
if (!item) return 'Plan-Element'
|
||||
const type = ROADMAP_ITEM_TYPE_LABELS[item.item_type] || item.item_type
|
||||
return `${type}: ${item.title}`
|
||||
}
|
||||
|
||||
export function EvidenceSection({
|
||||
items,
|
||||
roadmapItems = [],
|
||||
canManage,
|
||||
onCreate,
|
||||
onUpdateStatus,
|
||||
onDelete,
|
||||
busy,
|
||||
}) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [roadmapItemId, setRoadmapItemId] = 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: roadmapItemId || undefined,
|
||||
})
|
||||
setTitle('')
|
||||
setRoadmapItemId('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Evidence</h2>
|
||||
<div>
|
||||
<h2>Evidence</h2>
|
||||
<p className="section-lead muted">
|
||||
Für Gate-Verify am Plan-Element verknüpfen und Status Akzeptiert setzen.
|
||||
</p>
|
||||
</div>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
@@ -41,6 +67,22 @@ export function EvidenceSection({ items, canManage, onCreate, onUpdateStatus, on
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
{roadmapItems.length > 0 && (
|
||||
<label>
|
||||
Plan-Element (optional)
|
||||
<select
|
||||
value={roadmapItemId}
|
||||
onChange={(e) => setRoadmapItemId(e.target.value)}
|
||||
>
|
||||
<option value="">— nicht zugeordnet —</option>
|
||||
{roadmapItems.map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{ROADMAP_ITEM_TYPE_LABELS[item.item_type] || item.item_type}: {item.title}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
@@ -55,6 +97,15 @@ export function EvidenceSection({ items, canManage, onCreate, onUpdateStatus, on
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
{item.description && <p className="list-item-desc">{item.description}</p>}
|
||||
{(item.roadmap_item_id || item.milestone_id) && (
|
||||
<p className="muted list-item-sub">
|
||||
Plan:{' '}
|
||||
{planElementLabel(
|
||||
roadmapItems,
|
||||
item.roadmap_item_id || item.milestone_id
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="evidence" status={item.status} />
|
||||
|
||||
@@ -31,7 +31,7 @@ export function RoadmapPlanSection({
|
||||
onCreate,
|
||||
onUpdateStatus,
|
||||
onUpdateItem,
|
||||
onVerifyReached,
|
||||
onVerifyWithEvidence,
|
||||
onDelete,
|
||||
busy,
|
||||
}) {
|
||||
@@ -41,6 +41,7 @@ export function RoadmapPlanSection({
|
||||
const [itemType, setItemType] = useState('milestone')
|
||||
const [sequencingMode, setSequencingMode] = useState('sequential')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
const [verifyTitles, setVerifyTitles] = useState({})
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
@@ -193,14 +194,41 @@ export function RoadmapPlanSection({
|
||||
))}
|
||||
</select>
|
||||
{['planned', 'active', 'at_risk'].includes(item.status) && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
disabled={busy}
|
||||
onClick={() => onVerifyReached(item.id)}
|
||||
>
|
||||
Verify → erreicht
|
||||
</button>
|
||||
<div className="gate-verify-block">
|
||||
<label className="gate-verify-label">
|
||||
Nachweis für Verify
|
||||
<input
|
||||
type="text"
|
||||
value={verifyTitles[item.id] ?? ''}
|
||||
placeholder={`Nachweis: ${item.title}`}
|
||||
onChange={(e) =>
|
||||
setVerifyTitles((prev) => ({
|
||||
...prev,
|
||||
[item.id]: e.target.value,
|
||||
}))
|
||||
}
|
||||
maxLength={255}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
onVerifyWithEvidence(
|
||||
item.id,
|
||||
verifyTitles[item.id]?.trim() || `Nachweis: ${item.title}`
|
||||
)
|
||||
}
|
||||
>
|
||||
Gate schließen
|
||||
</button>
|
||||
<p className="muted gate-verify-hint">
|
||||
Legt akzeptiertes Evidence am Plan-Element an und setzt Status auf erreicht.
|
||||
Bereits vorhandener Nachweis auf Journey: Plan-Element zuweisen und auf
|
||||
Akzeptiert setzen, dann erneut Verify.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user