AP0.8: Operating Model Extension I (Attention, Blocker, Backlog, Milestone)
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 58s
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 45s
Test Suite / pytest-backend (push) Successful in 58s
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
Schema 007, regelbasierte Attention/NextAction im Data Layer, CRUD fuer Blocker/Backlog/Meilensteine, Workspace-Widget und Initiative-Detail-Sektionen. 25 Capabilities. Tests fuer Remote-Pytest auf Pi angepasst (conftest Session-Guard). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6dd9dd4f62
commit
fe3bc4f057
39 files changed
+4333
-22
No files matched your search
@@ -0,0 +1,89 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { getAttentionItems } from '../api/attention.js'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
import { WidgetCard } from '../components/WidgetCard.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
|
||||
const SEVERITY_LABELS = {
|
||||
critical: 'Kritisch',
|
||||
warning: 'Warnung',
|
||||
info: 'Hinweis',
|
||||
}
|
||||
|
||||
function attentionLink(item) {
|
||||
if (item.initiative_id && item.action_id) {
|
||||
return `/initiatives/${item.initiative_id}`
|
||||
}
|
||||
if (item.initiative_id) {
|
||||
return `/initiatives/${item.initiative_id}`
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export function AttentionWidget() {
|
||||
const [items, setItems] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const data = await getAttentionItems()
|
||||
setItems(Array.isArray(data) ? data.slice(0, 8) : [])
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
return (
|
||||
<WidgetCard
|
||||
title="Aufmerksamkeit"
|
||||
subtitle="Was braucht jetzt Steuerung?"
|
||||
actions={
|
||||
<button type="button" className="btn btn-ghost" onClick={load} disabled={loading}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
}
|
||||
>
|
||||
{loading && <LoadingState />}
|
||||
{!loading && error && <ErrorState message={error} onRetry={load} />}
|
||||
{!loading && !error && items.length === 0 && (
|
||||
<EmptyState message="Keine Attention-Items — alles im grünen Bereich." />
|
||||
)}
|
||||
{!loading && !error && items.length > 0 && (
|
||||
<ul className="item-list attention-list">
|
||||
{items.map((item) => {
|
||||
const href = attentionLink(item)
|
||||
return (
|
||||
<li key={`${item.kind}-${item.scope_id}`} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<span className={`attention-severity attention-severity--${item.severity}`}>
|
||||
{SEVERITY_LABELS[item.severity] || item.severity}
|
||||
</span>
|
||||
<strong>{item.title}</strong>
|
||||
{item.summary && <p className="list-item-desc muted">{item.summary}</p>}
|
||||
</div>
|
||||
<div className="list-item-meta">
|
||||
{href ? (
|
||||
<Link to={href} className="btn btn-secondary btn-sm">
|
||||
Ansehen
|
||||
</Link>
|
||||
) : null}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
</WidgetCard>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user