AP1.1b: Vorhaben-Detail als Steuerungsfläche — Action-Hub statt paralleler Listen
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 1m26s
Test Suite / lint-backend (push) Successful in 1s
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 46s
Test Suite / pytest-backend (push) Successful in 1m26s
Test Suite / lint-backend (push) Successful in 1s
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
Leitfrage oben, Maßnahmen mit verknüpftem Kontext aus dem Snapshot, vollständiges Meilenstein-Formular, Backlog/Entscheidungen/Nachweise unter Erweitert. Version 0.11.2-ap1.1b.
This commit is contained in:
1 parent
fc956d4ceb
commit
a520d54bcf
10 files changed
+852
-314
No files matched your search
@@ -50,10 +50,8 @@ import {
|
||||
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'
|
||||
@@ -62,8 +60,9 @@ import { DecisionsSection } from '../components/DecisionsSection.jsx'
|
||||
import { ReviewsSection } from '../components/ReviewsSection.jsx'
|
||||
import { RecurringSection } from '../components/RecurringSection.jsx'
|
||||
import { SteeringSnapshotPanel } from '../components/SteeringSnapshotPanel.jsx'
|
||||
import { InitiativeActionsHub } from '../components/InitiativeActionsHub.jsx'
|
||||
import { CollapsibleSection } from '../components/CollapsibleSection.jsx'
|
||||
import { listSteeringMethods, updateInitiativeSteeringMethod } from '../api/steering.js'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
import { useCapabilities } from '../hooks/useCapabilities.js'
|
||||
@@ -165,6 +164,20 @@ export function InitiativeDetailPage() {
|
||||
(steeringSnapshot?.actions || []).map((a) => [a.id, a])
|
||||
)
|
||||
|
||||
const unlinkedBlockers = blockers.filter((b) => !b.action_id)
|
||||
|
||||
const advancedSummary = (() => {
|
||||
const c = steeringSnapshot?.counts
|
||||
const parts = []
|
||||
if (backlogItems.length) parts.push(`${backlogItems.length} Backlog`)
|
||||
if (decisions.length) parts.push(`${decisions.length} Entscheidungen`)
|
||||
if (recurringItems.length) parts.push(`${recurringItems.length} Wiederkehrend`)
|
||||
if (unlinkedBlockers.length) parts.push(`${unlinkedBlockers.length} lose Blocker`)
|
||||
if (c?.unlinked_evidence) parts.push(`${c.unlinked_evidence} lose Nachweise`)
|
||||
if (reviews.length) parts.push(`${reviews.length} Reviews`)
|
||||
return parts.length ? parts.join(' · ') : 'Backlog, Entscheidungen, Nachweise …'
|
||||
})()
|
||||
|
||||
async function handleMethodChange(methodKey) {
|
||||
setMethodBusy(true)
|
||||
try {
|
||||
@@ -523,140 +536,32 @@ export function InitiativeDetailPage() {
|
||||
/>
|
||||
)}
|
||||
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<h2>Maßnahmen</h2>
|
||||
<div className="section-actions">
|
||||
<label className="checkbox-label inline-filter">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={hideDone}
|
||||
onChange={(e) => setHideDone(e.target.checked)}
|
||||
/>
|
||||
Erledigte ausblenden
|
||||
</label>
|
||||
{capabilities.has('kairo.action.manage') && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => { setShowActionForm((v) => !v); setEditingAction(null) }}
|
||||
>
|
||||
{showActionForm ? 'Abbrechen' : 'Maßnahme anlegen'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{showActionForm && (
|
||||
<div className="inline-form-block">
|
||||
<ActionForm
|
||||
actors={actors}
|
||||
actorsLoading={actorsLoading}
|
||||
actorsError={actorsError}
|
||||
actorsUsedFallback={actorsUsedFallback}
|
||||
onReloadActors={reloadActors}
|
||||
onSubmit={handleCreateAction}
|
||||
onCancel={() => setShowActionForm(false)}
|
||||
busy={formBusy}
|
||||
submitLabel="Maßnahme anlegen"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{visibleActions.length === 0 && (
|
||||
<EmptyState message="Noch keine Maßnahmen in diesem Vorhaben." />
|
||||
)}
|
||||
|
||||
<ul className="item-list actions-detail-list">
|
||||
{visibleActions.map((action) => {
|
||||
const ctx = actionContextById[action.id]
|
||||
return (
|
||||
<li key={action.id} className="list-item card-list-item">
|
||||
{editingAction === action.id ? (
|
||||
<ActionForm
|
||||
initial={action}
|
||||
actors={actors}
|
||||
actorsLoading={actorsLoading}
|
||||
actorsError={actorsError}
|
||||
actorsUsedFallback={actorsUsedFallback}
|
||||
onReloadActors={reloadActors}
|
||||
onSubmit={(payload) => handleUpdateAction(action.id, payload)}
|
||||
onCancel={() => setEditingAction(null)}
|
||||
busy={formBusy}
|
||||
submitLabel="Speichern"
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<div className="list-item-main">
|
||||
<strong>{action.title}</strong>
|
||||
{action.description && (
|
||||
<p className="list-item-desc">{action.description}</p>
|
||||
)}
|
||||
{action.assigned_actor_ids?.length > 0 && (
|
||||
<p className="muted list-item-sub">
|
||||
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>
|
||||
)}
|
||||
{ctx && (ctx.open_blocker_count > 0 || ctx.evidence?.length > 0 || ctx.reviews?.length > 0) && (
|
||||
<p className="muted list-item-sub action-links">
|
||||
{ctx.open_blocker_count > 0 && `${ctx.open_blocker_count} Blocker · `}
|
||||
{ctx.evidence?.length > 0 && `${ctx.evidence.length} Evidence · `}
|
||||
{ctx.reviews?.length > 0 && `${ctx.reviews.length} Review(s)`}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge status={action.status} />
|
||||
<PriorityBadge priority={action.priority} />
|
||||
{capabilities.has('kairo.action.manage') && (
|
||||
<>
|
||||
<select
|
||||
className="inline-select"
|
||||
value={action.status}
|
||||
onChange={(e) => handleQuickStatus(action, e.target.value)}
|
||||
aria-label="Status ändern"
|
||||
>
|
||||
{ACTION_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{ACTION_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
{capabilities.has('kairo.blocker.manage') && action.status !== 'done' && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => handleCreateBlockerForAction(action.id)}
|
||||
disabled={formBusy}
|
||||
>
|
||||
Blocker
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => {
|
||||
setEditingAction(action.id)
|
||||
setShowActionForm(false)
|
||||
}}
|
||||
>
|
||||
Bearbeiten
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</section>
|
||||
<InitiativeActionsHub
|
||||
actions={visibleActions}
|
||||
actionContextById={actionContextById}
|
||||
hideDone={hideDone}
|
||||
onHideDoneChange={setHideDone}
|
||||
showForm={showActionForm}
|
||||
onToggleForm={() => {
|
||||
setShowActionForm((v) => !v)
|
||||
setEditingAction(null)
|
||||
}}
|
||||
editingActionId={editingAction}
|
||||
onEditAction={setEditingAction}
|
||||
onCancelEdit={() => setEditingAction(null)}
|
||||
onCreateAction={handleCreateAction}
|
||||
onUpdateAction={handleUpdateAction}
|
||||
onQuickStatus={handleQuickStatus}
|
||||
onCreateBlockerForAction={handleCreateBlockerForAction}
|
||||
canManage={capabilities.has('kairo.action.manage')}
|
||||
canManageBlocker={capabilities.has('kairo.blocker.manage')}
|
||||
formBusy={formBusy}
|
||||
actors={actors}
|
||||
actorsLoading={actorsLoading}
|
||||
actorsError={actorsError}
|
||||
actorsUsedFallback={actorsUsedFallback}
|
||||
onReloadActors={reloadActors}
|
||||
/>
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<MilestonesSection
|
||||
@@ -670,70 +575,62 @@ export function InitiativeDetailPage() {
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<BacklogSection
|
||||
items={backlogItems}
|
||||
canManage={capabilities.has('kairo.backlog.manage')}
|
||||
onCreate={handleCreateBacklog}
|
||||
onUpdateStatus={handleBacklogStatus}
|
||||
onConvert={handleConvertBacklog}
|
||||
onDelete={handleDeleteBacklog}
|
||||
busy={formBusy}
|
||||
/>
|
||||
)}
|
||||
|
||||
{capabilities.has('kairo.initiative.read') && (
|
||||
<BlockersSection
|
||||
blockers={blockers}
|
||||
canManage={capabilities.has('kairo.blocker.manage')}
|
||||
onCreate={handleCreateBlocker}
|
||||
onUpdateStatus={handleBlockerStatus}
|
||||
onDelete={handleDeleteBlocker}
|
||||
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}
|
||||
/>
|
||||
<CollapsibleSection title="Erweitert" summary={advancedSummary}>
|
||||
<div className="initiative-advanced-stack">
|
||||
<BacklogSection
|
||||
items={backlogItems}
|
||||
canManage={capabilities.has('kairo.backlog.manage')}
|
||||
onCreate={handleCreateBacklog}
|
||||
onUpdateStatus={handleBacklogStatus}
|
||||
onConvert={handleConvertBacklog}
|
||||
onDelete={handleDeleteBacklog}
|
||||
busy={formBusy}
|
||||
/>
|
||||
<DecisionsSection
|
||||
items={decisions}
|
||||
canManage={capabilities.has('kairo.decision.manage')}
|
||||
onCreate={handleCreateDecision}
|
||||
onUpdateStatus={handleDecisionStatus}
|
||||
onDelete={handleDeleteDecision}
|
||||
busy={formBusy}
|
||||
/>
|
||||
<RecurringSection
|
||||
items={recurringItems}
|
||||
canManage={capabilities.has('kairo.recurring.manage')}
|
||||
onCreate={handleCreateRecurring}
|
||||
onUpdateStatus={handleRecurringStatus}
|
||||
onDelete={handleDeleteRecurring}
|
||||
busy={formBusy}
|
||||
/>
|
||||
<BlockersSection
|
||||
blockers={unlinkedBlockers}
|
||||
heading="Vorhaben-Blocker"
|
||||
lead="Ohne Maßnahmenbezug — verknüpfte Blocker erscheinen am Maßnahmen-Hub."
|
||||
emptyMessage="Keine vorhabenweiten Blocker."
|
||||
canManage={capabilities.has('kairo.blocker.manage')}
|
||||
onCreate={handleCreateBlocker}
|
||||
onUpdateStatus={handleBlockerStatus}
|
||||
onDelete={handleDeleteBlocker}
|
||||
busy={formBusy}
|
||||
/>
|
||||
<EvidenceSection
|
||||
items={evidenceItems}
|
||||
canManage={capabilities.has('kairo.evidence.manage')}
|
||||
onCreate={handleCreateEvidence}
|
||||
onUpdateStatus={handleEvidenceStatus}
|
||||
onDelete={handleDeleteEvidence}
|
||||
busy={formBusy}
|
||||
/>
|
||||
<ReviewsSection
|
||||
items={reviews}
|
||||
canManage={capabilities.has('kairo.review.manage')}
|
||||
onCreate={handleCreateReview}
|
||||
onUpdateStatus={handleReviewStatus}
|
||||
onDelete={handleDeleteReview}
|
||||
busy={formBusy}
|
||||
/>
|
||||
</div>
|
||||
</CollapsibleSection>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user