AP2.2f: Scrum Sprint-Review, Reaktivierung und Carryover beim Abschluss.
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 2m58s
Test Suite / lint-backend (push) Successful in 4s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 1m1s
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 2m58s
Test Suite / lint-backend (push) Successful in 4s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 19s
Test Suite / playwright-smoke (push) Successful in 1m1s
Offene APs können beim Abschluss in den Eingang oder einen anderen Sprint überführt werden; abgeschlossene Sprints sind reaktivierbar. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e65838118c
commit
04d1dbf1f9
14 files changed
+719
-31
No files matched your search
@@ -0,0 +1,258 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { Modal } from './Modal.jsx'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { listCarryoverTargetSprints } from '../utils/workCycleActions.js'
|
||||
|
||||
const DISPOSITION = {
|
||||
BACKLOG: 'backlog',
|
||||
MOVE: 'move',
|
||||
KEEP: 'keep',
|
||||
}
|
||||
|
||||
/**
|
||||
* Sprint Review & Abschluss — offene APs vor Complete behandeln (Scrum Carryover).
|
||||
*/
|
||||
export function SprintCompleteDialog({
|
||||
open,
|
||||
cycle,
|
||||
openActions = [],
|
||||
workCycles = [],
|
||||
busy = false,
|
||||
onClose,
|
||||
onConfirm,
|
||||
}) {
|
||||
const targetSprints = useMemo(
|
||||
() => listCarryoverTargetSprints(workCycles, cycle?.id),
|
||||
[workCycles, cycle?.id],
|
||||
)
|
||||
|
||||
const [dispositions, setDispositions] = useState({})
|
||||
const [bulkTargetCycleId, setBulkTargetCycleId] = useState('')
|
||||
const [validationError, setValidationError] = useState('')
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !openActions.length) return
|
||||
const initial = {}
|
||||
for (const action of openActions) {
|
||||
initial[action.id] = {
|
||||
disposition: DISPOSITION.BACKLOG,
|
||||
targetCycleId: targetSprints[0]?.id || '',
|
||||
}
|
||||
}
|
||||
setDispositions(initial)
|
||||
setBulkTargetCycleId(targetSprints[0]?.id || '')
|
||||
setValidationError('')
|
||||
}, [open, openActions, targetSprints])
|
||||
|
||||
function setDisposition(actionId, patch) {
|
||||
setDispositions((prev) => ({
|
||||
...prev,
|
||||
[actionId]: { ...prev[actionId], ...patch },
|
||||
}))
|
||||
setValidationError('')
|
||||
}
|
||||
|
||||
function applyBulkBacklog() {
|
||||
setDispositions((prev) => {
|
||||
const next = { ...prev }
|
||||
for (const action of openActions) {
|
||||
next[action.id] = { disposition: DISPOSITION.BACKLOG, targetCycleId: '' }
|
||||
}
|
||||
return next
|
||||
})
|
||||
}
|
||||
|
||||
function applyBulkMove() {
|
||||
if (!bulkTargetCycleId) {
|
||||
setValidationError('Bitte einen Ziel-Sprint für die Sammel-Verschiebung wählen.')
|
||||
return
|
||||
}
|
||||
setDispositions((prev) => {
|
||||
const next = { ...prev }
|
||||
for (const action of openActions) {
|
||||
next[action.id] = {
|
||||
disposition: DISPOSITION.MOVE,
|
||||
targetCycleId: bulkTargetCycleId,
|
||||
}
|
||||
}
|
||||
return next
|
||||
})
|
||||
setValidationError('')
|
||||
}
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
const keepCount = openActions.filter(
|
||||
(a) => dispositions[a.id]?.disposition === DISPOSITION.KEEP,
|
||||
).length
|
||||
const moveMissing = openActions.some(
|
||||
(a) =>
|
||||
dispositions[a.id]?.disposition === DISPOSITION.MOVE &&
|
||||
!dispositions[a.id]?.targetCycleId,
|
||||
)
|
||||
if (moveMissing) {
|
||||
setValidationError('Für „Anderer Sprint" muss ein Ziel-Sprint gewählt sein.')
|
||||
return
|
||||
}
|
||||
if (keepCount > 0) {
|
||||
const ok = window.confirm(
|
||||
`${keepCount} Arbeitspaket${keepCount === 1 ? '' : 'e'} bleiben am abgeschlossenen Sprint. ` +
|
||||
'Das entspricht nicht dem üblichen Scrum-Carryover. Trotzdem abschließen?',
|
||||
)
|
||||
if (!ok) return
|
||||
}
|
||||
await onConfirm(dispositions)
|
||||
}
|
||||
|
||||
if (!cycle) return null
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
title={`Sprint Review & Abschluss — ${cycle.title}`}
|
||||
onClose={onClose}
|
||||
size="lg"
|
||||
>
|
||||
<form className="form sprint-complete-dialog" onSubmit={handleSubmit}>
|
||||
<p className="section-lead muted">
|
||||
Sprint Review (Scrum): Inkrement prüfen und offene Arbeitspakete vor dem Abschluss
|
||||
in den Eingang oder einen anderen Sprint überführen.
|
||||
</p>
|
||||
|
||||
{openActions.length === 0 ? (
|
||||
<p className="muted">Alle Arbeitspakete sind erledigt — Sprint kann abgeschlossen werden.</p>
|
||||
) : (
|
||||
<>
|
||||
<div className="sprint-complete-dialog__warning card-list-item">
|
||||
<strong>
|
||||
{openActions.length} offene Arbeitspaket
|
||||
{openActions.length === 1 ? '' : 'e'}
|
||||
</strong>
|
||||
<p className="muted">
|
||||
Nicht erledigte APs sollten vor dem Abschluss umgeplant werden.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="sprint-complete-dialog__bulk">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={busy}
|
||||
onClick={applyBulkBacklog}
|
||||
>
|
||||
Alle → Eingang
|
||||
</button>
|
||||
<label className="sprint-complete-dialog__bulk-move">
|
||||
<span className="muted">Alle → Sprint</span>
|
||||
<select
|
||||
value={bulkTargetCycleId}
|
||||
onChange={(e) => setBulkTargetCycleId(e.target.value)}
|
||||
disabled={busy || targetSprints.length === 0}
|
||||
>
|
||||
<option value="">— Sprint wählen —</option>
|
||||
{targetSprints.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.title}
|
||||
{s.status === 'active' ? ' (aktiv)' : ''}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={busy || !bulkTargetCycleId}
|
||||
onClick={applyBulkMove}
|
||||
>
|
||||
Anwenden
|
||||
</button>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<ul className="item-list sprint-complete-dialog__list">
|
||||
{openActions.map((action) => {
|
||||
const row = dispositions[action.id] || {}
|
||||
return (
|
||||
<li key={action.id} className="list-item card-list-item sprint-complete-row">
|
||||
<div className="sprint-complete-row__main">
|
||||
<strong>{action.title}</strong>
|
||||
<StatusBadge status={action.status} />
|
||||
</div>
|
||||
<div className="sprint-complete-row__choices">
|
||||
<label className="radio-label">
|
||||
<input
|
||||
type="radio"
|
||||
name={`disp-${action.id}`}
|
||||
checked={row.disposition === DISPOSITION.BACKLOG}
|
||||
onChange={() =>
|
||||
setDisposition(action.id, { disposition: DISPOSITION.BACKLOG })
|
||||
}
|
||||
disabled={busy}
|
||||
/>
|
||||
In Eingang
|
||||
</label>
|
||||
<label className="radio-label">
|
||||
<input
|
||||
type="radio"
|
||||
name={`disp-${action.id}`}
|
||||
checked={row.disposition === DISPOSITION.MOVE}
|
||||
onChange={() =>
|
||||
setDisposition(action.id, {
|
||||
disposition: DISPOSITION.MOVE,
|
||||
targetCycleId: row.targetCycleId || bulkTargetCycleId,
|
||||
})
|
||||
}
|
||||
disabled={busy || targetSprints.length === 0}
|
||||
/>
|
||||
Anderer Sprint
|
||||
</label>
|
||||
{row.disposition === DISPOSITION.MOVE && (
|
||||
<select
|
||||
value={row.targetCycleId || ''}
|
||||
onChange={(e) =>
|
||||
setDisposition(action.id, { targetCycleId: e.target.value })
|
||||
}
|
||||
disabled={busy}
|
||||
aria-label={`Ziel-Sprint für ${action.title}`}
|
||||
>
|
||||
<option value="">— Sprint —</option>
|
||||
{targetSprints.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.title}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
<label className="radio-label">
|
||||
<input
|
||||
type="radio"
|
||||
name={`disp-${action.id}`}
|
||||
checked={row.disposition === DISPOSITION.KEEP}
|
||||
onChange={() =>
|
||||
setDisposition(action.id, { disposition: DISPOSITION.KEEP })
|
||||
}
|
||||
disabled={busy}
|
||||
/>
|
||||
Am Sprint belassen
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</>
|
||||
)}
|
||||
|
||||
{validationError && <p className="error">{validationError}</p>}
|
||||
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
{busy ? 'Abschließen …' : 'Sprint abschließen'}
|
||||
</button>
|
||||
<button type="button" className="btn btn-secondary" onClick={onClose} disabled={busy}>
|
||||
Abbrechen
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
import { useState } from 'react'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
import { SprintCompleteDialog } from './SprintCompleteDialog.jsx'
|
||||
import { listOpenActionsForWorkCycle } from '../utils/workCycleActions.js'
|
||||
|
||||
const SPRINT_LIFECYCLE = [
|
||||
{ key: 'planned', label: 'Planung' },
|
||||
{ key: 'active', label: 'Ausführung' },
|
||||
{ key: 'reached', label: 'Abgeschlossen' },
|
||||
/** Scrum Sprint-Phasen (UI — mapped auf work_cycle-Status). */
|
||||
const SCRUM_SPRINT_PHASES = [
|
||||
{ key: 'planning', label: 'Sprint Planning', hint: 'Backlog & Ziel' },
|
||||
{ key: 'execution', label: 'Sprint', hint: 'Daily / Ausführung' },
|
||||
{ key: 'review', label: 'Sprint Review', hint: 'Inkrement prüfen' },
|
||||
{ key: 'done', label: 'Retro & Done', hint: 'Abschluss' },
|
||||
]
|
||||
|
||||
function lifecycleStepIndex(status) {
|
||||
if (status === 'reached') return 2
|
||||
if (status === 'reached') return 3
|
||||
if (status === 'active' || status === 'at_risk') return 1
|
||||
return 0
|
||||
}
|
||||
@@ -18,17 +22,25 @@ export function WorkCyclesPanel({
|
||||
workCycles = [],
|
||||
activeWorkCycle = null,
|
||||
selectedSprintId = '',
|
||||
actions = [],
|
||||
actionCountByCycleId = {},
|
||||
canManage,
|
||||
onCreate,
|
||||
onActivate,
|
||||
onComplete,
|
||||
onCompleteWithCarryover,
|
||||
onReactivate,
|
||||
onSelectSprint,
|
||||
busy = false,
|
||||
}) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [goal, setGoal] = useState('')
|
||||
const [activateOnCreate, setActivateOnCreate] = useState(true)
|
||||
const [completeTarget, setCompleteTarget] = useState(null)
|
||||
|
||||
const completeOpenActions = completeTarget
|
||||
? listOpenActionsForWorkCycle(actions, completeTarget.id)
|
||||
: []
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
@@ -43,16 +55,30 @@ export function WorkCyclesPanel({
|
||||
setGoal('')
|
||||
}
|
||||
|
||||
async function handleComplete(cycle) {
|
||||
const openCount = actionCountByCycleId[cycle.id] || 0
|
||||
if (openCount > 0) {
|
||||
const ok = window.confirm(
|
||||
`Sprint „${cycle.title}" hat noch ${openCount} offene Arbeitspaket${openCount === 1 ? '' : 'e'}. ` +
|
||||
'Trotzdem abschließen? Offene APs bleiben dem Sprint zugeordnet und können in den Eingang zurückgeschoben werden.',
|
||||
)
|
||||
if (!ok) return
|
||||
function openCompleteDialog(cycle) {
|
||||
setCompleteTarget(cycle)
|
||||
}
|
||||
|
||||
function closeCompleteDialog() {
|
||||
if (!busy) setCompleteTarget(null)
|
||||
}
|
||||
|
||||
async function handleCompleteConfirm(dispositions) {
|
||||
if (!completeTarget) return
|
||||
if (typeof onCompleteWithCarryover === 'function') {
|
||||
await onCompleteWithCarryover(completeTarget.id, dispositions)
|
||||
} else {
|
||||
await onComplete(completeTarget.id)
|
||||
}
|
||||
await onComplete(cycle.id)
|
||||
setCompleteTarget(null)
|
||||
}
|
||||
|
||||
async function handleReactivate(cycleId) {
|
||||
const ok = window.confirm(
|
||||
'Sprint wieder aktivieren? Der Sprint wird erneut als laufend markiert (versehentlicher Abschluss).',
|
||||
)
|
||||
if (!ok) return
|
||||
await onReactivate(cycleId)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -61,9 +87,9 @@ export function WorkCyclesPanel({
|
||||
<div>
|
||||
<h2>Sprint</h2>
|
||||
<p className="section-lead muted">
|
||||
Sprint anklicken, um den geplanten Sprint-Backlog zu sehen — aktiv oder geplant.
|
||||
Committete Arbeitspakete aus dem Eingang erscheinen beim gewählten Sprint.
|
||||
Lebenszyklus: Planung → Ausführung → Abschluss (Scrum).
|
||||
Scrum-Lebenszyklus: Sprint Planning → Sprint → Sprint Review → Retro & Done.
|
||||
Beim Abschluss werden offene Arbeitspakete in den Eingang oder einen anderen Sprint
|
||||
überführt.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,8 +165,11 @@ export function WorkCyclesPanel({
|
||||
<span className="muted work-cycle-row__count">
|
||||
{apCount} AP{apCount === 1 ? '' : 's'}
|
||||
</span>
|
||||
<div className="work-cycle-lifecycle muted" aria-label="Sprint-Lebenszyklus">
|
||||
{SPRINT_LIFECYCLE.map((phase, index) => (
|
||||
<div
|
||||
className="work-cycle-lifecycle"
|
||||
aria-label="Scrum Sprint-Lebenszyklus"
|
||||
>
|
||||
{SCRUM_SPRINT_PHASES.map((phase, index) => (
|
||||
<span
|
||||
key={phase.key}
|
||||
className={
|
||||
@@ -148,9 +177,10 @@ export function WorkCyclesPanel({
|
||||
(index === step ? ' work-cycle-lifecycle__step--current' : '') +
|
||||
(index < step ? ' work-cycle-lifecycle__step--done' : '')
|
||||
}
|
||||
title={phase.hint}
|
||||
>
|
||||
{phase.label}
|
||||
{index < SPRINT_LIFECYCLE.length - 1 && (
|
||||
<span className="work-cycle-lifecycle__label">{phase.label}</span>
|
||||
{index < SCRUM_SPRINT_PHASES.length - 1 && (
|
||||
<span className="work-cycle-lifecycle__sep" aria-hidden="true">
|
||||
→
|
||||
</span>
|
||||
@@ -168,9 +198,9 @@ export function WorkCyclesPanel({
|
||||
type="button"
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={busy}
|
||||
onClick={() => handleComplete(cycle)}
|
||||
onClick={() => openCompleteDialog(cycle)}
|
||||
>
|
||||
Abschließen
|
||||
Review & Abschließen
|
||||
</button>
|
||||
)}
|
||||
{canManage && cycle.status !== 'active' && cycle.status !== 'reached' && (
|
||||
@@ -183,12 +213,32 @@ export function WorkCyclesPanel({
|
||||
Aktivieren
|
||||
</button>
|
||||
)}
|
||||
{canManage && cycle.status === 'reached' && typeof onReactivate === 'function' && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary btn-sm"
|
||||
disabled={busy}
|
||||
onClick={() => handleReactivate(cycle.id)}
|
||||
>
|
||||
Reaktivieren
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
<SprintCompleteDialog
|
||||
open={Boolean(completeTarget)}
|
||||
cycle={completeTarget}
|
||||
openActions={completeOpenActions}
|
||||
workCycles={workCycles}
|
||||
busy={busy}
|
||||
onClose={closeCompleteDialog}
|
||||
onConfirm={handleCompleteConfirm}
|
||||
/>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user