Erfassen und Transparent: Archetyp, Methode und Auspraegung in der UI sichtbar.
Test Suite / pytest-backend (push) Failing after 2s
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 3s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Failing after 50s

Method-Profiles-API und Auswahl beim Anlegen/Profil; Steuerungs-Meta in Listen und Plan; Projekt-Archetyp-Spiegel, Next-Action-Links und Umlaut-Fix fuer testbare Guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-10 12:36:12 +02:00
1 parent 95b743d6fd
commit efb45a3ee6
31 files changed
+965 -65

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@ import { InitiativeForm } from '../../components/InitiativeForm.jsx'
import { createInitiative } from '../../api/initiatives.js'
import { saveInitiativeDynamicFields, splitInitiativeFormPayload } from '../../api/entityFields.js'
import { ModeShell } from '../../components/ModeShell.jsx'
import { initiativeCatalogPath } from '../../utils/routes.js'
import { initiativeCatalogPath, scopedPath } from '../../utils/routes.js'
export function CockpitPage() {
const navigate = useNavigate()
@@ -30,7 +30,7 @@ export function CockpitPage() {
})
await saveInitiativeDynamicFields(created.id, dynamicFields)
setShowForm(false)
navigate(initiativeCatalogPath())
navigate(scopedPath('/plan/profile', { initiativeId: created.id }))
} catch (err) {
setFormError(err.message)
} finally {
+58 -5
View File
@@ -1,13 +1,18 @@
import { useEffect, useState } from 'react'
import { Link } from 'react-router-dom'
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
import { StatusBadge } from '../../components/StatusBadge.jsx'
import { LoadingState } from '../../components/LoadingState.jsx'
import { Modal } from '../../components/Modal.jsx'
import { InitiativeForm } from '../../components/InitiativeForm.jsx'
import { InitiativeSteeringMeta } from '../../components/InitiativeSteeringMeta.jsx'
import { MethodProfileSelect } from '../../components/MethodProfileSelect.jsx'
import { PriorityBadge } from '../../components/PriorityBadge.jsx'
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
import { initiativeArchetypeLabel } from '../../constants/initiativeArchetypes.js'
import { useEntityArchetypes } from '../../hooks/useEntityArchetypes.js'
import { scopedPath } from '../../utils/routes.js'
import {
getInitiativeFieldDefinitions,
getInitiativeFields,
@@ -74,9 +79,21 @@ function formatFieldValue(definition, value) {
function PlanProfileInner() {
const ops = useInitiativeOperations()
const { refreshInitiativeMeta } = useProgramScope()
const { initiative, loading, error, capabilities, formBusy } = ops
const { initiativeArchetypes } = useEntityArchetypes()
const {
initiative,
loading,
error,
capabilities,
formBusy,
steeringSnapshot,
steeringMethods,
methodBusy,
handleMethodProfileChange,
actors,
projects,
} = ops
const [editing, setEditing] = useState(false)
const canManage = capabilities.has('kairo.initiative.manage')
if (loading) {
@@ -87,6 +104,11 @@ function PlanProfileInner() {
return <p className="muted">Vorhaben nicht gefunden.</p>
}
const ownerName =
actors.find((actor) => actor.id === initiative.owner_actor_id)?.name ||
initiative.owner_actor_id ||
'—'
async function handleSave(payload) {
const ok = await ops.handleUpdateInitiative(payload)
if (ok) {
@@ -115,9 +137,40 @@ function PlanProfileInner() {
</div>
</header>
{error && <p className="error">{error}</p>}
<InitiativeSteeringMeta
archetypeKey={initiative.archetype_key}
initiativeArchetypes={initiativeArchetypes}
steeringSnapshot={steeringSnapshot}
steeringMethods={steeringMethods}
/>
{canManage && (
<div className="plan-profile__steering-edit">
<MethodProfileSelect
archetypeKey={initiative.archetype_key}
value={steeringSnapshot?.method_profile_key || ''}
disabled={methodBusy}
onChange={handleMethodProfileChange}
/>
</div>
)}
<div className="plan-profile__field">
<h3 className="plan-profile__label">Archetyp</h3>
<p>{initiativeArchetypeLabel(initiative.archetype_key)}</p>
<h3 className="plan-profile__label">Verantwortlich (Owner)</h3>
<p>{ownerName}</p>
</div>
<div className="plan-profile__field">
<h3 className="plan-profile__label">Struktur</h3>
<p>
{projects.length} Projekt{projects.length === 1 ? '' : 'e'} ·{' '}
<Link to={scopedPath('/plan/structure', { initiativeId: initiative.id })}>
Struktur pflegen
</Link>
</p>
</div>
<div className="plan-profile__field">
<h3 className="plan-profile__label">Priorität</h3>
<p>
<PriorityBadge priority={initiative.priority} />
</p>
</div>
{initiative.goal ? (
<div className="plan-profile__field">
@@ -3,10 +3,13 @@ import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.
import { ProjectsSection } from '../../components/ProjectsSection.jsx'
import { LoadingState } from '../../components/LoadingState.jsx'
import { useInitiativeOperations } from '../../context/InitiativeOperationsContext.jsx'
import { useEntityArchetypes } from '../../hooks/useEntityArchetypes.js'
function PlanStructureInner() {
const ops = useInitiativeOperations()
const { initiativeArchetypes, projectArchetypes } = useEntityArchetypes()
const {
initiative,
initiativeId,
projects,
roadmapItems,
@@ -35,6 +38,9 @@ function PlanStructureInner() {
onDelete={ops.handleDeleteProject}
onReorder={ops.handleReorderProjects}
busy={ops.formBusy}
initiativeArchetypeKey={initiative?.archetype_key}
initiativeArchetypes={initiativeArchetypes}
projectArchetypes={projectArchetypes}
/>
</>
)