AP1.5: Project, Task und Ausführung als Ist-Kern
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 1m39s
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 44s
Test Suite / pytest-backend (push) Successful in 1m39s
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 013; Projekte/Arbeitspakete/Aufgaben pflegbar; Tab Zielzustände vs Ausführung. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e7651812a
commit
6eeddfdc76
27 files changed
+1459
-50
No files matched your search
@@ -11,6 +11,7 @@ function isoToLocalInput(iso) {
|
||||
|
||||
export function ActionForm({
|
||||
initial = {},
|
||||
projects = [],
|
||||
actors = [],
|
||||
actorsLoading = false,
|
||||
actorsError = null,
|
||||
@@ -31,6 +32,7 @@ export function ActionForm({
|
||||
status: form.status.value,
|
||||
priority: form.priority.value,
|
||||
due_at: form.due_at.value ? new Date(form.due_at.value).toISOString() : null,
|
||||
project_id: form.project_id?.value || undefined,
|
||||
assigned_actor_ids: selected,
|
||||
})
|
||||
}
|
||||
@@ -75,6 +77,19 @@ export function ActionForm({
|
||||
defaultValue={isoToLocalInput(initial.due_at)}
|
||||
/>
|
||||
</label>
|
||||
{projects.length > 0 && (
|
||||
<label>
|
||||
Projekt (optional)
|
||||
<select name="project_id" defaultValue={initial.project_id || ''}>
|
||||
<option value="">— keins —</option>
|
||||
{projects.map((p) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.title}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
<ActorSelect
|
||||
actors={actors}
|
||||
defaultSelected={defaultActors}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { EmptyState } from './EmptyState.jsx'
|
||||
export function InitiativeActionsHub({
|
||||
initiativeId,
|
||||
actions,
|
||||
projects = [],
|
||||
actionContextById,
|
||||
hideDone,
|
||||
onHideDoneChange,
|
||||
@@ -30,9 +31,10 @@ export function InitiativeActionsHub({
|
||||
<section className="card initiative-actions-hub">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h2>Maßnahmen — operative Arbeit</h2>
|
||||
<h2>Arbeitspakete</h2>
|
||||
<p className="section-lead muted">
|
||||
Blocker, Nachweise und Reviews hängen an der Maßnahme, nicht lose im Vorhaben.
|
||||
Committete operative Einheit — Aufgaben im Detail. Blocker, Nachweise und Reviews
|
||||
hängen am Arbeitspaket.
|
||||
</p>
|
||||
</div>
|
||||
<div className="section-actions">
|
||||
@@ -50,7 +52,7 @@ export function InitiativeActionsHub({
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={onToggleForm}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Maßnahme anlegen'}
|
||||
{showForm ? 'Abbrechen' : 'Arbeitspaket'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
@@ -59,6 +61,7 @@ export function InitiativeActionsHub({
|
||||
{showForm && canManage && (
|
||||
<div className="inline-form-block">
|
||||
<ActionForm
|
||||
projects={projects}
|
||||
actors={actors}
|
||||
actorsLoading={actorsLoading}
|
||||
actorsError={actorsError}
|
||||
@@ -67,13 +70,13 @@ export function InitiativeActionsHub({
|
||||
onSubmit={onCreateAction}
|
||||
onCancel={onToggleForm}
|
||||
busy={formBusy}
|
||||
submitLabel="Maßnahme anlegen"
|
||||
submitLabel="Arbeitspaket anlegen"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{actions.length === 0 && (
|
||||
<EmptyState message="Noch keine Maßnahmen — lege die erste operative Maßnahme an oder wandle Backlog um." />
|
||||
<EmptyState message="Noch keine Arbeitspakete — lege operative Schritte an oder wandle Backlog um." />
|
||||
)}
|
||||
|
||||
<div className="action-hub-grid">
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NavLink, useParams } from 'react-router-dom'
|
||||
|
||||
const TABS = [
|
||||
{ to: '', label: 'Steuerung', end: true },
|
||||
{ to: 'plan', label: 'Plan' },
|
||||
{ to: 'plan', label: 'Zielzustände' },
|
||||
{ to: 'execution', label: 'Ausführung' },
|
||||
{ to: 'inbox', label: 'Eingang' },
|
||||
{ to: 'journey', label: 'Nachvollziehbarkeit' },
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
import { useState } from 'react'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
import { StatusBadge } from './StatusBadge.jsx'
|
||||
|
||||
export function ProjectsSection({
|
||||
projects,
|
||||
selectedProjectId,
|
||||
onSelectProject,
|
||||
canManage,
|
||||
onCreate,
|
||||
onDelete,
|
||||
busy,
|
||||
}) {
|
||||
const [title, setTitle] = useState('')
|
||||
const [description, setDescription] = useState('')
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
async function handleSubmit(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
await onCreate({
|
||||
title: title.trim(),
|
||||
description: description.trim(),
|
||||
})
|
||||
setTitle('')
|
||||
setDescription('')
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="card projects-section">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h2>Projekte</h2>
|
||||
<p className="section-lead muted">
|
||||
Operative Struktur — Arbeitspakete gruppieren. Zielzustände (Gates) sind optional.
|
||||
</p>
|
||||
</div>
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-block-mobile"
|
||||
onClick={() => setShowForm((v) => !v)}
|
||||
>
|
||||
{showForm ? 'Abbrechen' : 'Projekt'}
|
||||
</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
|
||||
placeholder="z. B. Phase 1 — Grundlagen"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Beschreibung
|
||||
<textarea
|
||||
value={description}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
rows={2}
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{projects.length === 0 && (
|
||||
<EmptyState message="Noch keine Projekte — optional. Du kannst auch direkt Arbeitspakete anlegen." />
|
||||
)}
|
||||
|
||||
<ul className="item-list project-filter-list">
|
||||
<li className="list-item card-list-item">
|
||||
<button
|
||||
type="button"
|
||||
className={`btn btn-secondary${selectedProjectId === '' ? ' btn-primary' : ''}`}
|
||||
onClick={() => onSelectProject('')}
|
||||
>
|
||||
Alle Arbeitspakete
|
||||
</button>
|
||||
</li>
|
||||
{projects.map((project) => (
|
||||
<li key={project.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<button
|
||||
type="button"
|
||||
className="link-button"
|
||||
onClick={() =>
|
||||
onSelectProject(selectedProjectId === project.id ? '' : project.id)
|
||||
}
|
||||
>
|
||||
<strong>{project.title}</strong>
|
||||
</button>
|
||||
{project.description && (
|
||||
<p className="list-item-desc muted">{project.description}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
<StatusBadge kind="initiative" status={project.status} />
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
disabled={busy}
|
||||
onClick={() => onDelete(project.id)}
|
||||
>
|
||||
Löschen
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -67,10 +67,10 @@ export function RoadmapPlanSection({
|
||||
<section className="card">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h2>Plan</h2>
|
||||
<h2>Zielzustände (Gates)</h2>
|
||||
<p className="section-lead muted">
|
||||
Roadmap-Elemente methodenneutral — Gates, Reifegrade oder Review-Punkte.
|
||||
Erreicht nur über Verify (Evidence, Review oder Decision).
|
||||
Überprüfbare Zielpunkte — optional. Operative Planung läuft unter Ausführung.
|
||||
Erreicht nur über Verify (Kriterien, Evidence, Review).
|
||||
</p>
|
||||
</div>
|
||||
{canManage && (
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import {
|
||||
createActionTask,
|
||||
deleteTask,
|
||||
listActionTasks,
|
||||
updateTask,
|
||||
} from '../api/tasks.js'
|
||||
import { TASK_STATUSES, TASK_STATUS_LABELS } from '../constants/status.js'
|
||||
import { EmptyState } from './EmptyState.jsx'
|
||||
|
||||
export function TasksSection({ actionId, canManage }) {
|
||||
const [tasks, setTasks] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [title, setTitle] = useState('')
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!actionId) return
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
setTasks(await listActionTasks(actionId))
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [actionId])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
async function handleCreate(e) {
|
||||
e.preventDefault()
|
||||
if (!title.trim()) return
|
||||
setBusy(true)
|
||||
try {
|
||||
await createActionTask(actionId, { title: title.trim() })
|
||||
setTitle('')
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleStatus(taskId, status) {
|
||||
setBusy(true)
|
||||
try {
|
||||
await updateTask(taskId, { status })
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDelete(taskId) {
|
||||
setBusy(true)
|
||||
try {
|
||||
await deleteTask(taskId)
|
||||
await load()
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setBusy(false)
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) return <p className="muted">Tasks werden geladen…</p>
|
||||
|
||||
return (
|
||||
<section className="card tasks-section">
|
||||
<div className="section-header">
|
||||
<div>
|
||||
<h3>Aufgaben</h3>
|
||||
<p className="section-lead muted">
|
||||
Kleinste ausführbare Schritte — später Zuordnung zu Gates (Zielerreichung).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{error && <p className="error">{error}</p>}
|
||||
|
||||
{canManage && (
|
||||
<form className="inline-form-block task-inline-form" onSubmit={handleCreate}>
|
||||
<label>
|
||||
Neue Aufgabe
|
||||
<input
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
maxLength={255}
|
||||
required
|
||||
placeholder="Konkreter nächster Schritt"
|
||||
/>
|
||||
</label>
|
||||
<button type="submit" className="btn btn-primary" disabled={busy}>
|
||||
Hinzufügen
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{tasks.length === 0 && (
|
||||
<EmptyState message="Noch keine Aufgaben — zerlege das Arbeitspaket in umsetzbare Schritte." />
|
||||
)}
|
||||
|
||||
<ul className="item-list task-list">
|
||||
{tasks.map((task) => (
|
||||
<li key={task.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<strong>{task.title}</strong>
|
||||
</div>
|
||||
<div className="list-item-meta action-controls">
|
||||
{canManage ? (
|
||||
<select
|
||||
className="inline-select"
|
||||
value={task.status}
|
||||
disabled={busy}
|
||||
onChange={(e) => handleStatus(task.id, e.target.value)}
|
||||
aria-label="Task-Status"
|
||||
>
|
||||
{TASK_STATUSES.map((s) => (
|
||||
<option key={s} value={s}>
|
||||
{TASK_STATUS_LABELS[s]}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : (
|
||||
<span>{TASK_STATUS_LABELS[task.status] || task.status}</span>
|
||||
)}
|
||||
{canManage && (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
disabled={busy}
|
||||
onClick={() => handleDelete(task.id)}
|
||||
>
|
||||
Entfernen
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user