AP0.9: Operating Model Extension II (Evidence, Decision, Review, Recurring, due_at)
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 1m6s
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 21s
Test Suite / playwright-smoke (push) Successful in 14s
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 1m6s
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 21s
Test Suite / playwright-smoke (push) Successful in 14s
Schließt den zweiten OM-Slice entlang der Roadmap: neue Entitäten parallel im Vorhaben, erweiterte Action-Status/Fälligkeit und Attention-Regeln 7–9. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c9101db1e1
commit
a025542545
36 files changed
+3178
-37
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { apiFetch } from './client.js'
|
||||
|
||||
export function listInitiativeDecisions(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/decisions`)
|
||||
}
|
||||
|
||||
export function createInitiativeDecision(initiativeId, body) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/decisions`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateDecision(decisionId, body) {
|
||||
return apiFetch(`/api/decisions/${decisionId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteDecision(decisionId) {
|
||||
return apiFetch(`/api/decisions/${decisionId}`, { method: 'DELETE' })
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { apiFetch } from './client.js'
|
||||
|
||||
export function listInitiativeEvidence(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/evidence`)
|
||||
}
|
||||
|
||||
export function createInitiativeEvidence(initiativeId, body) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/evidence`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateEvidence(evidenceId, body) {
|
||||
return apiFetch(`/api/evidence/${evidenceId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteEvidence(evidenceId) {
|
||||
return apiFetch(`/api/evidence/${evidenceId}`, { method: 'DELETE' })
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { apiFetch } from './client.js'
|
||||
|
||||
export function listInitiativeRecurring(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/recurring`)
|
||||
}
|
||||
|
||||
export function createInitiativeRecurring(initiativeId, body) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/recurring`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecurring(recurringId, body) {
|
||||
return apiFetch(`/api/recurring/${recurringId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRecurring(recurringId) {
|
||||
return apiFetch(`/api/recurring/${recurringId}`, { method: 'DELETE' })
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { apiFetch } from './client.js'
|
||||
|
||||
export function listInitiativeReviews(initiativeId) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/reviews`)
|
||||
}
|
||||
|
||||
export function createInitiativeReview(initiativeId, body) {
|
||||
return apiFetch(`/api/initiatives/${initiativeId}/reviews`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function updateReview(reviewId, body) {
|
||||
return apiFetch(`/api/reviews/${reviewId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteReview(reviewId) {
|
||||
return apiFetch(`/api/reviews/${reviewId}`, { method: 'DELETE' })
|
||||
}
|
||||
@@ -2,6 +2,13 @@ import { ACTION_STATUSES, PRIORITIES } from '../constants/status.js'
|
||||
import { ACTION_STATUS_LABELS, PRIORITY_LABELS } from '../constants/status.js'
|
||||
import { ActorSelect } from './ActorSelect.jsx'
|
||||
|
||||
function isoToLocalInput(iso) {
|
||||
if (!iso) return ''
|
||||
const d = new Date(iso)
|
||||
const pad = (n) => String(n).padStart(2, '0')
|
||||
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`
|
||||
}
|
||||
|
||||
export function ActionForm({
|
||||
initial = {},
|
||||
actors = [],
|
||||
@@ -23,6 +30,7 @@ export function ActionForm({
|
||||
description: form.description.value,
|
||||
status: form.status.value,
|
||||
priority: form.priority.value,
|
||||
due_at: form.due_at.value ? new Date(form.due_at.value).toISOString() : null,
|
||||
assigned_actor_ids: selected,
|
||||
})
|
||||
}
|
||||
@@ -59,6 +67,14 @@ export function ActionForm({
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Fällig am (optional)
|
||||
<input
|
||||
name="due_at"
|
||||
type="datetime-local"
|
||||
defaultValue={isoToLocalInput(initial.due_at)}
|
||||
/>
|
||||
</label>
|
||||
<ActorSelect
|
||||
actors={actors}
|
||||
defaultSelected={defaultActors}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import { useState } from 'react'
|
||||
import { DECISION_STATUSES, DECISION_STATUS_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
export function DecisionsSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onCreate({ title: title.trim() })
|
||||
setTitle('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Entscheidungen</h2>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Entscheidung anlegen'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showForm && canManage && (
|
||||
<form className="inline-form-block" onSubmit={handleSubmit}>
|
||||
<label>
|
||||
Titel
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
maxLength={255}
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{items.length === 0 && <EmptyState message="Keine Entscheidungen." />}
|
||||
|
||||
<ul className="item-list">
|
||||
{items.map((item) => (
|
||||
<li key={item.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
{item.outcome && <p className="list-item-desc">{item.outcome}</p>}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="decision" status={item.status} />
|
||||
{canManage && (
|
||||
<>
|
||||
<select
|
||||
className="inline-select"
|
||||
value={item.status}
|
||||
onChange={(e) => onUpdateStatus(item.id, e.target.value)}
|
||||
aria-label="Entscheidungs-Status"
|
||||
>
|
||||
{DECISION_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{DECISION_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => onDelete(item.id)}
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import { useState } from 'react'
|
||||
import { EVIDENCE_STATUSES, EVIDENCE_STATUS_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
export function EvidenceSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onCreate({ title: title.trim() })
|
||||
setTitle('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Evidence</h2>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Evidence hinzufügen'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showForm && canManage && (
|
||||
<form className="inline-form-block" onSubmit={handleSubmit}>
|
||||
<label>
|
||||
Titel
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
maxLength={255}
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{items.length === 0 && <EmptyState message="Kein Evidence." />}
|
||||
|
||||
<ul className="item-list">
|
||||
{items.map((item) => (
|
||||
<li key={item.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
{item.description && <p className="list-item-desc">{item.description}</p>}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="evidence" status={item.status} />
|
||||
{canManage && (
|
||||
<>
|
||||
<select
|
||||
className="inline-select"
|
||||
value={item.status}
|
||||
onChange={(e) => onUpdateStatus(item.id, e.target.value)}
|
||||
aria-label="Evidence-Status"
|
||||
>
|
||||
{EVIDENCE_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{EVIDENCE_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => onDelete(item.id)}
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import { useState } from 'react'
|
||||
import { RECURRING_STATUSES, RECURRING_STATUS_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
function formatDueAt(iso) {
|
||||
if (!iso) return null
|
||||
try {
|
||||
return new Date(iso).toLocaleString('de-DE')
|
||||
} catch {
|
||||
return iso
|
||||
}
|
||||
}
|
||||
|
||||
export function RecurringSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [nextDueAt, setNextDueAt] = useState('')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onCreate({
|
||||
title: title.trim(),
|
||||
next_due_at: nextDueAt ? new Date(nextDueAt).toISOString() : null,
|
||||
})
|
||||
setTitle('')
|
||||
setNextDueAt('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Wiederkehrend</h2>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Element anlegen'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showForm && canManage && (
|
||||
<form className="inline-form-block" onSubmit={handleSubmit}>
|
||||
<label>
|
||||
Titel
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
maxLength={255}
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Nächste Fälligkeit
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={nextDueAt}
|
||||
onChange={(e) => setNextDueAt(e.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{items.length === 0 && <EmptyState message="Keine wiederkehrenden Elemente." />}
|
||||
|
||||
<ul className="item-list">
|
||||
{items.map((item) => (
|
||||
<li key={item.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
{item.next_due_at && (
|
||||
<p className="muted list-item-sub">Fällig: {formatDueAt(item.next_due_at)}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="recurring" status={item.status} />
|
||||
{canManage && (
|
||||
<>
|
||||
<select
|
||||
className="inline-select"
|
||||
value={item.status}
|
||||
onChange={(e) => onUpdateStatus(item.id, e.target.value)}
|
||||
aria-label="Recurring-Status"
|
||||
>
|
||||
{RECURRING_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{RECURRING_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => onDelete(item.id)}
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import { useState } from 'react'
|
||||
import { REVIEW_STATUSES, REVIEW_STATUS_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
function formatDueAt(iso) {
|
||||
if (!iso) return null
|
||||
try {
|
||||
return new Date(iso).toLocaleString('de-DE')
|
||||
} catch {
|
||||
return iso
|
||||
}
|
||||
}
|
||||
|
||||
export function ReviewsSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [dueAt, setDueAt] = useState('')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onCreate({
|
||||
title: title.trim(),
|
||||
due_at: dueAt ? new Date(dueAt).toISOString() : null,
|
||||
})
|
||||
setTitle('')
|
||||
setDueAt('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Reviews</h2>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Review planen'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{showForm && canManage && (
|
||||
<form className="inline-form-block" onSubmit={handleSubmit}>
|
||||
<label>
|
||||
Titel
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
maxLength={255}
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Fällig am
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={dueAt}
|
||||
onChange={(e) => setDueAt(e.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{items.length === 0 && <EmptyState message="Keine Reviews." />}
|
||||
|
||||
<ul className="item-list">
|
||||
{items.map((item) => (
|
||||
<li key={item.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
{item.due_at && (
|
||||
<p className="muted list-item-sub">Fällig: {formatDueAt(item.due_at)}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="review" status={item.status} />
|
||||
{canManage && (
|
||||
<>
|
||||
<select
|
||||
className="inline-select"
|
||||
value={item.status}
|
||||
onChange={(e) => onUpdateStatus(item.id, e.target.value)}
|
||||
aria-label="Review-Status"
|
||||
>
|
||||
{REVIEW_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{REVIEW_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => onDelete(item.id)}
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -22,6 +22,17 @@ const VARIANTS = {
|
||||
resolved: 'status-done',
|
||||
accepted_risk: 'status-paused',
|
||||
dismissed: 'status-discarded',
|
||||
ready: 'status-active',
|
||||
review_required: 'status-progress',
|
||||
submitted: 'status-open',
|
||||
accepted: 'status-done',
|
||||
rejected: 'status-discarded',
|
||||
proposed: 'status-open',
|
||||
decided: 'status-done',
|
||||
superseded: 'status-paused',
|
||||
completed: 'status-done',
|
||||
skipped: 'status-paused',
|
||||
ended: 'status-archived',
|
||||
}
|
||||
|
||||
export function StatusBadge({ kind = 'action', status }) {
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
export const INITIATIVE_STATUSES = ['active', 'paused', 'completed', 'archived']
|
||||
export const ACTION_STATUSES = ['open', 'in_progress', 'blocked', 'done', 'discarded']
|
||||
export const ACTION_STATUSES = [
|
||||
'open',
|
||||
'ready',
|
||||
'in_progress',
|
||||
'blocked',
|
||||
'review_required',
|
||||
'done',
|
||||
'discarded',
|
||||
]
|
||||
export const BLOCKER_STATUSES = ['open', 'in_progress', 'resolved', 'accepted_risk', 'dismissed']
|
||||
export const BACKLOG_STATUSES = ['new', 'triaged', 'accepted', 'rejected', 'converted']
|
||||
export const MILESTONE_STATUSES = ['planned', 'active', 'at_risk', 'reached', 'moved', 'discarded']
|
||||
export const EVIDENCE_STATUSES = ['submitted', 'accepted', 'rejected']
|
||||
export const DECISION_STATUSES = ['proposed', 'decided', 'superseded']
|
||||
export const REVIEW_STATUSES = ['planned', 'completed', 'skipped']
|
||||
export const RECURRING_STATUSES = ['active', 'paused', 'ended']
|
||||
export const PRIORITIES = ['low', 'normal', 'high']
|
||||
export const OPEN_ACTION_STATUSES = ['open', 'in_progress', 'blocked']
|
||||
export const OPEN_ACTION_STATUSES = ['open', 'ready', 'in_progress', 'blocked', 'review_required']
|
||||
|
||||
export const INITIATIVE_STATUS_LABELS = {
|
||||
active: 'Aktiv',
|
||||
@@ -15,8 +27,10 @@ export const INITIATIVE_STATUS_LABELS = {
|
||||
|
||||
export const ACTION_STATUS_LABELS = {
|
||||
open: 'Offen',
|
||||
ready: 'Bereit',
|
||||
in_progress: 'In Arbeit',
|
||||
blocked: 'Blockiert',
|
||||
review_required: 'Review nötig',
|
||||
done: 'Erledigt',
|
||||
discarded: 'Verworfen',
|
||||
}
|
||||
@@ -46,6 +60,30 @@ export const MILESTONE_STATUS_LABELS = {
|
||||
discarded: 'Verworfen',
|
||||
}
|
||||
|
||||
export const EVIDENCE_STATUS_LABELS = {
|
||||
submitted: 'Eingereicht',
|
||||
accepted: 'Akzeptiert',
|
||||
rejected: 'Abgelehnt',
|
||||
}
|
||||
|
||||
export const DECISION_STATUS_LABELS = {
|
||||
proposed: 'Vorgeschlagen',
|
||||
decided: 'Entschieden',
|
||||
superseded: 'Ersetzt',
|
||||
}
|
||||
|
||||
export const REVIEW_STATUS_LABELS = {
|
||||
planned: 'Geplant',
|
||||
completed: 'Abgeschlossen',
|
||||
skipped: 'Übersprungen',
|
||||
}
|
||||
|
||||
export const RECURRING_STATUS_LABELS = {
|
||||
active: 'Aktiv',
|
||||
paused: 'Pausiert',
|
||||
ended: 'Beendet',
|
||||
}
|
||||
|
||||
export const PRIORITY_LABELS = {
|
||||
low: 'Niedrig',
|
||||
normal: 'Normal',
|
||||
@@ -58,4 +96,8 @@ export const STATUS_LABELS_BY_KIND = {
|
||||
blocker: BLOCKER_STATUS_LABELS,
|
||||
backlog: BACKLOG_STATUS_LABELS,
|
||||
milestone: MILESTONE_STATUS_LABELS,
|
||||
evidence: EVIDENCE_STATUS_LABELS,
|
||||
decision: DECISION_STATUS_LABELS,
|
||||
review: REVIEW_STATUS_LABELS,
|
||||
recurring: RECURRING_STATUS_LABELS,
|
||||
}
|
||||
@@ -25,13 +25,41 @@ import {
|
||||
updateMilestone,
|
||||
deleteMilestone,
|
||||
} from '../api/milestones.js'
|
||||
import { ACTION_STATUS_LABELS } from '../constants/status.js'
|
||||
import {
|
||||
listInitiativeEvidence,
|
||||
createInitiativeEvidence,
|
||||
updateEvidence,
|
||||
deleteEvidence,
|
||||
} from '../api/evidence.js'
|
||||
import {
|
||||
listInitiativeDecisions,
|
||||
createInitiativeDecision,
|
||||
updateDecision,
|
||||
deleteDecision,
|
||||
} from '../api/decisions.js'
|
||||
import {
|
||||
listInitiativeReviews,
|
||||
createInitiativeReview,
|
||||
updateReview,
|
||||
deleteReview,
|
||||
} from '../api/reviews.js'
|
||||
import {
|
||||
listInitiativeRecurring,
|
||||
createInitiativeRecurring,
|
||||
updateRecurring,
|
||||
deleteRecurring,
|
||||
} from '../api/recurring.js'
|
||||
import { ACTION_STATUSES, ACTION_STATUS_LABELS } from '../constants/status.js'
|
||||
import { StatusBadge } from '../components/StatusBadge.jsx'
|
||||
import { PriorityBadge } from '../components/PriorityBadge.jsx'
|
||||
import { ActionForm } from '../components/ActionForm.jsx'
|
||||
import { BlockersSection } from '../components/BlockersSection.jsx'
|
||||
import { BacklogSection } from '../components/BacklogSection.jsx'
|
||||
import { MilestonesSection } from '../components/MilestonesSection.jsx'
|
||||
import { EvidenceSection } from '../components/EvidenceSection.jsx'
|
||||
import { DecisionsSection } from '../components/DecisionsSection.jsx'
|
||||
import { ReviewsSection } from '../components/ReviewsSection.jsx'
|
||||
import { RecurringSection } from '../components/RecurringSection.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
@@ -56,6 +84,10 @@ export function InitiativeDetailPage() {
|
||||
const [blockers, setBlockers] = useState([])
|
||||
const [backlogItems, setBacklogItems] = useState([])
|
||||
const [milestones, setMilestones] = useState([])
|
||||
const [evidenceItems, setEvidenceItems] = useState([])
|
||||
const [decisions, setDecisions] = useState([])
|
||||
const [reviews, setReviews] = useState([])
|
||||
const [recurringItems, setRecurringItems] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
const [showActionForm, setShowActionForm] = useState(false)
|
||||
@@ -83,6 +115,10 @@ export function InitiativeDetailPage() {
|
||||
loads.push(listInitiativeBlockers(id).then(setBlockers).catch(() => setBlockers([])))
|
||||
loads.push(listInitiativeBacklog(id).then(setBacklogItems).catch(() => setBacklogItems([])))
|
||||
loads.push(listInitiativeMilestones(id).then(setMilestones).catch(() => setMilestones([])))
|
||||
loads.push(listInitiativeEvidence(id).then(setEvidenceItems).catch(() => setEvidenceItems([])))
|
||||
loads.push(listInitiativeDecisions(id).then(setDecisions).catch(() => setDecisions([])))
|
||||
loads.push(listInitiativeReviews(id).then(setReviews).catch(() => setReviews([])))
|
||||
loads.push(listInitiativeRecurring(id).then(setRecurringItems).catch(() => setRecurringItems([])))
|
||||
}
|
||||
await Promise.all(loads)
|
||||
} catch (err) {
|
||||
@@ -127,6 +163,8 @@ export function InitiativeDetailPage() {
|
||||
description: payload.description,
|
||||
status: payload.status,
|
||||
priority: payload.priority,
|
||||
due_at: payload.due_at,
|
||||
clear_due_at: !payload.due_at,
|
||||
})
|
||||
if (capabilities.has('kairo.action.manage')) {
|
||||
await setActionAssignments(actionId, payload.assigned_actor_ids || [])
|
||||
@@ -252,6 +290,126 @@ export function InitiativeDetailPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreateEvidence(body) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
await createInitiativeEvidence(id, body)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleEvidenceStatus(evidenceId, status) {
|
||||
try {
|
||||
await updateEvidence(evidenceId, { status })
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteEvidence(evidenceId) {
|
||||
try {
|
||||
await deleteEvidence(evidenceId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreateDecision(body) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
await createInitiativeDecision(id, body)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDecisionStatus(decisionId, status) {
|
||||
try {
|
||||
await updateDecision(decisionId, { status })
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteDecision(decisionId) {
|
||||
try {
|
||||
await deleteDecision(decisionId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreateReview(body) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
await createInitiativeReview(id, body)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleReviewStatus(reviewId, status) {
|
||||
try {
|
||||
await updateReview(reviewId, { status })
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteReview(reviewId) {
|
||||
try {
|
||||
await deleteReview(reviewId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreateRecurring(body) {
|
||||
setFormBusy(true)
|
||||
try {
|
||||
await createInitiativeRecurring(id, body)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setFormBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleRecurringStatus(recurringId, status) {
|
||||
try {
|
||||
await updateRecurring(recurringId, { status })
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteRecurring(recurringId) {
|
||||
try {
|
||||
await deleteRecurring(recurringId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="app-page">
|
||||
@@ -367,6 +525,11 @@ export function InitiativeDetailPage() {
|
||||
Zugewiesen: {action.assigned_actor_ids.length} Actor(s)
|
||||
</p>
|
||||
)}
|
||||
{action.due_at && (
|
||||
<p className="muted list-item-sub">
|
||||
Fällig: {new Date(action.due_at).toLocaleString('de-DE')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge status={action.status} />
|
||||
@@ -379,7 +542,7 @@ export function InitiativeDetailPage() {
|
||||
onChange={(e) => handleQuickStatus(action, e.target.value)}
|
||||
aria-label="Status ändern"
|
||||
>
|
||||
{['open', 'in_progress', 'blocked', 'done', 'discarded'].map((s) => (
|
||||
{ACTION_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{ACTION_STATUS_LABELS[s]}
|
||||
</option>
|
||||
@@ -438,6 +601,50 @@ export function InitiativeDetailPage() {
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<EvidenceSection
|
||||
items={evidenceItems}
|
||||
canManage={capabilities.has('kairo.evidence.manage')}
|
||||
onCreate={handleCreateEvidence}
|
||||
onUpdateStatus={handleEvidenceStatus}
|
||||
onDelete={handleDeleteEvidence}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<DecisionsSection
|
||||
items={decisions}
|
||||
canManage={capabilities.has('kairo.decision.manage')}
|
||||
onCreate={handleCreateDecision}
|
||||
onUpdateStatus={handleDecisionStatus}
|
||||
onDelete={handleDeleteDecision}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<ReviewsSection
|
||||
items={reviews}
|
||||
canManage={capabilities.has('kairo.review.manage')}
|
||||
onCreate={handleCreateReview}
|
||||
onUpdateStatus={handleReviewStatus}
|
||||
onDelete={handleDeleteReview}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<RecurringSection
|
||||
items={recurringItems}
|
||||
canManage={capabilities.has('kairo.recurring.manage')}
|
||||
onCreate={handleCreateRecurring}
|
||||
onUpdateStatus={handleRecurringStatus}
|
||||
onDelete={handleDeleteRecurring}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user