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"
|
||||
|
||||
@@ -347,6 +347,24 @@ export function InitiativeOperationsProvider({ children }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleVerifyWithEvidence(itemId, evidenceTitle) {
|
||||
setFormBusy(true)
|
||||
setError(null)
|
||||
try {
|
||||
await createInitiativeEvidence(id, {
|
||||
title: evidenceTitle,
|
||||
roadmap_item_id: itemId,
|
||||
status: 'accepted',
|
||||
})
|
||||
await verifyRoadmapItemReached(itemId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleVerifyRoadmapItem(itemId) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
@@ -545,6 +563,7 @@ export function InitiativeOperationsProvider({ children }) {
|
||||
handleRoadmapItemStatus,
|
||||
handleUpdateRoadmapItem,
|
||||
handleVerifyRoadmapItem,
|
||||
handleVerifyWithEvidence,
|
||||
handleDeleteRoadmapItem,
|
||||
handleCreateMilestone: handleCreateRoadmapItem,
|
||||
handleMilestoneStatus: handleRoadmapItemStatus,
|
||||
|
||||
@@ -45,6 +45,7 @@ export function InitiativeJourneyPage() {
|
||||
/>
|
||||
<EvidenceSection
|
||||
items={ops.evidenceItems}
|
||||
roadmapItems={ops.roadmapItems}
|
||||
canManage={capabilities.has('kairo.evidence.manage')}
|
||||
onCreate={ops.handleCreateEvidence}
|
||||
onUpdateStatus={ops.handleEvidenceStatus}
|
||||
|
||||
@@ -9,7 +9,7 @@ export function InitiativePlanPage() {
|
||||
handleCreateRoadmapItem,
|
||||
handleRoadmapItemStatus,
|
||||
handleUpdateRoadmapItem,
|
||||
handleVerifyRoadmapItem,
|
||||
handleVerifyWithEvidence,
|
||||
handleDeleteRoadmapItem,
|
||||
error,
|
||||
} = useInitiativeOperations()
|
||||
@@ -27,7 +27,7 @@ export function InitiativePlanPage() {
|
||||
onCreate={handleCreateRoadmapItem}
|
||||
onUpdateStatus={handleRoadmapItemStatus}
|
||||
onUpdateItem={handleUpdateRoadmapItem}
|
||||
onVerifyReached={handleVerifyRoadmapItem}
|
||||
onVerifyWithEvidence={handleVerifyWithEvidence}
|
||||
onDelete={handleDeleteRoadmapItem}
|
||||
busy={formBusy}
|
||||
/>
|
||||
|
||||
@@ -1123,4 +1123,26 @@
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.gate-verify-block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.75rem;
|
||||
padding-top: 0.75rem;
|
||||
border-top: 1px solid var(--border-subtle, #e5e7eb);
|
||||
min-width: 12rem;
|
||||
}
|
||||
|
||||
.gate-verify-label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.gate-verify-hint {
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.35;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user