fix(A1): Übungen an Stufen binden, Gates entkoppeln, Tages-Abschluss
Deploy Development / deploy (push) Successful in 49s
Test Suite / pytest-backend (push) Failing after 4m46s
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 2s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Successful in 49s
Test Suite / pytest-backend (push) Failing after 4m46s
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 2s
Test Suite / compose-smoke (push) Has been skipped
Activity Set pro Stufe statt Gate-Titel-Recurring; Single-Active-Stufe bei Reopen; Complete heute schliesst Next Action; Heute-Panel fuer alle Uebungen der aktiven Stufe. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b7d88ce24a
commit
19e962d8ec
17 files changed
+620
-209
No files matched your search
@@ -12,54 +12,74 @@ function formatDueAt(iso) {
|
||||
}
|
||||
}
|
||||
|
||||
function activeMaturityStage(roadmapItems = []) {
|
||||
return [...roadmapItems]
|
||||
.filter((item) => item.item_type === 'maturity_stage' && item.status === 'active')
|
||||
.sort((a, b) => (a.sort_order ?? 0) - (b.sort_order ?? 0))[0]
|
||||
}
|
||||
|
||||
function practicesForStage(recurringItems = [], stageId) {
|
||||
if (!stageId) {
|
||||
return (recurringItems || []).filter((item) => item.roadmap_item_id)
|
||||
}
|
||||
return (recurringItems || []).filter((item) => item.roadmap_item_id === stageId)
|
||||
}
|
||||
|
||||
export function RecurringRhythmPanel({
|
||||
initiativeId,
|
||||
roadmapItems = [],
|
||||
recurringItems = [],
|
||||
canManage = false,
|
||||
embedded = true,
|
||||
}) {
|
||||
const sorted = [...recurringItems].sort((a, b) => {
|
||||
const statusOrder = { active: 0, paused: 1, archived: 2 }
|
||||
const diff = (statusOrder[a.status] ?? 9) - (statusOrder[b.status] ?? 9)
|
||||
if (diff !== 0) return diff
|
||||
return (a.title || '').localeCompare(b.title || '', 'de')
|
||||
})
|
||||
|
||||
const active = sorted.filter((item) => item.status === 'active')
|
||||
const stage = activeMaturityStage(roadmapItems)
|
||||
const stagePractices = practicesForStage(recurringItems, stage?.id)
|
||||
const active = stagePractices.filter((item) => item.status === 'active')
|
||||
const paused = stagePractices.filter((item) => item.status === 'paused')
|
||||
|
||||
const body =
|
||||
sorted.length === 0 ? (
|
||||
<EmptyState message="Noch keine Rhythmen — Starter-Kit oder Journey legt Übungen an." />
|
||||
!stage ? (
|
||||
<EmptyState message="Keine aktive Reifegrad-Stufe — Plan → Stufen prüfen." />
|
||||
) : stagePractices.length === 0 ? (
|
||||
<EmptyState message="Keine Übungen für diese Stufe — Starter-Kit oder Stufenwechsel prüfen." />
|
||||
) : (
|
||||
<>
|
||||
{active.length > 0 && (
|
||||
<p className="recurring-rhythm-summary muted">
|
||||
{active.length} aktive Routine{active.length === 1 ? '' : 'n'} — fällige Übung steuert
|
||||
Next Action.
|
||||
</p>
|
||||
)}
|
||||
<p className="recurring-rhythm-summary muted">
|
||||
Stufe <strong>{stage.title}</strong> — {active.length} aktiv
|
||||
{paused.length > 0 ? `, ${paused.length} pausiert` : ''}.
|
||||
</p>
|
||||
<ul className="item-list recurring-rhythm-list">
|
||||
{sorted.map((item) => (
|
||||
{[...active, ...paused].map((item) => (
|
||||
<li
|
||||
key={item.id}
|
||||
className={
|
||||
'list-item card-list-item recurring-rhythm-item' +
|
||||
(item.status === 'active' ? ' recurring-rhythm-item--active' : '')
|
||||
(item.status === 'active' ? ' recurring-rhythm-item--active' : '') +
|
||||
(item.today_completed ? ' recurring-rhythm-item--done-today' : '')
|
||||
}
|
||||
>
|
||||
<div className="list-item-main">
|
||||
<strong>{item.title}</strong>
|
||||
<span className="muted list-item-sub">
|
||||
{RECURRING_STATUS_LABELS[item.status] || item.status}
|
||||
{item.next_due_at ? ` · Fällig: ${formatDueAt(item.next_due_at)}` : ''}
|
||||
{item.today_completed ? ' · heute erledigt' : ''}
|
||||
{!item.today_completed && item.next_due_at
|
||||
? ` · Fällig: ${formatDueAt(item.next_due_at)}`
|
||||
: ''}
|
||||
</span>
|
||||
{item.today_measurement_note && (
|
||||
<span className="muted list-item-sub">Messwert: {item.today_measurement_note}</span>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p className="muted recurring-rhythm-hint">
|
||||
Rhythmen pflegen unter{' '}
|
||||
{canManage
|
||||
? 'Übungen anlegen, pausieren oder löschen unter '
|
||||
: 'Rhythmen pflegen unter '}
|
||||
<Link to={scopedPath('/control/journey', { initiativeId })} className="link-inline">
|
||||
Kontrolle → Journey
|
||||
Kontrolle → Journey → Wiederkehrend
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
@@ -72,9 +92,9 @@ export function RecurringRhythmPanel({
|
||||
<section className="card recurring-rhythm-panel">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h2>Rhythmen & Übungen</h2>
|
||||
<h2>Übungen der Stufe</h2>
|
||||
<p className="section-lead muted">
|
||||
Aktive Routinen am Reifegrad-Pfad — Leading Next aus fälliger Übung (A1).
|
||||
Activity Set der aktiven Reifegrad-Stufe — nicht die Gates selbst (A1).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user