AP1.10a: Initiative-Standardfelder vision, Zielzustand und Archetyp-Schlüssel.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m51s
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

Migration 016, Archetyp-Registry-API, erweitertes Profil-Modal und Plan-Profil-Ansicht.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-09 11:48:54 +02:00
1 parent 495993cad6
commit 408050bcb8
14 files changed
+342 -40

No files matched your search

+75 -18
View File
@@ -1,5 +1,8 @@
import { useEffect, useState } from 'react'
import { INITIATIVE_STATUSES, PRIORITIES } from '../constants/status.js'
import { INITIATIVE_STATUS_LABELS, PRIORITY_LABELS } from '../constants/status.js'
import { INITIATIVE_ARCHETYPE_LABELS } from '../constants/initiativeArchetypes.js'
import { listEntityArchetypes } from '../api/entityArchetypes.js'
export function InitiativeForm({
initial = {},
@@ -8,12 +11,38 @@ export function InitiativeForm({
busy = false,
submitLabel = 'Speichern',
}) {
const [archetypes, setArchetypes] = useState(null)
useEffect(() => {
let cancelled = false
listEntityArchetypes('initiative')
.then((items) => {
if (!cancelled) setArchetypes(items)
})
.catch(() => {
if (!cancelled) {
setArchetypes(
Object.entries(INITIATIVE_ARCHETYPE_LABELS).map(([key, label]) => ({
key,
label,
})),
)
}
})
return () => {
cancelled = true
}
}, [])
async function handleSubmit(e) {
e.preventDefault()
const form = e.target
await onSubmit({
title: form.title.value.trim(),
archetype_key: form.archetype_key.value,
goal: form.goal.value,
vision: form.vision.value,
target_state_summary: form.target_state_summary.value,
status: form.status.value,
priority: form.priority.value,
})
@@ -26,31 +55,59 @@ export function InitiativeForm({
<input name="title" defaultValue={initial.title || ''} required maxLength={255} />
</label>
<label>
Ziel
<textarea name="goal" rows={3} defaultValue={initial.goal || ''} />
</label>
<label>
Status
<select name="status" defaultValue={initial.status || 'active'}>
{INITIATIVE_STATUSES.map((s) => (
<option key={s} value={s}>
{INITIATIVE_STATUS_LABELS[s]}
Archetyp
<select
name="archetype_key"
defaultValue={initial.archetype_key || 'initiative.generic'}
disabled={!archetypes}
>
{(archetypes || []).map((item) => (
<option key={item.key} value={item.key}>
{item.label}
</option>
))}
</select>
</label>
<label>
Priorität
<select name="priority" defaultValue={initial.priority || 'normal'}>
{PRIORITIES.map((p) => (
<option key={p} value={p}>
{PRIORITY_LABELS[p]}
</option>
))}
</select>
Kurzbeschreibung (Ziel)
<textarea name="goal" rows={2} defaultValue={initial.goal || ''} />
</label>
<label>
Vision
<textarea name="vision" rows={4} defaultValue={initial.vision || ''} />
</label>
<label>
Zielzustand (Kurzfassung)
<textarea
name="target_state_summary"
rows={2}
defaultValue={initial.target_state_summary || ''}
/>
</label>
<div className="form-row form-row--2">
<label>
Status
<select name="status" defaultValue={initial.status || 'active'}>
{INITIATIVE_STATUSES.map((s) => (
<option key={s} value={s}>
{INITIATIVE_STATUS_LABELS[s]}
</option>
))}
</select>
</label>
<label>
Priorität
<select name="priority" defaultValue={initial.priority || 'normal'}>
{PRIORITIES.map((p) => (
<option key={p} value={p}>
{PRIORITY_LABELS[p]}
</option>
))}
</select>
</label>
</div>
<div className="form-actions">
<button type="submit" className="btn btn-primary" disabled={busy}>
<button type="submit" className="btn btn-primary" disabled={busy || !archetypes}>
{busy ? 'Speichern …' : submitLabel}
</button>
{onCancel && (